• 🏆 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!

Using Game Caches

Status
Not open for further replies.
Hello guys. I just want to ask if it is possible to use Game Caching as a save/load system? I tried using it in a map (not in a campaign) but when I save data in a game cache and quit the map, then reopen and load the cache it won't to load.

I haven't tried using it in a map when it is inside a campaign yet so I ask if you guys know this idea is actually possible if it is in a campaign? (because maps are stored in a campaign right?)

Also I'm curious where are these game caches are stored when you try to save?
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
Hello guys. I just want to ask if it is possible to use Game Caching as a save/load system? I tried using it in a map (not in a campaign) but when you save stuffs in a game cache and quit the map you won't be able to load the saved game cache.
Yes it is possible for singleplayer and campaign maps. Not it is not possible for multiplayer maps.

For multiplayer maps one has to use a file I/O based system such as those offered by TriggerHappy.
I haven't tried using it in a map when it is inside a campaign yet so I ask if you guys know this idea is actually possible if it is in a campaign? (because maps are stored in a campaign right?)
Yes it works for single player and campaign maps.
Also I'm curious where are these game caches are stored when you try to save?
They are saved to the save folder. I think the currently loaded content is stored inside saves, however one can reload them to get the current content from the save folder.

This principle is how the TFT Orc campaign worked. Map transitions were done by saving the current map and then starting or loading a save of the next map. Your progress was transferred to the maps or loaded saves using game caches.
 
Soo do I have to put my map in the campaign first to make it work? I tried it in a loose map and it doesn't work sadly, or there might be problem in the triggers when loading the game cache, Im not sure.

The problem is when I open the map, save it then quit - then reopen the map and load the saved cache it doesn't load the saved cache. It only works when you save it and load it without quitting.


(Trigger made by IcemanBo for me a month ago).

  • Map Load
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Game Cache - Create a game cache from Eurica20Cache.w3v
      • Set Map_GameCache = (Last created game cache)
      • Set Map_HeroCategory = HeroData
      • Set Map_Hero = Global_MainHero
      • Set Map_SaveFlag = False
      • Set Map_LoadFlag = False
      • Game - Display to (All players) the text: [Save and Load Now ...
  • Map Update Cache
    • Events
      • Player - Player 1 (Red) types a chat message containing save as An exact match
    • Conditions
    • Actions
      • Set Map_SavePoint = (Position of Map_Hero)
      • Set Map_SavePointX = (X of Map_SavePoint)
      • Set Map_SavePointY = (Y of Map_SavePoint)
      • Custom script: call RemoveLocation(udg_Map_SavePoint)
      • Game Cache - Store Map_SavePointX as X of Map_HeroCategory in Map_GameCache
      • Game Cache - Store Map_SavePointY as Y of Map_HeroCategory in Map_GameCache
      • -------- Saving Hero Stats --------
      • Set Map_HeroHealth = (Life of Map_Hero)
      • Game Cache - Store Map_HeroHealth as Health of Map_HeroCategory in Map_GameCache
      • -------- Saving Hero Inventory --------
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Map_ItemType = (Item-type of (Item carried by Map_Hero in slot (Integer A)))
          • Trigger - Run Map Item Type to Int <gen> (ignoring conditions)
          • Game Cache - Store Map_ItemInteger as (itemtype + (String((Integer A)))) of Map_HeroCategory in Map_GameCache
      • -------- Message --------
      • Game - Display to (All players) the text: [Saved successfully]
  • Map Load Cache
    • Events
      • Player - Player 1 (Red) types a chat message containing load as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Map_LoadFlag Equal to False
        • Then - Actions
          • -------- Disable loading of data after this --------
          • Set Map_LoadFlag = True
          • -------- Load location of the hero --------
          • Set Map_SavePointX = (Load X of Map_HeroCategory from Map_GameCache)
          • Set Map_SavePointY = (Load Y of Map_HeroCategory from Map_GameCache)
          • -------- Loading Hero Stats --------
          • Set Map_HeroHealth = (Load Health of Map_HeroCategory from Map_GameCache)
          • Unit - Set life of Map_Hero to Map_HeroHealth
          • -------- Loading Inventory Items --------
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Set Map_ItemInteger = (Load (itemtype + (String((Integer A)))) of Map_HeroCategory from Map_GameCache)
              • Trigger - Run Map Int to Item Type <gen> (ignoring conditions)
              • Set Map_ItemTypeArray[(Integer A)] = Map_ItemType
              • Hero - Create Map_ItemTypeArray[(Integer A)] and give it to Map_Hero
          • -------- Loading Hero Position --------
          • Set Map_SavePoint = (Point(Map_SavePointX, Map_SavePointY))
          • Unit - Move Map_Hero instantly to Map_SavePoint
          • Camera - Pan camera for Player 1 (Red) to (Position of Map_Hero) over 0.00 seconds
          • Custom script: call RemoveLocation(udg_Map_SavePoint)
          • -------- Message --------
          • Game - Display to (All players) the text: [Loaded successfull...
        • Else - Actions
          • Game - Display to (All players) the text: [Saved data already...
  • Map Item Type to Int
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_Map_ItemInteger = udg_Map_ItemType
  • Map Int to Item Type
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_Map_ItemType = udg_Map_ItemInteger
 
Last edited:
Status
Not open for further replies.
Top