• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Cache problem

Status
Not open for further replies.
Level 4
Joined
Dec 14, 2009
Messages
48
hi again,
Ive got a problem with my Caches. Ill start with the triggers Im currently using
Map1 - here you only choose a character you want to play, then it does this
  • Game Cache - Create a game cache from RoHCache.w3v
  • Set Cache = (Last created game cache)
  • Game Cache - Store Chosen_Hero as Chosen_Hero of HERO in Cache
  • Game Cache - Store 1 as Starting_Location of MAIN in Cache
  • Game Cache - Store 40.00 as ExperiencePercentage of MAIN in Cache
  • Game Cache - Save Cache
  • Game - Save game as <Empty String> and change level to Maps\RoH\BLOODWRAITH.w3x (Skip scores)
now to the bloodwraith map loading:
-initialization trigger
  • Game Cache - Create a game cache from RoHCache.w3v
  • Set Cache = (Last created game cache)
  • Trigger - Run Load Cache <gen> (checking conditions)
-load cache trigger
  • Game Cache - Restore Chosen_Hero of HERO from Cache for Player 1 (Red) at (Center of Region_Reviveing) facing 0.00
  • Set QuestStory_Phase = (Load Phase of QUEST from Cache)
  • Set ExperienceGain_Percentage = (Load ExperiencePercentage of MAIN from Cache)
now to the problem,
after I played the map first time it was OK, but when I played it second time (opened Map1, choosed hero so the save trigger runned again) but the values were like QuestPhase was 14, experience was 0.00,... these were the values when I ended the map when I played it first time (at the end was a save function runned in bloodwraith map).

It seems like these caches are not removing after I close war3. I have tried this to figure it out but it didnt helped:
Map1 - the same function as above but changed a litle bit
  • Game Cache - Create a game cache from RoHCache.w3v
  • Set Cache = (Last created game cache)
  • Game Cache - Clear Cache
  • Game Cache - Clear Category MAIN in Cache
  • Game Cache - Clear Category HERO in Cache
  • Game Cache - Store Chosen_Hero as Chosen_Hero of HERO in Cache
  • Game Cache - Store 1 as Starting_Location of MAIN in Cache
  • Game Cache - Store 40.00 as ExperiencePercentage of MAIN in Cache
  • Game Cache - Save Cache
  • Game - Save game as <Empty String> and change level to Maps\RoH\BLOODWRAITH.w3x (Skip scores)
Im being desperate with this, can anyone help me ? :)
thanks in advance
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Level 4
Joined
Dec 14, 2009
Messages
48
First of all, thanks for the link.
Now to the thread, the map works similarly like the first mission in bonus scenario in frozen throne. When you visit something like cave it loads a new map where that cave is. There Im using load and save.
 

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
Ill give it a try :)

EDIT: arent hashtables usable only in a single map? I need to load values from one map to another
Please clarify if you want the map to be able to be played multiplayer?
If so, you should consider two things:

a) game cache can not be used to transfer data between maps anymore
b) in fact, there's no method other than using a save/load system based on savecodes to transfer data between maps in multiplayer

If you want to pass data between two maps in multiplayer, I recommend to use Nestharius codeless saveload (Look it up in the spells section, it's probably the most powerful thing that has ever been made for wc3)!
 
Level 4
Joined
Dec 14, 2009
Messages
48
thanks for reply :)
Im not using it for multiplayer,
My problem now is that the save/load triggers from Map1 are working, the problem are saving triggers in the other maps, they are just not working and I really dont know why.
specific example:
- player leaves Map1 (save trigger runs, int Phase is 4)
- Map2/Map3/Map4 loads (load trigger runs, int Phase is 4)
- in this Map2/3/4 the Phase changes to 5
- player leaves Map2/3/4 (save trigger runs, int Phase is saved as 5)
- Map1 load (load trigger runs and boom, Phase is 4 again)

the same happens with all other variables, not just the int Phase

I dont know if the problem is in load in first map, or save in Map2/3/4
Here are the triggers:
Map1 save (runs when player enter region, then another map loads (changes level))
  • Save Cache
    • Events
    • Conditions
    • Actions
      • Game Cache - Store Chosen_Hero as Chosen_Hero of HERO in Cache
      • Game Cache - Store QuestStory_Phase as Phase of QUEST in Cache
      • Game Cache - Store AdvancedQuests[1] as Advanced1 of QUEST in (Last created game cache)
      • Game Cache - Store ExperienceGain_Percentage as ExperienceGain of MAIN in Cache
      • Set Gold = (Player 1 (Red) Current gold)
      • Game Cache - Store Gold as Gold of MAIN in Cache
      • Game Cache - Save Cache
Map1 Load (run at map initialization
  • Load Cache
    • Events
    • Conditions
    • Actions
      • Game Cache - Restore Chosen_Hero of HERO from Cache for Player 1 (Red) at (Center of Region_Reviveing) facing 0.00
      • Set Chosen_Hero = (Last restored unit)
      • Set QuestStory_Phase = (Load Phase of QUEST from Cache)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load Starting_Location of MAIN from Cache) Equal to 1
        • Then - Actions
          • Unit - Move Chosen_Hero instantly to (Center of Reviveing Region I <gen>)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load Starting_Location of MAIN from Cache) Equal to 2
            • Then - Actions
              • Unit - Move Chosen_Hero instantly to (Center of Region 028 <gen>)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load Starting_Location of MAIN from Cache) Equal to 3
                • Then - Actions
                  • Unit - Move Chosen_Hero instantly to (Center of Region 085 <gen>)
                • Else - Actions
                  • Do nothing
      • Set AdvancedQuests[1] = (Load Advanced1 of QUEST from Cache)
      • Set ExperienceGain_Percentage = (Load ExperiencePercentage of MAIN from Cache)
      • Player - Set Player 1 (Red) Current gold to (Load Gold of MAIN from Cache)
      • Hero - Make Player 1 (Red) Heroes gain ExperienceGain_Percentage% experience from future kills
now load from Map2/3/4
  • Load Cache
    • Events
    • Conditions
    • Actions
      • Game Cache - Restore Chosen_Hero of HERO from Game_Cache for Player 1 (Red) at (Center of Reviveing Region <gen>) facing 0.00
      • Set Chosen_Hero = (Last restored unit)
      • Unit - Set mana of Chosen_Hero to 100.00%
      • Set QuestStory_Phase = (Load Phase of QUEST from Game_Cache)
      • Set AdvancedQuests[1] = (Load Advanced1 of QUEST from Game_Cache)
      • Set ExperienceGain_Percentage = (Load ExperiencePercentage of MAIN from Game_Cache)
      • Hero - Make Player 1 (Red) Heroes gain ExperienceGain_Percentage% experience from future kills
      • Player - Set Player 1 (Red) Current gold to (Load Gold of MAIN from Game_Cache)
and save from Map2/3/4
  • Save Cache
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: SAVING!!!!!
      • Game - Display to (All players) the text: (Phase variable is: + (String(QuestStory_Phase)))
      • Game Cache - Store Chosen_Hero as Chosen_Hero of HERO in Game_Cache
      • Game Cache - Store 2 as Starting_Location of MAIN in Game_Cache
      • Game Cache - Store AdvancedQuests[1] as Advanced1 of QUEST in Game_Cache
      • Game Cache - Store ExperienceGain_Percentage as ExperienceGain of MAIN in Game_Cache
      • Game Cache - Store QuestStory_Phase as Phase of QUEST in Game_Cache
      • Set Gold = (Player 1 (Red) Current gold)
      • Game Cache - Store Gold as Gold of MAIN in Game_Cache
      • Game Cache - Save Game_Cache
 
Status
Not open for further replies.
Top