- Joined
- Jul 8, 2007
- Messages
- 146
Please, I desperately need help. I added two custom heroes from wc3c and imported all their abilities and necessary buffs, effects, dummies, etc. After finishing to adjust the raw codes from the first one, everything worked perfect. Then I added another hero (Grim Pharaoh) and after adding all of HIS abilities, buffs, effects and dummies, I copy and pasted the necessary custom script right below the one for the first Hero (Scarlet Crusader). However, then I tried to save it and I got 345 compile errors. I don't really get why... After searching the forums for 2 hours to find a solution, I saw I had to Handle Vars or something like that but I deleted one and it still gives me errors...
Here's my current script:
If anyone can help I'll +Rep... please help...
Here's my current script:
JASS:
//HANDLE VARS
// ===========================
function H2I takes handle h returns integer
return h
return 0
endfunction
// ===========================
function LocalVars takes nothing returns gamecache
if udg_cache == null then
call FlushGameCache(InitGameCache("cach"))
set udg_cache=InitGameCache("cach")
endif
return udg_cache
endfunction
function SetHandleHandle takes handle subject, string name, handle value returns nothing
if value==null then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
endif
endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing
if value==0 then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleReal takes handle subject, string name, real value returns nothing
if value==0 then
call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
else
call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleString takes handle subject, string name, string value returns nothing
if value==null then
call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
else
call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function GetHandleHandle takes handle subject, string name returns handle
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleUnit takes handle subject, string name returns unit
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTextTag takes handle subject, string name returns texttag
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandlePlayer takes handle subject, string name returns player
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function FlushHandleLocals takes handle subject returns nothing
call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
//--------------------------------------------------------------------------------\\
//--------------------------------------------------------------------------------\\
//--------------------------------------------------------------------------------\\
//--------------------------------------------------------------------------------\\
function SetInt takes handle h,string n,integer v returns nothing
if v==0 then
call FlushStoredInteger(Cache(),I2S(H2I(h)),n)
else
call StoreInteger(Cache(),I2S(H2I(h)),n,v)
endif
endfunction
function SetReal takes handle subject,string name,real value returns nothing
if value==0 then
call FlushStoredReal(Cache(),I2S(H2I(subject)),name)
else
call StoreReal(Cache(),I2S(H2I(subject)),name,value)
endif
endfunction
function SetHandle takes handle subject,string name,handle value returns nothing
call SetInt(subject,name,H2I(value))
endfunction
function GetInt takes handle subject,string name returns integer
return GetStoredInteger(Cache(),I2S(H2I(subject)),name)
endfunction
function GetReal takes handle subject,string name returns real
return GetStoredReal(Cache(),I2S(H2I(subject)),name)
endfunction
function GetUnit takes handle subject,string name returns unit
return GetStoredInteger(Cache(),I2S(H2I(subject)),name)
return null
endfunction
function GetGroup takes handle subject,string name returns group
return GetStoredInteger(Cache(),I2S(H2I(subject)),name)
return null
endfunction
function GetTrigger takes handle subject,string name returns trigger
return GetStoredInteger(Cache(),I2S(H2I(subject)),name)
return null
endfunction
function GetTriggerAction takes handle subject,string name returns triggeraction
return GetStoredInteger(Cache(),I2S(H2I(subject)),name)
return null
endfunction
function FlushLocals takes handle subject returns nothing
call FlushStoredMission(Cache(),I2S(H2I(subject)))
endfunction
function FlushLocal takes handle subject,string name returns nothing
call FlushStoredInteger(Cache(),I2S(H2I(subject)),name)
endfunction
If anyone can help I'll +Rep... please help...