Perkus
Prince
The Modders' Guide p.13-14 shows how you can call the same function from different .lua script files by wrapping it with LuaEvents.FunctionName.Add(); I was able to successfully use this in an earlier mod where the function did not return any values.
I'm working on another mod where I need a shared function to return a value. I wrote it the same way, but it doesn't work right. The modder's guide doesn't address this situation. I'm guessing that going through this LuaEvents() hook prevents it from returning a value to the caller. Am I understanding this right? Is there something I can do to share a function that needs to return a value?
I guess I can duplicate the function in both files if I have to but it's very bad practice to have to maintain two identical versions...
Thanks in advance for any help you can provide.
I'm working on another mod where I need a shared function to return a value. I wrote it the same way, but it doesn't work right. The modder's guide doesn't address this situation. I'm guessing that going through this LuaEvents() hook prevents it from returning a value to the caller. Am I understanding this right? Is there something I can do to share a function that needs to return a value?
I guess I can duplicate the function in both files if I have to but it's very bad practice to have to maintain two identical versions...
Thanks in advance for any help you can provide.