I'm implementing a building that needs to execute a particular bit of Lua when first constructed. I'm reasonably familiar with but not an expert on Lua and scripting in general.
Is there a generally accepted best way to do this?
I did find this: http://forums.civfanatics.com/showpost.php?p=9899570&postcount=3 - I could get it working by using the code lemmy101 put together, I think, but that feels like an extraordinarily heavyweight implementation for what ought to be pretty basic functionality.
Any responses appreciated.
UPDATE: I got it working using lemmy101's code from the link above; I had to do some debugging and it still doesn't handle save/reloads smoothly, but I'll be able to fix that. If there's a less arduous way of doing it, I would still love to hear it, though.
Is there a generally accepted best way to do this?
I did find this: http://forums.civfanatics.com/showpost.php?p=9899570&postcount=3 - I could get it working by using the code lemmy101 put together, I think, but that feels like an extraordinarily heavyweight implementation for what ought to be pretty basic functionality.
Any responses appreciated.
UPDATE: I got it working using lemmy101's code from the link above; I had to do some debugging and it still doesn't handle save/reloads smoothly, but I'll be able to fix that. If there's a less arduous way of doing it, I would still love to hear it, though.