Hi, folks! Greez from Germany.
I have a important question for you game dev masters.
Is there any good way to use lua mixed with c++
for user actions like moving, jumping and so on?
The traditional way to do the player controls are KeyActionMaps in c++,
maybe some config files and hardcoded player-actions.
But what if you want to do all the game-entity specific stuff in Lua?
Scripting the whole input manager?
Or only the player actions?
I use XML to configurate the (default) controls.
Not scripting the user actions in lua at all?
Is this to slow?
Complete hardcoding?
What is the best way to do this?
KeyMapping, UserActions and LUA
KeyMapping, UserActions and LUA
Last edited by Hamburger on Fri Jan 02, 2009 7:48 pm, edited 1 time in total.
I use Lua for creating scriptable levels and read / write configuration files.
Example of config file (in Lua):
And things like that. Things thant aren't hardcoded == customization and flexibility!
Example of config file (in Lua):
Code: Select all
Keys = {
shoot = "k",
run = "r",
}
very simple, and for level scripting I export some high-level C++ functions to Lua, and the script looks like:
ship.addEnemyShip({0, 10, 0}, aitype, model)
if player.getLife > 50 then
... do some cutom stuff
end