Viper Woes
I have a small blog post for ya, but it’s mostly for my sake. I made some very stupid mistakes over the past week with Viper, and I wish to share them with you (and archive the solutions for when I inevitably make them again).
First off, I had this code to create ConCommands:
pCmd = new ConCommand(new_name, CommandCallback, new_help, flags);
It took me around three or four days to realize I wasn’t registering pCmd. I slipped in META_REGCVAR(pCmd), and it works beautifully
Secondly, and lastly, I had consistency issues with paths. Windows is very annoying because it uses backslashes instead of forward slashes. This means that I have to escape every directory in a path. Thankfully, Python accepts both forward and back slashes in paths. However, a trie a does not. I had a lot of trouble determining why Viper couldn’t recognize which plug-in called Register (that function finds the path of the script which called it, looks it up in the trie, then updates the plug-in’s info). After a lot of searching, it finally dawned on me that the path entered into the trie and the path from Register were different. You can thank my shotty eyesight; I had printed out the two paths into the console and still couldn’t see any differences for the longest time ![]()