• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Game Cache Help

Status
Not open for further replies.
Level 2
Joined
Aug 23, 2008
Messages
6
Well, I've been trying to get this game cache working for my map for quite some time now, but with no success.

This is my trigger saving all the things I want to save before loading up the next map :
  • Setting items
    • Events
      • Time - Elapsed game time is 0.05 seconds
    • Conditions
    • Actions
      • Cinematic - Turn cinematic mode On for (All players)
      • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • -------- ==Items== --------
      • Game Cache - Create a game cache from ItemsData.w3v
      • Game Cache - Clear (Last created game cache)
      • Set X = 1
      • Game Cache - Store Potion as (ItemName + (String(X))) of Items in (Last created game cache)
      • ------- Yada yada insert more things here (keeping this short) -------
      • Wait 1.00 seconds
      • Game Cache - Save (Last created game cache)
      • Game - Set the next level to <Map Name Here>.w3x
      • Game - Victory Player 1 (Red) (Skip dialogs, Skip scores)
And this would be the trigger I use to load up the cache and try to retrieve its contents :
  • Loading Items
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Game Cache - Create a game cache from ItemsData.w3v
      • -------- Items --------
      • Set Item_Total = (Load ItemTotal of Items from (Last created game cache))
      • Game - Display to (All players) the text: (String(Item_Total))
      • For each (Integer A) from 1 to Item_Total, do (Actions)
        • Loop - Actions
          • Set Item_Steal_Tag[(Integer A)] = (Load (ItemName + (String((Integer A)))) of Items from (Last created game cache))
          • Set Item_Cost[(Integer A)] = (Load (ItemCost + (String((Integer A)))) of Items from (Last created game cache))
          • Set Item_Description[(Integer A)] = (Load (ItemDesc + (String((Integer A)))) of Category from (Last created game cache))
          • Game - Display to (All players) the text: Item_Steal_Tag[(Integer A)]
          • Game - Display to (All players) the text: (String(Item_Cost[(Integer A)]))
          • Game - Display to (All players) the text: Item_Description[(Integer A)]
      • Cinematic - Clear the screen of text messages for (All players)
There's more to both the saving and loading triggers (obviously), but I just wanted to keep them short. Anyway, the text that appears on screen after loading the 2nd map shows 0's and null for the content that was saved in the previous map, and I can't figure out why the map isn't loading the cache. Or even if I've missed something crucial on making game caches work properly.

I understand JASS decently and can put it to use if needed.

Wondering if anyone else can find a problem with these triggers as to why it's not loading :sad:.
If you need more information about the triggers, feel free to ask.

-=-=-=-=-=-=-=-=-

Wow, I found the problem. No need for help anymore, sorry!
 
Last edited:
Level 2
Joined
Aug 23, 2008
Messages
6
After trying many things, yet again without success, I tried creating 2 triggers.
One ran at map start up and created the game cache, the 2nd ran 0.05 seconds after the map loaded and saved/loaded the appropriate items.

Seems (for me anyway) the actual game cache wasn't being created if it wasn't created instantly when the map initialized.
 
Status
Not open for further replies.
Top