//**************************************
// Local Handle Variables
//**************************************
function H2I takes handle h returns integer
return h
return 0
endfunction
function H2S takes handle h returns string
return I2S(H2I(h))
endfunction
function InitLocalVars takes nothing returns nothing
if (udg_Cache_LocalVars == null) then
set udg_Cache_LocalVars = InitGameCache("local_vars.w3v")
endif
endfunction
// ** Integer **
function SetHandleVarInt takes string subject, string name, integer value returns nothing
call StoreInteger(udg_Cache_LocalVars, subject, name, value)
endfunction
function GetHandleVarInt takes string subject, string name returns integer
return GetStoredInteger(udg_Cache_LocalVars, subject, name)
endfunction
// ** Float **
function SetHandleVarReal takes string subject, string name, real value returns nothing
call StoreReal(udg_Cache_LocalVars, subject, name, value)
endfunction
function GetHandleVarReal takes string subject, string name returns real
return GetStoredReal(udg_Cache_LocalVars, subject, name)
endfunction
// ** String **
function SetHandleVarString takes string subject, string name, string value returns nothing
call StoreString(udg_Cache_LocalVars, subject, name, value)
endfunction
function GetHandleVarString takes string subject, string name returns string
return GetStoredString(udg_Cache_LocalVars, subject, name)
endfunction
// ** Boolean **
function SetHandleVarBoolean takes string subject, string name, boolean value returns nothing
call StoreBoolean(udg_Cache_LocalVars, subject, name, value)
endfunction
function GetHandleVarBoolean takes string subject, string name returns boolean
return GetStoredBoolean(udg_Cache_LocalVars, subject, name)
endfunction
//-------------------
// CONVERSIONS
//-------------------
function GetHandleVarUnit takes string subject, string name returns unit
return GetStoredInteger(udg_Cache_LocalVars, subject, name)
return null
endfunction
function GetHandleVarEffect takes string subject, string name returns effect
return GetStoredInteger(udg_Cache_LocalVars, subject, name)
return null
endfunction
function GetHandleVarTrigger takes string subject, string name returns trigger
return GetStoredInteger(udg_Cache_LocalVars, subject, name)
return null
endfunction
function GetHandleVarRect takes string subject, string name returns rect
return GetStoredInteger(udg_Cache_LocalVars, subject, name)
return null
endfunction
function GetHandleVarRegion takes string subject, string name returns region
return GetStoredInteger(udg_Cache_LocalVars, subject, name)
return null
endfunction
function GetHandleVarWeatherFX takes string subject, string name returns weathereffect
return GetStoredInteger(udg_Cache_LocalVars, subject, name)
return null
endfunction
function GetHandleVarTimer takes string subject, string name returns timer
return GetStoredInteger(udg_Cache_LocalVars, subject, name)
return null
endfunction
function GetHandleVarTimerDialog takes string subject, string name returns timerdialog
return GetStoredInteger(udg_Cache_LocalVars, subject, name)
return null
endfunction
function GetHandleVarGroup takes string subject, string name returns group
return GetStoredInteger(udg_Cache_LocalVars, subject, name)
return null
endfunction
function I2UNIT takes integer i returns unit
return i
return null
endfunction
function I2TIMER takes integer i returns timer
return i
return null
endfunction
function I2TIMER_DIALOG takes integer i returns timerdialog
return i
return null
endfunction
function I2EFFECT takes integer i returns effect
return i
return null
endfunction
function I2TRIGGER takes integer i returns trigger
return i
return null
endfunction
function I2RECT takes integer i returns rect
return i
return null
endfunction
function I2REGION takes integer i returns region
return i
return null
endfunction
function I2WEATHER_FX takes integer i returns weathereffect
return i
return null
endfunction
function I2GROUP takes integer i returns group
return i
return null
endfunction
function FlushHandleVars takes string subject returns nothing
call FlushStoredMission(udg_Cache_LocalVars, subject)
endfunction
function FlushHandleVarReal takes string subject, string name returns nothing
call FlushStoredReal(udg_Cache_LocalVars, subject, name)
endfunction
function FlushHandleVarInt takes string subject, string name returns nothing
call FlushStoredInteger(udg_Cache_LocalVars, subject, name)
endfunction
function FlushHandleVarString takes string subject, string name returns nothing
call FlushStoredString(udg_Cache_LocalVars, subject, name)
endfunction
function FlushHandleVarBoolean takes string subject, string name returns nothing
call FlushStoredBoolean(udg_Cache_LocalVars, subject, name)
endfunction