Jump to content
  • Advertisement
Sign in to follow this  
Kelly G

Lua.registerFunction: many instances

This topic is 4126 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just starting with Lua embedded in C# with LuaInterface, and I'm using the tutorial on this very site. So I have a question about Lua.registerFunction. The second parameter is the "Target" ,which is of type object. I presume this is instance for which the member function will be called. So if you say "go()" in Lua it will run "target.go()" in C#. So what if you have multiple instances, each with scripts that can affect local variables. Would you register each instances member seperately? If so, how would you name them in the script? Alternatly, Would you register the functions dynamically when you run the code for each instance? I'm assuming you wouldn't want to have a seperate Lua interpreter instantiated for each one, but maybe that's how it's done. Anyone know?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!