Page 1 of 1

Give Order

Posted: 24 Sep 2010, 15:39
by smoth

Code: Select all

Spring.GiveOrderToUnit

 ( number unitID,
   number cmdID,
   params = {number, etc...},
   options = {"alt", "ctrl", "shift", "right"} ) -> nil

Spring.GiveOrderToUnitMap

 ( unitMap = { [unitID] = dontCare, etc... },
   number cmdID,
   params = {number, etc...},
   options = {"alt", "ctrl", "shift", "right"} ) -> nil

Spring.GiveOrderToUnitArray

 ( unitArray = { [1] = unitID, etc... },
   number cmdID,
   params = {number, etc...},
   options = {"alt", "ctrl", "shift", "right"} ) -> nil

Spring.GiveOrderArrayToUnitMap

 ( unitMap = { [number unitID] = dontCare, etc... },
   orderArray = {
     { number cmdID,
       {number, etc...},     params
       {"alt", "ctrl", "shift", "right"}   options
     }, ..
   }
 ) -> nil

Spring.GiveOrderArrayToUnitArray

 ( unitArray = { [1] = number unitID, etc... },
   orderArray = {
     { number cmdID,
       {number, etc...},    params
       {"alt", "ctrl", "shift", "right"}   options
     }, ..
   }
 ) -> nil
This is bad because the key bindings may change and if you rely on set hotkeys that means your gadget will break if the user changes hotkeys.

so i am left asking why? is there a way to give a unit an order without having to use the hotkeys? Did I miss something?

Re: Give Order

Posted: 24 Sep 2010, 15:53
by Argh
I could have sworn that the control-key params (ctrl, etc.) were generically provided by the engine, i.e., it isn't really mapped to ctrl, it's mapped to whatever the command is mapped to. Test re-binding them to something weird- if it breaks, I'd strongly support an engine change, because the only other way to fix it is to force the keybinds for your game.

Re: Give Order

Posted: 24 Sep 2010, 17:10
by smoth
ah, options can be 0, thanks nemo.

Re: Give Order

Posted: 24 Sep 2010, 18:14
by Argh
Yar, that too. I thought you meant you had to have the shift param, like in the copy-orders script I use.