• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Hashtable] Pre-saving unit orders

Status
Not open for further replies.

Ardenian

A

Ardenian

Hello,

since it seems as if there is no way to use variables with an array to save specific unit orders, like SiphoonLoop or other spell orders,

is there a way to do so using hashtables and custom scripts ?
 
If you mean the orderstring like "thunderbolt", "attack", "stop", etc.
You can use OrderId(string) to get the equivalent integer of those orders. Use GetHandleId(unit) with OrderId(string) to save a specific order to a specific unit.
Something like SaveInteger(hash, handleid, 0, orderid) to save and LoadInteger(hash, handleid, 0) to load.
 
Each order has an id. The id is an integer.

constant native GetIssuedOrderId takes nothing returns integer returns the orderId on trigger events.

native GetUnitCurrentOrder takes unit whichUnit returns integer returns the orderId that a unit currently has.

constant native OrderId takes string orderIdString returns integer lets you get the orderId of oder strings, for example "attack", "stop", ... .
 
So, in GUI/ Custom Scripts this could look like:

Orb_OrderId[1] is an integer variable:

  • Custom Script: set Orb_OrderId[1] = OrderId(curse)
  • Hashtable - Save Orb_OrderId[i] as 0 of Orb_TempInteger in Hash_StackingOrbs
  • Hashtable - Load Orb_OrderId[i] as 0 of Orb_TempInteger in Hash_StackingOrbs
 
For the custom script ?

  • Custom Script: set Orb_OrderId[1] = OrderId("curse")
 
Status
Not open for further replies.
Back
Top