Jump to content
  • Advertisement
Sign in to follow this  
DrEvil

Lua programming

This topic is 4977 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

I have a question about lua. I'm considering using lua for a scripting language for a first person shooter bot. I would like to expose some of the bots behavior and events to lua for flexibility. Would it be beneficial for each AI agent to have its own lua state so that they can use different versions of various functions and have their own variables? How would one go about emulating something along these lines? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You can do that if you like, but it's usually not worth it, especially since it forces you to replicate the game state across all the Lua states. If you feel like it, you can have each bot running in its own function environment, but IMHO this is usually overkill too. Each bot should be encapsulated in a table, which is sufficient to hold their variables.

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!