• 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.

[Trigger] Game Cache won't load/save

Status
Not open for further replies.
Level 1
Joined
Jul 9, 2013
Messages
2
I am trying to make a campaign with a custom hero. The problem is it won't load/cache variables (unit and gold). THere are two maps - cpg1.w3x and cpg2.w3m. Here are the triggers:
Initialization
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Game Cache - Create a game cache from cpg1.w3x
    • Set Aascache = (Last created game cache)
Unit moving to next map
  • Events
    • Unit - A unit enters Region 001 <gen>
  • Conditions
    • ((Entering unit) is A Hero) Equal to True
  • Actions
    • Set Aasgold = (Player 1 (Red) Current gold)
    • Game Cache - Store Aasgold as Gold of Resources in Aascache
    • Game Cache - Store Mortar team 0001 <gen> as Mortar team of Heroes in Aascache
    • Game Cache - Save Aascache
    • Game - Set the next level to cpg2.w3m
    • Game - Victory Player 1 (Red) (Skid dialogs, Skip scores)
Unit "arrived" at next map
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Game Cache - Create a game cache from cpg2.w3m
    • Game Cache - Reload all game cache data from disk
    • Set Aascache = (Last created game cache)
    • Set Aasgold = (Load Gold of Resources from Aascache)
    • Player - Set Player 1 (Red) Current gold to Aasgold
    • Game Cache - Restore Mortar Team of Heroes from Aascache for Player 1 (Red) at (Player 1 (Red) start location) facing (Center of (Playable map area))
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Don't use spaces when saving stuff. "MortarTeam", not "Mortar Team".

Edit: also, the two game caches should be from the same resource.
If you create a Game Cache from "Something.w3v" in the first map, it has to be "Something.w3v" in the next map.
These names do not have to be the names of your map: you can fill in whatever you like there (as long as there are no spaces).
 
Level 1
Joined
Jul 9, 2013
Messages
2
Don't use spaces when saving stuff. "MortarTeam", not "Mortar Team".

Edit: also, the two game caches should be from the same resource.
If you create a Game Cache from "Something.w3v" in the first map, it has to be "Something.w3v" in the next map.
These names do not have to be the names of your map: you can fill in whatever you like there (as long as there are no spaces).

Thanks, it worked :D
 
Status
Not open for further replies.
Top