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

[Solved] Game Cache won't load! Help!

Status
Not open for further replies.
Level 4
Joined
Jan 28, 2013
Messages
94
I really want to master game caches. However it never seems to load properly for me! I followed this tutorial: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/game-caches-6273/ and did as it was said. However when I tested to transfer from one map to another, nothing happened. I put in a few debug messages and it became clear that the program executed the triggers but it only returned null. For example the gold property, once the trigger had run I lost 500 gold instead of setting my current cold to 500! The Proper name also returned a (null) message.

How should I solve this?

Map 1 triggers:
  • Game Cache
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Game Cache - Create a game cache from Maps\Custom RoC maps\Test1.w3x
      • Set Hero1Red = (Last created game cache)
      • Game Cache - Save Hero1Red
      • Trigger - Run Store Hero <gen> (ignoring conditions)
      • Game - Display to (All players) the text: Debug - Archive cre...
  • Store Hero
    • Events
    • Conditions
    • Actions
      • Game Cache - Store Paladin 0001 <gen> as Paladin of Heros in Hero1Red
      • Game Cache - Save Hero1Red
      • Trigger - Run Store Gold <gen> (ignoring conditions)
      • Game - Display to (All players) the text: Debug - Hero stored
  • Store Gold
    • Events
    • Conditions
    • Actions
      • Set PlayerGold = (Player 1 (Red) Current gold)
      • Game Cache - Store PlayerGold as Gold of Resource in Hero1Red
      • Game Cache - Save Hero1Red
      • Trigger - Run Store Name <gen> (ignoring conditions)
      • Game - Display to (All players) the text: Debug - Gold stored
  • End game
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 1 (Red)
      • ((Entering unit) is A Hero) Equal to True
    • Actions
      • Game - Set the next level to Maps\Custom RoC maps\Test2.w3x
      • Game - Save game as SaveFile.w3z and change level to Maps\Custom RoC maps\Test2.w3x (Skip scores)
Map 2:
  • Create
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Game Cache - Create a game cache from Maps\Custom RoC maps\Test1.w3x
      • Set Hero1Red = (Last created game cache)
      • Set EnterPont = (Center of Region 000 <gen>)
      • Game - Display to (All players) the text: Debug - Archive cre...
  • Restore Hero
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Game Cache - Restore Paladin of Heros from Hero1Red for Player 1 (Red) at EnterPont facing 0.00
      • Set RedHero = (Last restored unit)
      • Custom script: call RemoveLocation(udg_EnterPont)
      • Game - Display to (All players) the text: Debug - Restore Hero
  • Restore Gold
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set PlayerGold = (Load Gold of Resource from Hero1Red)
      • Player - Set Player 1 (Red) Current gold to PlayerGold
      • Game - Display to (All players) the text: Debug - Restore Gold
Edit. I used to have these at map instantiation but for testing purposes I changed it to game time. Now the lower triggers only returns null.
 
Level 4
Joined
Jan 28, 2013
Messages
94
The names of game caches may not contain any spaces.
I believe that should fix your problem :).

You can just input something like "OhHelloThere.w3v" (the file doesn't have to exist, but do whatever you want with it, except spaces :p).
There are no spaces in the file path. Yes there's spaces in the filepath but I thought the Cache name should be the address of the map? The map is saved under D:\\Program\Warcraft III\Maps\Custom RoC maps
 
Level 7
Joined
Nov 15, 2009
Messages
225
if the game cache had to be saved under the adress then it would only work on ur pc.
for instance my game is stored under c:\\Program Files (x86)\\ Warcraft III\Maps\name of map

Well it would still work, because Warcraft is always checking inside the warcraft folder.
Doesn't matter where you have installed it.
Maps are always under maps/

And no, the game cache doesn't need a fitting name, it only needs a unique one.
I recomment the map name as one word + a few random letters to make sure it really is unique.
Example in your case: test1aspl2kv
 
Level 4
Joined
Jan 28, 2013
Messages
94
Thanks for clearing things up for me. My cache finally works! But I got a few more questions. In the tutorial they had string + function I.e (The name of your hero in the last game was + (Load HeroName of Heroes from TutorialCache)) How do I do that function? I can only find either string or function Load HeroName of Heros from Hero1Red...
Another thing, if I got more than 1 hero, should I use different labels or different categories?

Also if I wish to store abilities, attributes, level and experience then what kind of variables/triggers should I use? I believe I can find the triggers but I'm unsure on the variables. Should it be boolean, integer, real, string or something else entirely?

Edit. found it. but item and ability I still don't know.

Edit. Apparently Level, Items, Experience, Attributes, Abilities and Skill Point is stored in the Unit. So I don't need extra triggers for that.
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
In the tutorial they had string + function I.e (The name of your hero in the last game was + (Load HeroName of Heroes from TutorialCache)) How do I do that function? I can only find either string or function Load HeroName of Heros from Hero1Red...
The function is "Hero - Hero Proper Name" (it's a string). It's right above "Item Name" and "Player Name".

if I got more than 1 hero, should I use different labels or different categories?
Different labels.
The category could be something like "Hero", the label the name of the hero (Paladin / Lich / ...).

if I wish to store abilities
Game Caches do save abilities I believe.
Edit: oh, I read from top-to-bottom, didn't see you already said that :D.
 
Level 4
Joined
Jan 28, 2013
Messages
94
The function is "Hero - Hero Proper Name" (it's a string). It's right above "Item Name" and "Player Name".
I know that function. The problem is that I don't know how to do: Game - Text message = Name of your hero + Hero - Hero Proper Name= Some Name. E.G. Name of your hero Some Name. (as a text message in-game)

Different labels.
The category could be something like "Hero", the label the name of the hero (Paladin / Lich / ...).
For this I was wondering if I should add unit, level, abilities, inventory etc. to one unique category. Instead of storing all that under the Hero category. But as all of that is already stored under unit I don't need that any longer. However should I've different categories for different players Heros?

But then again... Game Cache isn't good to use for multiplayer...
 
Status
Not open for further replies.
Top