• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

hashtable parrent issued order, value unit type?

Status
Not open for further replies.
S2I converts a number string to integer, integer i = S2I("521")
You need to use other order function that converts an order to integer, String2OrderIdBJ("humanbarracks")
 
S2I converts a number string to integer, integer i = S2I("521")
You need to use other order function that converts an order to integer, String2OrderIdBJ("humanbarracks")

This is wrong, not sure exactly why, but i Load 0 instead of the unit type.

JASS:
set i = LoadInteger(hash, GetIssuedOrderId(), 0)

call SaveInteger(hash, OrderId("humanbarracks"),0,'hbar')

and if it can't find a match it will return 0 right? Debug states this statement is correct.
 
Last edited:
No it is not wrong, I told you to use BJ function but you tried to be cool and didn't use it.You can look into BJ function for more details.
 
Just to round off with the reason why the BJ was used...
JASS:
function String2OrderIdBJ takes string orderIdString returns integer
    local integer orderId
    set orderId = OrderId(orderIdString)
    if (orderId != 0) then
        return orderId
    endif
    set orderId = UnitId(orderIdString)
    if (orderId != 0) then
        return orderId
    endif
    return 0
endfunction
There are two separate natives used to convert order strings into order id numbers. In this case it must be using the native "UnitId" instead of "OrderId". As such it should be possible to inline with "UnitId" for better performance.
 
Status
Not open for further replies.
Back
Top