Ok, I tried to follow your explaination.
This causes compile error - Custom script: set udg_Integer = 'hxxx' I cannot save map
I need a solution asap. Cannot save map with these custom scripts. What's wrong?
So when I do custom script correct would this work?
Set MissileUnitType[5] = Sabretooth Heavy Missile (Space)
Custom script: set udg_Integer = 'h029' (compile error)
Hashtable - Save 50.00 as 0 of Temp_Integer in HashDamageData
Hashtable - Save 1.00 as 1 of Temp_Integer in HashDamageData
Hashtable - Save 76 as 2 of Temp_Integer in HashDamageData
Hashtable - Save 20 as 3 of Temp_Integer in HashDamageData
Hashtable - Save 2500 as 4 of Temp_Integer in HashDamageData
Hashtable - Save 4000 as 5 of Temp_Integer in HashDamageData
Hashtable - Save 1500.00 as 7 of Temp_Integer in HashDamageData
Hashtable - Save 25.00 as 8 of Temp_Integer in HashDamageData
Edit
so I spent entire day struggling to make it work. Not sure its working yet...
Ended up with this
Set MissileUnitType[1] = Piranha Light Missile (Space)
Set TempString = (String(MissileUnitType[1]))
Custom script: set udg_Temp_Integer = String2Id(udg_TempString)
String2Id is not a standard wc3 function and is an ascii system
function Char2Id takes string c returns integer
local integer i = 0
local string abc = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
local string t
loop
set t = SubString(abc,i,i + 1)
exitwhen t == null or t == c
set i = i + 1
endloop
if i < 10 then
return i + 48
elseif i < 36 then
return i + 65 - 10
endif
return i + 97 - 36
endfunction
function String2Id takes string s returns integer
return ((Char2Id(SubString(s,0,1)) * 256 + Char2Id(SubString(s,1,2))) * 256 + Char2Id(SubString(s,2,3))) * 256 + Char2Id(SubString(s,3,4))
endfunctionEnds up with a number which is actually very long like 8-10 digits. Not sure if hashtable has a limit like arrays.
Or I'm doing this wrong? I'm going to bed this is pain to make it work. Somehow editor saved without error, but I doubt it works I do not completely understand it yet.