- Joined
- Jan 18, 2005
- Messages
- 5,781
Is there a way to assign custom value of unit other type than integer (string will be the most useful)?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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> ))
