Page 1 of 1

Dynamic key binding during gameplay (Help).

Posted: 15 Mar 2012, 07:05
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!

Re: Dynamic key binding during gameplay (Help).

Posted: 15 Mar 2012, 15:40
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

Re: Dynamic key binding during gameplay (Help).

Posted: 16 Mar 2012, 03:15
by Nihility
Can I use KeyPress to bind/unbind keys in real time? That is essentially what I am looking for.