HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Game Cache Triggers not working

05-30-2005, 04:03 PM#1
Captain Griffen
I'm completely stumped as to why these triggers aren't working. Data (boolean) is getting returned as false, presumable because it isn't transferring across (this is from one map in my campaign straight back to it again):

Leaving Map
Events
Conditions
Actions
Game Cache - Create a game cache from RoDT.w3v
Set GameCache = (Last created game cache)
Game Cache - Clear GameCache
-------- General --------
Game Cache - Store 0 as Story of General in GameCache
Game Cache - Store True as Data of General in GameCache
Game Cache - Store (Proper name of PartyLeader) as Leader of General in GameCache
Game Cache - Store (Player 1 (Red) Current gold) as Money of General in GameCache
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SpawnPoint Equal to True
Then - Actions
Game Cache - Store (X of Location) as X of General in GameCache
Game Cache - Store (Y of Location) as Y of General in GameCache
Else - Actions
Game Cache - Store SpawnLocation as SpawnLocation of General in GameCache
-------- Halazar --------
Game Cache - Store Party_Halazar as Halazar of Halazar in GameCache
Game Cache - Store AbilityPoints_Halazar as AbilityPointsHalazar of Halazar in GameCache
Game Cache - Store StatPoints_Halazar as StatPointsHalazar of Halazar in GameCache
Game Cache - Store HalazarStatBonus_Agi as AgiPointsHalazar of Halazar in GameCache
Game Cache - Store HalazarStatBonus_Int as IntPointsHalazar of Halazar in GameCache
Game Cache - Store HalazarStatBonus_Str as StrPointsHalazar of Halazar in GameCache
Game Cache - Store Halazar_ProficiencyPala as PalPointsHalazar of Halazar in GameCache
Game Cache - Store Halazar_ProficiencyPriest as PriPointsHalazar of Halazar in GameCache
Game Cache - Store Halazar_ProficiencyWar as WarPointsHalazar of Halazar in GameCache
-------- Tanja --------
Game Cache - Store Party_Tanja as Tanja of Tanja in GameCache
Game Cache - Store AbilityPoints_Tanja as AbilityPointsTanja of Tanja in GameCache
Game Cache - Store StatPoints_Tanja as StatPointsTanja of Tanja in GameCache
Game Cache - Store TanjaStatBonus_Agi as AgiPointsTanja of Tanja in GameCache
Game Cache - Store TanjaStatBonus_Int as IntPointsTanja of Tanja in GameCache
Game Cache - Store TanjaStatBonus_Str as StrPointsTanja of Tanja in GameCache
Game Cache - Store Tanja_ProficiencyRanger as RanPointsTanja of Tanja in GameCache
Game Cache - Store Tanja_ProficiencySorceress as SorPointsTanja of Tanja in GameCache
Game Cache - Store Tanja_ProficiencySummoner as SumPointsTanja of Tanja in GameCache
For each (Integer A) from 1 to 18, do (Actions)
Loop - Actions
Game Cache - Store AbilityArray_Halazar_Level[(Integer A)] as AbilityLevelHalazar of Halazar in GameCache
Game Cache - Store AbilityArray_Tanja_Level[(Integer A)] as AbilityLevelHalazar of Tanja in GameCache
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
Unit - Create 1 Item Holder for Neutral Passive at (Center of (Playable map area)) facing Default building facing degrees
For each (Integer B) from 1 to 6, do (Actions)
Loop - Actions
Hero - Create ItemSlotArray[((((Integer A) - 1) x 6) + (Integer B))] and give it to (Last created unit)
Game Cache - Store (Last created unit) as (Item + (String((Integer A)))) of General in GameCache
Unit - Remove (Last created unit) from the game
Game Cache - Save GameCache
Game - Victory Player 1 (Red) (Skip dialogs, Skip scores)



Regaining Info
Events
Time - Elapsed game time is 0.50 seconds
Conditions
Actions
Game Cache - Create a game cache from RoDT.w3v
Set GameCache = (Last created game cache)
Game Cache - Reload all game cache data from disk
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
True Equal to (Load Data of General from GameCache)
Then - Actions
Unit - Remove Paladin 0002 <gen> from the game
Unit - Remove Tanja 0001 <gen> from the game
Item - Remove Ring of Regeneration 0043 <gen>
Item - Remove Mantle of Intelligence 0041 <gen>
Item - Remove Righteous Hammer 0042 <gen>
-------- Location --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
True Equal to (Load Data of General from GameCache)
Then - Actions
Game - Display to (All players) the text: Ran
Unit - Remove Paladin 0002 <gen> from the game
Unit - Remove Tanja 0001 <gen> from the game
Item - Remove Ring of Regeneration 0043 <gen>
Item - Remove Mantle of Intelligence 0041 <gen>
Item - Remove Righteous Hammer 0042 <gen>
-------- Location --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load SpawnPoint of General from GameCache) Equal to True
Then - Actions
Game Cache - Restore Halazar of Halazar from GameCache for Player 1 (Red) at (Point((Load X of General from GameCache), (Load Y of General from GameCache))) facing 0.00
Set Party_Halazar = (Last restored unit)
Game Cache - Restore Tanja of Tanja from GameCache for Player 1 (Red) at (Point((Load X of General from GameCache), (Load Y of General from GameCache))) facing 0.00
Set Party_Tanja = (Last restored unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load SpawnLocation of General from (Last created game cache)) Equal to ?
Then - Actions
Game Cache - Restore Halazar of Halazar from (Last created game cache) for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
Set Party_Halazar = (Last restored unit)
Game Cache - Restore Tanja of Tanja from (Last created game cache) for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
Set Party_Tanja = (Last restored unit)
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load SpawnPoint of General from GameCache) Equal to False
Then - Actions
Game - Display to (All players) the text: Ran, but false
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load SpawnPoint of General from GameCache) Equal to True
Then - Actions
Game Cache - Restore Halazar of Halazar from GameCache for Player 1 (Red) at (Point((Load X of General from GameCache), (Load Y of General from GameCache))) facing 0.00
Set Party_Halazar = (Last restored unit)
Game Cache - Restore Tanja of Tanja from GameCache for Player 1 (Red) at (Point((Load X of General from GameCache), (Load Y of General from GameCache))) facing 0.00
Set Party_Tanja = (Last restored unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load SpawnLocation of General from (Last created game cache)) Equal to ?
Then - Actions
Game Cache - Restore Halazar of Halazar from (Last created game cache) for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
Set Party_Halazar = (Last restored unit)
Game Cache - Restore Tanja of Tanja from (Last created game cache) for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
Set Party_Tanja = (Last restored unit)
Else - Actions
Else - Actions
Game - Display to (All players) the text: Ran, but not true
-------- General --------
Player - Set Player 1 (Red) Current gold to (Load Gold of General from GameCache)
Set Story = (Load Story of General from GameCache)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load Leader of General from GameCache) Equal to Halazar
Then - Actions
Set PartyLeader = Party_Halazar
Else - Actions
Set PartyLeader = Party_Tanja
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
Game Cache - Restore (Item + (String((Integer A)))) of General from GameCache for Neutral Passive at (Center of (Playable map area)) facing 0.00
For each (Integer B) from 1 to 6, do (Actions)
Loop - Actions
Set ItemSlotArray[((((Integer A) - 1) x 6) + (Integer B))] = (Item-type of (Item carried by (Last restored unit) in slot (Integer B)))
Unit - Remove (Last created unit) from the game
-------- Halazar --------
Game Cache - Restore Halazar of Halazar from GameCache for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
Set AbilityPoints_Halazar = (Load AbilityPointsHalazar of Halazar from GameCache)
Set StatPoints_Halazar = (Load StatPointsHalazar of Halazar from GameCache)
Set HalazarStatBonus_Agi = (Load AgiPointsHalazar of Halazar from GameCache)
Set HalazarStatBonus_Int = (Load IntPointsHalazar of Halazar from GameCache)
Set HalazarStatBonus_Str = (Load StrPointsHalazar of Halazar from GameCache)
Set Halazar_ProficiencyPala = (Load PalPointsHalazar of Halazar from GameCache)
Set Halazar_ProficiencyPriest = (Load PriPointsHalazar of Halazar from GameCache)
Set Halazar_ProficiencyWar = (Load WarPointsHalazar of Halazar from GameCache)
-------- Tanja --------
Game Cache - Restore Tanja of Tanja from GameCache for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
Set AbilityPoints_Tanja = (Load AbilityPointsTanja of Tanja from GameCache)
Set StatPoints_Tanja = (Load StatPointsTanja of Tanja from GameCache)
Set TanjaStatBonus_Agi = (Load AgiPointsTanja of Tanja from GameCache)
Set TanjaStatBonus_Int = (Load IntPointsTanja of Tanja from GameCache)
Set TanjaStatBonus_Str = (Load StrPointsTanja of Tanja from GameCache)
Set Tanja_ProficiencyRanger = (Load RanPointsTanja of Tanja from GameCache)
Set Tanja_ProficiencySorceress = (Load SorPointsTanja of Tanja from GameCache)
Set Tanja_ProficiencySummoner = (Load SummonerPointsTanja of Tanja from GameCache)
For each (Integer A) from 1 to 18, do (Actions)
Loop - Actions
Set AbilityArray_Halazar_Level[(Integer A)] = (Load AbilityLevelHalazar of Halazar from GameCache)
Set AbilityArray_Tanja_Level[(Integer A)] = (Load AbilityLevelTanja of Tanja from GameCache)
Game Cache - Clear GameCache
Game Cache - Store False as Data of General in GameCache
Game Cache - Save GameCache
Else - Actions


Any help would be much appreciated!
05-30-2005, 06:37 PM#2
divine_peon
whoa! you have lots of unneeded variables there like the hero's stats and skills. this is not a save/load code that you have to save everything, you just need to save the hero and that's it.

and as far as i know you don't need the line
Code:
Game Cache - Reload all game cache data from disk

oh and don't use the line
Code:
Game Cache - Clear GameCache
unless you wanted to delete the game cache from the harddisk. that's why the whole thing don't work. Remove it then tell me if it worked.
05-30-2005, 06:46 PM#3
Captain Griffen
*looks embarrased*

Oops.

The stat bonuses are needed, since each of the main characters can be in one of 4 classes at any one time.

Anyway, it works now (mostly). Just got the normal bug fixing to do.

Thanks a lot!