function s2i takes string s2s returns integer
return s2s
call DoNothing()
return 0
endfunction
function InitS2RAW takes nothing returns nothing
set S2RAW[s2i("0")]=48
set S2RAW[s2i("1")]=49
set S2RAW[s2i("2")]=50
set S2RAW[s2i("3")]=51
and
Spoiler:
function Str2RAW takes string s2s returns integer
return S2RAW[s2i(SubString(s2s,0,1))]*0x1000000+S2RAW[s2i(SubString(s2s,1,2))]*0x10000+S2RAW[s2i(SubString(s2s,2,3))]*0x100+S2RAW[s2i(SubString(s2s,3,4))]
endfunction
function RAW2Str takes integer I2I,player p2p returns nothing
local string s2s
set s2s=S2RAWa[I2I/0x1000000]+S2RAWa[(I2I-0x1000000*(I2I/0x1000000))/0x10000]+S2RAWa[((I2I-0x1000000*(I2I/0x1000000))-0x10000*((I2I-0x1000000*(I2I/0x1000000))/0x10000))/0x100]+S2RAWa[((I2I-0x1000000*(I2I/0x1000000))-0x10000*((I2I-0x1000000*(I2I/0x1000000))/0x10000))-0x100*(((I2I-0x1000000*(I2I/0x1000000))-0x10000*((I2I-0x1000000*(I2I/0x1000000))/0x10000))/0x100)]
call DisplayTextToPlayer(p2p,0,0,s2s)
endfunction
function s2i takes string s2s returns integer
local integer ii2ii=48
loop
exitwhen ii2ii>122
if(S2RAWa[ii2ii]==s2s)then
return ii2ii
endif
set ii2ii=ii2ii+1
endloop
return 0
endfunction
function InitS2RAW takes nothing returns nothing
set S2RAW[s2i("0")]=48
set S2RAW[s2i("1")]=49
set S2RAW[s2i("2")]=50
set S2RAW[s2i("3")]=51
and
Spoiler:
function Str2RAW takes string s2s returns integer
return s2i(SubString(s2s,0,1))*0x1000000+s2i(SubString(s2s,1,2))*0x10000+s2i(SubString(s2s,2,3))*0x100+s2i(SubString(s2s,3,4))
endfunction
function RAW2Str takes integer I2I,player p2p returns nothing
local string s2s
set s2s=S2RAWa[I2I/0x1000000]+S2RAWa[(I2I-0x1000000*(I2I/0x1000000))/0x10000]+S2RAWa[((I2I-0x1000000*(I2I/0x1000000))-0x10000*((I2I-0x1000000*(I2I/0x1000000))/0x10000))/0x100]+S2RAWa[((I2I-0x1000000*(I2I/0x1000000))-0x10000*((I2I-0x1000000*(I2I/0x1000000))/0x10000))-0x100*(((I2I-0x1000000*(I2I/0x1000000))-0x10000*((I2I-0x1000000*(I2I/0x1000000))/0x10000))/0x100)]
call DisplayTextToPlayer(p2p,0,0,s2s)
endfunction
i assumed they were doing the same thing o.o was i right? xD
And....>.>....In the RAW2Str function.....there's that really long set....which seems redundant....
reproduced:
It doesn't make sense to me o.o
like...the second thing you add is S2RAWa[(I2I-0x1000000*(I2I/0x1000000))/0x10000]
I2I is just another variable (like x) and is an integer and the 0x makes the number after it go from hex to dec
so (I2I-16777216*(I2I/16777216))/65536
following pemdas (order of operations), you divide I2I by 16777216 then multiply that by 16777216....
then you SHOULD get I2I o.o so I2I-I2I=0...and 0 divided by anything is 0....so its 0?
the third thing is
S2RAWa[((I2I-0x1000000*(I2I/0x1000000))-0x10000*((I2I-0x1000000*(I2I/0x1000000))/0x10000))/0x100]
in dec it is...
((I2I-16777216*(I2I/16777216))-65536*((I2I-16777216*(I2I/16777216))/65536))/256
PEMDAS:
((I2I-I2I)-65536*(I2I-I2I)/65536)/256 reduced the 16777216
((I2I-I2I)-(I2I-I2I))/256 reduced the 65526
(0-0)/256 subtracted....and got
0
the first one's probably jj's original cp, the 2nd one is probably fatherspace's 1.24+ jjcp as for the rest i havent actually read what your asking
If you have any questions drop in by chat sometime, chances are there'll be someone who can help you that's afking there, so the next best thing is to click the link on UndeadxAssassin's Sig and ask your question there.
That's the formula to switch from RAWCode to item id, basically. WC3 engine has a 10 number code for every item/unit id. That formula switches it to the four number/letter combo that you know as RAWCodes.
(20:53:52) Bartimaeus: Thank you, Jen.
(20:53:56) Bartimaeus: Truly, you are wise.
(23:44:12) Bartimaeus: I was in pubic school until middle school...