Convert 1093751894 to A1TV

Skippy

Active Member
Reaction score
39
Hi,
So basically all IDs (unit ID, ability ID) are integers. But they look like:
'A000' or 'h001'

How can I convert "normal" decimal integer to this type of integer?
 

Jedi

New Member
Reaction score
63
JASS:
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


Take a look at there too, http://www.thehelper.net/forums/showthread.php?t=153883

Lol I tested above function with thunder clap, but it tells me "Blud" =)
 

Skippy

Active Member
Reaction score
39
Great. It works. Just one dot is missing in charMap string (ability A000 was transformed into B111 :p)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top