Hi all, I am currently working on a mod called EndlessWaltz that basically implements tower defense features to the game.
http://i.imgur.com/OVWjCus.jpg (The wave didn't start yet so I went hunting for units with grenades to test if the kills were being counted properly.)
Being the lazy guy I am, I doubt I will actually go into creating more units/items. However I would like to make this mod available for other people to be able to hook into if they wish.
What would be the best way of doing this? From having interacted with the story elements in the campaign and trying to mix it together with this, I've come across some problems whereby any mod that registers any onevent can overwrrite my lua code. Is there a way to protect my function from being overwritten?
Also I have a few functions where the users can pass in their own arguments to set what units spawn, how much reward point(in progress) is rertrieved, what items can be bought with, how much points each type gives, etc. Is there a way user can call my functions from their mod?
Thanks in advance!
blah900
Calling my mod from another mod?
Re: Calling my mod from another mod?
Yes, all you do is provide a script interface, which basically means wrap the functions that you want other mods to be able to call inblah900 wrote:Is there a way user can call my functions from their mod?
Code: Select all
remote.addinterface("interface_name_typically_mod_name", {
--functions here (in "name = function(args) --code end" format) seperated by ','s
})
Really? They shouldn't be able to overwrite it, they are simply able to run their own code 'simultaneously' (wow, I spelled that properly the first time!), while they might be able to overwrite a change that your function performed they are not actually overwriting your function, there is a slight difference An example of what you meant might be a little more helpful here, but honestly I'm not sure you could prevent that...blah900 wrote:I've come across some problems whereby any mod that registers any onevent can overwrrite my lua code.