SCRMaps
/
Sign in

Toggle skills

Give a Corsair a cloak button and it still will not cloak - the executable refuses the order.

6 min read

A toggle - cloak, a stance, an aura - cannot be built by giving the unit the real button, because cloak and several other abilities are enforced in the executable against the unit type. A Corsair with a cloak button issues the order and the game refuses it.

  1. 1Point the button at a harmless order - something your map never issues otherwise, such as Reaver Stop or Carrier Stop - and read that order id back off the unit.
  2. 2Do the real thing yourself by writing the unit's secondary order: 109 to cloak, 110 to decloak.
  3. 3Then set the unit's order back to Stop, which is 2.

Leave the last step out and the toggle flickers on and off every cycle, because the signal order is still set and reads as another press next pass. The code looks right and the thing just blinks.

The shape generalises past cloak: whenever the executable refuses an ability, use the button only as a signal and produce the effect yourself. With several units, keep them in a UnitGroup and iterate that - and do not skip the step in the loop that reaps dead members.

The procedure above is written with MoveUnit, and moving through the struct is several times cheaper. It also keeps the order and the attack target, which MoveUnit wipes - so “still attacking while being pushed” only works that way. For a push that runs every cycle the switch is worth making.

Moving a unit yourselfBuilding a skill
Sign in to track your progress