Dynamic key binding during gameplay (Help).

Dynamic key binding during gameplay (Help).

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
Nihility
Posts: 3
Joined: 15 Mar 2012, 06:58

Dynamic key binding during gameplay (Help).

Post by Nihility »

Hi all;
I have a question for you about changing control schemes during gameplay. In the game I am developing, users switch between 1st and 3rd person mode, and I wish for the same keys to be allocated towards different commands in each state. I have a comprehension of the uikeys.txt to an introductory extent, but I am not sure how to script such that different areas are read first based on in game events. If someone could present to me the ideal scheme for this, it would be much to my appreciation.

An example of what I mean is:
3rd Person Mode: Press X: Action A
*Views swap based on user input*
1st Person Mode: Press X: Action B
*Views swap based on user input*
3rd Person Mode: Press X: Action A
etc etc...

Thanks in advance!
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Dynamic key binding during gameplay (Help).

Post by knorke »

you can bind and unbind keys:
http://springrts.com/phpbb/viewtopic.ph ... endcommand

Or use some callins like KeyPress() to do your own key handling.
http://springrts.com/wiki/LuaCallinReturn
Nihility
Posts: 3
Joined: 15 Mar 2012, 06:58

Re: Dynamic key binding during gameplay (Help).

Post by Nihility »

Can I use KeyPress to bind/unbind keys in real time? That is essentially what I am looking for.
Post Reply

Return to “Lua Scripts”