• 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.

[JASS] finding unit type raw

Status
Not open for further replies.
'h001' is an integer. It is the 4-bytes integer of the ASCII string "h001".

You want the integer Id or the string Id? If you want the string, you can use the Blizz's function :
JASS:
//===========================================================================
// Convert a integer id value into a 4-letter id code.
//
function DebugIdInteger2IdString takes integer value returns string
    local string charMap = ".................................!.#$%&'()*+,-./0123456789:;<=>.@ABCDEFGHIJKLMNOPQRSTUVWXYZ[.]^_`abcdefghijklmnopqrstuvwxyz{|}~................................................................................................................................."
    local string result = ""
    local integer remainingValue = value
    local integer charValue
    local integer byteno

    set byteno = 0
    loop
        set charValue = ModuloInteger(remainingValue, 256)
        set remainingValue = remainingValue / 256
        set result = SubString(charMap, charValue, charValue + 1) + result

        set byteno = byteno + 1
        exitwhen byteno == 4
    endloop
    return result
endfunction
There are other versions of this function, though.

If you want the integer rawcode, then you have surely made a mystake somewhere :goblin_yeah:.

Edit : Yes, mistake, ofc. I made it on purpose. Ahem...
 
Last edited:
Status
Not open for further replies.
Top