Jump to content

Run Time LUA


zumwalt
 Share

Recommended Posts

I would like the ability to use LUA script while the game is running, I am writing all my game code in C++ and I have the need to be able to give the user an in game interface where I will give them a command reference library, they then write tiny code segments that give life to objects and have the ability to save and share their files that are specific to the game. I need four basic things to begin with

 

LUA::Load(FileStream or ByteStream)

LUA::Run(Object)

LUA::Destroy(Object)

LUA::Save(FileStream or ByteStream)

 

All files would go in the game directory, or database like MySQL or SQLLite.

Most likely the way I am gearing the game for portability, they would land in MySQL on a hosted server.

 

I will be defining construct shells such as Patrol, Search, Flee, Attack, Defend, Harvest, etc, the user codes these based on modules they enhance their game objects with, such as if they have a Radar attached in the Patrol sequence they check Radar and see if Enemy is present, if so depending on the Radar level, as in Level 1 has basic information about the enemy but maybe not enough to know how powerful they are, they can make the code change the state from Patrol to Attack.

 

Then in the Attack sequence if the enemy is pounding them they can change the state based on current shield or armor percentage left from Attack to Flee, so on and so forth, but they would have to code all this logic themselves based on my script library of commands.

Link to comment
Share on other sites

Will look it up tomorrow then and play with LuaJIT and see if that will do what I need to do, at the moment I am concentrating on getting Photon to work with Leadwerks natively, I want to show some demo's of Photon and MMO layout if I can get it to work but the LUA piece is more of a wish to have item with native support, here is to hoping what you are talking about will work. Thanks Rick.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...