Sign in to follow this  

Lua programming

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

This topic is 4812 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this