Serenity09 Moderator
| Subject: Need Jass Help Sun Jul 11, 2010 10:07 pm | |
| This is an old system that was broken by the patch. I sorta blindly tried fixing it up with pat helping, but still no luck. Basically I'll trade my firstborn for whoever helps me get this to work. If multiple people help we can divvy it up. - Spoiler:
- Code:
-
function LocalVars takes nothing returns gamecache if udg_cache == null then call FlushGameCache(InitGameCache("jasslocalvars.w3v")) set udg_cache = InitGameCache("jasslocalvars.w3v") endif return udg_cache endfunction
function SetHandleHandle takes handle subject, string name, handle value returns nothing if value==null then call FlushStoredInteger(LocalVars(),I2S(GetHandleID(subject)),name) else call StoreInteger(LocalVars(), I2S(GetHandleID(subject)), name, GetHandleID(value)) endif endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing if value==0 then call FlushStoredInteger(LocalVars(),I2S(GetHandleID(subject)),name) else call StoreInteger(LocalVars(), I2S(GetHandleID(subject)), name, value) endif endfunction
function SetHandleBoolean takes handle subject, string name, boolean value returns nothing if value==false then call FlushStoredBoolean(LocalVars(),I2S(GetHandleID(subject)),name) else call StoreBoolean(LocalVars(), I2S(GetHandleID(subject)), name, value) endif endfunction
function SetHandleReal takes handle subject, string name, real value returns nothing if value==0 then call FlushStoredReal(LocalVars(), I2S(GetHandleID(subject)), name) else call StoreReal(LocalVars(), I2S(GetHandleID(subject)), name, value) endif endfunction
function SetHandleString takes handle subject, string name, string value returns nothing if value==null then call FlushStoredString(LocalVars(), I2S(GetHandleID(subject)), name) else call StoreString(LocalVars(), I2S(GetHandleID(subject)), name, value) endif endfunction
function GetHandleHandle takes handle subject, string name returns handle return GetStoredInteger(LocalVars(), I2S(GetHandleID(subject)), name) endfunction function GetHandleInt takes handle subject, string name returns integer return GetStoredInteger(LocalVars(), I2S(GetHandleID(subject)), name) endfunction function GetHandleBoolean takes handle subject, string name returns boolean return GetStoredBoolean(LocalVars(), I2S(GetHandleID(subject)), name) endfunction function GetHandleReal takes handle subject, string name returns real return GetStoredReal(LocalVars(), I2S(GetHandleID(subject)), name) endfunction function GetHandleString takes handle subject, string name returns string return GetStoredString(LocalVars(), I2S(GetHandleID(subject)), name) endfunction
function GetHandleUnit takes handle subject, string name returns unit return GetStoredInteger(LocalVars(), I2S(GetHandleID(subject)), name) endfunction function GetHandleTimer takes handle subject, string name returns timer return GetStoredInteger(LocalVars(), I2S(GetHandleID(subject)), name) endfunction function GetHandleTrigger takes handle subject, string name returns trigger return GetStoredInteger(LocalVars(), I2S(GetHandleID(subject)), name) endfunction function GetHandleEffect takes handle subject, string name returns effect return GetStoredInteger(LocalVars(), I2S(GetHandleID(subject)), name) endfunction function GetHandleGroup takes handle subject, string name returns group return GetStoredInteger(LocalVars(), I2S(GetHandleID(subject)), name) endfunction function GetHandleLightning takes handle subject, string name returns lightning return GetStoredInteger(LocalVars(), I2S(GetHandleID(subject)), name) endfunction function GetHandleWidget takes handle subject, string name returns widget return GetStoredInteger(LocalVars(), I2S(GetHandleID(subject)), name) endfunction
function FlushHandleLocals takes handle subject returns nothing call FlushStoredMission(LocalVars(), I2S(GetHandleID(subject)) ) endfunction
When the editor gets to validating script the progress bar freezes.
Last edited by Serenity09 on Sun Jul 11, 2010 10:25 pm; edited 1 time in total (Reason for editing : updating to reflect pat's fix) | |
|
Pat1487 Moderator
| Subject: Re: Need Jass Help Sun Jul 11, 2010 10:16 pm | |
| The problem is with the LocalVars function It should look like this - Code:
-
function LocalVars takes nothing returns gamecache if udg_cache == null then call FlushGameCache(InitGameCache("jasslocalvars.w3v")) set udg_cache = InitGameCache("jasslocalvars.w3v") endif return udg_cache endfunction And cache should be a global varible made in the variable manager with the type of gamecache | |
|
Serenity09 Moderator
| Subject: Re: Need Jass Help Sun Jul 11, 2010 10:23 pm | |
| - Pat1487 wrote:
- The problem is with the LocalVars function
It should look like this - Code:
-
function LocalVars takes nothing returns gamecache if udg_cache == null then call FlushGameCache(InitGameCache("jasslocalvars.w3v")) set udg_cache = InitGameCache("jasslocalvars.w3v") endif return udg_cache endfunction And cache should be a global varible made in the variable manager with the type of gamecache Unless vars start local and you have to physically make them global I have cache set up right. Your fix for localvars fixed the freezing progress bar - thank ya very much. Unfortunately now its throwing a wholelotta errors: 2201, and I'm really hoping they go poof after fixing the first few things (but its not looking good) The first problem comes in at: - Code:
-
call FlushStoredInteger(LocalVars(),I2S(GetHandleID(subject)),name) Error being: Expected a Name. | |
|
Pat1487 Moderator
| Subject: Re: Need Jass Help Sun Jul 11, 2010 10:31 pm | |
| Is that the first FlushStoredInteger() call? | |
|
Serenity09 Moderator
| Subject: Re: Need Jass Help Sun Jul 11, 2010 10:34 pm | |
| - Pat1487 wrote:
- Is that the first FlushStoredInteger() call?
Yep The ones immediately after throw the same error. So do the callstoredintengers | |
|
Pat1487 Moderator
| Subject: Re: Need Jass Help Sun Jul 11, 2010 10:56 pm | |
| Yeah Im not sure Im not familiar with FlushStoredInteger(), other then it takes a cache, a string, and a string And thats what your giving it, so it looks like it should be fine
Make sure the values your passing into it are set properly | |
|
Sponsored content
| Subject: Re: Need Jass Help | |
| |
|