- Joined
- Jan 18, 2005
- Messages
- 5,782
Is there a way to assign custom value of unit other type than integer (string will be the most useful)?
globals
[...]
endglobals
function CastS2I takes String s returns integer
return s
return 0
endfunction
call SetUnitUserData( <unit> , CastS2I( <String> ))
function CastI2S takes integer i returns string
return i
return ""
endfunction
set <String> = CastI2S(GetUnitUserData( <unit> ))
LordZsar1 said:Try this (I have no idea, if it works):
JASS:function CastS2I takes String s returns integer return s return 0 endfunction call SetUnitUserData( <unit> , CastS2I( <String> )) function CastI2S takes integer i returns string return i return "" endfunction set <String> = CastI2S(GetUnitUserData( <unit> ))