Issues with copy-pasted entity code Created 1 year ago2023-11-28 23:20:44 UTC by nulcow nulcow

Created 1 year ago2023-11-28 23:20:44 UTC by nulcow nulcow

Posted 1 year ago2023-11-28 23:20:44 UTC Post #348104
I'm making a simple monster for my mod which is basically a copy of the Barney entity. I copied barney.cpp from the source code, then renamed everything to the name of my custom monster. I took care to make sure that everything was using the right case (i.e. CBarney vs. BARNEY_AE_DRAW vs. monster_barney), that the file paths were correct, and that the code still made sense. Even though it compiles fine and I can't see what I did wrong, I get the error message Can't init monster_custom in the console. This is the code I used (you can see at this point I've just replaced "barney" with the name of the monster):
https://pastebin.com/gicA49DR (using pastebin because the code was too long)

models/custom.mdl and sound/custom/... are real files and directories and have the expected contents.

EDIT: I am a moron. The solution was to actually compile the DLL and fix all the errors. I forgot I didn't even try to recompile first.
Posted 1 year ago2023-11-29 01:45:00 UTC Post #348105
Instead of copy-pasting, consider extending the CBarney class and overriding the methods those are different for your CCustom class.
You must be logged in to post a response.