Lua Question
I''ve recently begun messing with Lua and want to use it in a small project I''m working on. From the article here on gamedev I now know how to bind C functions and all that. I also read online how to call a function within a lua script. Basically when you call dofile on a file that has functions in it, it merely exposes them so you can use the with the stack to call them right?
Well here''s my question (if anyone has messed with Dink Smallwood you know what I mean heh)
For my scripting system all obejects will be able to have script. And each object should have a few basic functions that the game can call. OnMain(), OnHit(), OnTalk(), etc.
Now if I have a few dozen scripts opened at any time there will be many OnTalk() functions exposed to lua. To solve thisdo I need to have a lua_State for each script? If so, global variables wouldn''t be so global would they heh..
I''m sure this is something simple to do. Just wondering if anyone can point me in the right direction.
Thanks
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement