🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Lua Question

Started by
1 comment, last by Illumini 21 years, 1 month ago
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
Advertisement
This thread might give you a few hints:
http://www.gamedev.net/community/forums/topic.asp?topic_id=148183

This topic is closed to new replies.

Advertisement