Easy state toggling

Easy state toggling

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

Moderator: Moderators

Post Reply
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Easy state toggling

Post by Google_Frog »

2 simple widgets that allow people to more easily toggle their unit's firestates or movestates.

Reverse Toggle toggles the states backwards when the icon is right clicked on.

State Remove removes unwanted states by skipping over them when toggling. It can be used to remove an unwanted state such as Return Fire. It is set to remove Roam and Return Fire by default.
Attachments
cmd_state_remove.lua
Removes 'return fire' and 'roam' states
(1010 Bytes) Downloaded 64 times
cmd_state_reverse_toggle.lua
Makes fire and movestates reverse toggleable
(1.28 KiB) Downloaded 22 times
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Easy state toggling

Post by lurker »

But neither one will simply let me click the button and have it show up instantly so I can click it again?
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Easy state toggling

Post by manolo_ »

could u give a not exp. lua-maker a list of commands for the other stuff?
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Easy state toggling

Post by Gota »

All i want is a shortcut key for them
User avatar
JohannesH
Posts: 1793
Joined: 07 Apr 2009, 12:43

Re: Easy state toggling

Post by JohannesH »

remove state + hotkey should be cool, the states are removed when toggling with key too, not just UI icon right?

And what are the lines to switch those states in UIkeys?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Easy state toggling

Post by Beherith »

/bind alt+s movestate [0-2]
/bind alt+f firestate [0-2]
User avatar
JohannesH
Posts: 1793
Joined: 07 Apr 2009, 12:43

Re: Easy state toggling

Post by JohannesH »

thanks, and another question about keys; how do i get to use the ├Ñ├ñ├ keys on my keyboard in spring?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: Easy state toggling

Post by trepan »

from uikeys.txt:
"KeySet Format" section :
If you want to use a key that is unknown to Spring,
then you may use the hexadecimal notation.

/keysyms : prints the known keysyms to standard out
/keycodes : prints the known keycodes to standard out
/keydebug : prints debugging information to standard out (for each keystroke)

Enable /keydebug 1, and see what you get
(assuming the command still works).
Post Reply

Return to “Lua Scripts”