KeyMapping, UserActions and LUA

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
Hamburger
Posts: 1
Joined: Tue Jul 15, 2008 12:49 pm

KeyMapping, UserActions and LUA

Post by Hamburger »

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?
Last edited by Hamburger on Fri Jan 02, 2009 7:48 pm, edited 1 time in total.
agi_shi
Posts: 122
Joined: Mon Feb 26, 2007 12:46 am

Post by agi_shi »

Google Luabind.
Kknd
Posts: 1
Joined: Sun Jul 27, 2008 9:40 pm
Contact:

Post by Kknd »

I use Lua for creating scriptable levels and read / write configuration files.

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

And things like that. Things thant aren't hardcoded == customization and flexibility!
Post Reply