• 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

Status
Not open for further replies.
Level 22
Joined
Dec 31, 2006
Messages
2,216
You can store several things in gamecaches. They are pretty nice if you're making a campaign and you have a hero that you want to use through the whole campaign.
"Local Handle Vars" uses gamecache and it attaches handles or other things to handles by using the infamous H2I trick.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Just read the Actions of the Game Cache category. You'll see what you can store. Use your imagination to apply that to what you need. This way, you can nearly store anything (however keep in mind that some things are a bit harder to get from your imagination to your computer then others. It all depends on how complicated you make the data you want to store xD)
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
how about everything in a region?
ok just a few things like a building and some other stuff cuz
the map im planning on making after my hero war map is a 3 part set (not including anything after part 1)
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
ok i think im close but cant come up with wat im missing
  • Nightelf
    • Events
    • Conditions
    • Actions
      • Unit - Replace Peasant 0000 <gen> with a Maiev using The new unit's default life and mana
      • Game Cache - Create a game cache from Orbs.w3v
      • Game Cache - Store (Last created unit) as Hero of Hero in (Last created game cache)
      • Game Cache - Save (Last created game cache)
      • Game - Set the next level to Maps\StolenSouls\Stage picker.w3x
      • Game - Victory Player 1 (Red) (Skip dialogs, Skip scores)
  • Untitled Trigger 003
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game Cache - Create a game cache from Orbs.w3v
      • Game Cache - Restore Hero of Hero from (Last created game cache) for Player 1 (Red) at (Center of Region 000 <gen>) facing (Position of (Triggering unit))
      • If ((Last restored unit) Equal to No unit) then do (Skip remaining actions) else do (Do nothing)
      • Unit - Create 1 Maiev for Player 1 (Red) at (Center of Region 000 <gen>) facing Default building facing degrees
 
Level 3
Joined
Sep 6, 2008
Messages
45
ok i think im close but cant come up with wat im missing
  • Nightelf
    • Events
    • Conditions
    • Actions
      • Unit - Replace Peasant 0000 <gen> with a Maiev using The new unit's default life and mana
      • Game Cache - Create a game cache from Orbs.w3v
      • Game Cache - Store (Last created unit) as Hero of Hero in (Last created game cache)
      • Game Cache - Save (Last created game cache)
      • Game - Set the next level to Maps\StolenSouls\Stage picker.w3x
      • Game - Victory Player 1 (Red) (Skip dialogs, Skip scores)
  • Untitled Trigger 003
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game Cache - Create a game cache from Orbs.w3v
      • Game Cache - Restore Hero of Hero from (Last created game cache) for Player 1 (Red) at (Center of Region 000 <gen>) facing (Position of (Triggering unit))
      • If ((Last restored unit) Equal to No unit) then do (Skip remaining actions) else do (Do nothing)
      • Unit - Create 1 Maiev for Player 1 (Red) at (Center of Region 000 <gen>) facing Default building facing degrees

First you are replacing your unit with a maiev, so you have to store the last replaced unit i think or try removing the peasant and creating the maiev on his position.

And when you are reloading it, you dont need to create the unit again, it will be created instantly.
 
First you are replacing your unit with a maiev, so you have to store the last replaced unit i think or try removing the peasant and creating the maiev on his position.
You're right, Last Created Unit unit doesn't work for replaced units. You need to use Last Replaced Unit.
And when you are reloading it, you dont need to create the unit again, it will be created instantly.
That's not a problem. If you read the trigger more carefully, he only creates that unit if the one from the game cache doesn't exist.
 
Level 3
Joined
Sep 6, 2008
Messages
45
And when you are reloading it, you dont need to create the unit again, it will be created instantly.
That's not a problem. If you read the trigger more carefully, he only creates that unit if the one from the game cache doesn't exist.

Wrong, he is not using and if the else multiple actions he is using a single line if then else, and he es using as an action: the skip remaining actions, so it would'n create that unit if there isn't anything on cache.
 
Wrong, he is not using and if the else multiple actions he is using a single line if then else, and he es using as an action: the skip remaining actions, so it would'n create that unit if there isn't anything on cache.
Which is the same point I was trying to make... or did you not understand me properly? I'm native English, so that shouldn't happen unless you don't understand English very well :p.
 
Status
Not open for further replies.
Top