So I thought on it, and maybe? Im not afraid to try.
Ive managed to get the main.lua file that I see in some mods to accept a specific creature instead of a species, and as far as Im concerned thats more progress than a less curious person would have.
I dont know if main.lua is the only lua file accepted, what lua is, or even how .cpp and .h files play into that, but .h files seem to name variables and ids, while .cpp files have the meats.
It appears I need to get the game to register a new deathtype or special attack. From there, with some inspiration, I could cannibalize existing code into something that might function, but I dont know if I can define new variables in lua.
I’m not sure, but my gut says no. Have you seen the class_definitions.lua in the lua directory? There are a lot of predefined functions available to manipulate creatures and the environment. Perhaps something in there will help?
I beat my head against the lua brick wall whenever I feel like getting frustrated and angry at a computer screen. I’m considering springing for some online classes in c++ and lua or something similar to give myself a better foundation, this self-taught-no-lessons crap is bad for the blood pressure.
If I’m not mistaken, there currently isn’t code to handle custom on_hit effects for monster attacks. One thing we could do, however, is refactor the on_hit effect handling to something similar to iuse actions. This would let you register a function in lua as an on_hit effect, which could then be used in the json definition to tell the game to use that function for the effect. I’ll take a look at this later in the week/weekend to see if I can get something going.