- Joined
- Jun 14, 2005
- Messages
- 2,506
Introduction
This tutorial will tell you how to move units and other things from map to map. Remember that Game Caches can not be used on Battle Net, and are almost only ever used for campaigns.
Creating the Game Cache
The first thing you want to do is to create a variable for the Game Cache, go into the Variale editor and create a new Game Cache, like in the pictures bellow.
Click the "X" sign to open the variable editor, and create a new one like so:
Then when the Game Caches variable has been created use this trigger to create the Game Cache.
You can name your gamecache anything you'd like (it is "TutorialCache.w3v" in this tutorial), but do not put
any spaces in it.
Now i'll show you how to store things using a Game Cache. The following trigger can be used to store a hero.
Restoring things from the Game Cache
I am now going to show you how to restore all these things in a different map. The first thing we need to do is the re-create all the variables. It makes it alot easier if the new variables in the new map are the same as in the old map. After all the required variables have been made make this trigger.
I hope you now find Game Caches alot easier, if you would like to ask me anything just private message me or email me at [email protected]. If you need it you maybe download the demo Here.
This tutorial will tell you how to move units and other things from map to map. Remember that Game Caches can not be used on Battle Net, and are almost only ever used for campaigns.
Creating the Game Cache
The first thing you want to do is to create a variable for the Game Cache, go into the Variale editor and create a new Game Cache, like in the pictures bellow.
Click the "X" sign to open the variable editor, and create a new one like so:
Then when the Game Caches variable has been created use this trigger to create the Game Cache.
You can name your gamecache anything you'd like (it is "TutorialCache.w3v" in this tutorial), but do not put
any spaces in it.
-
Create Cache
-
Events
- Map initialization
- Conditions
-
Actions
- Game Cache - Create a game cache from TutorialCache.w3v
- Set TutorialCache = (Last created game cache)
- Game Cache - Save TutorialCache
-
Events
Now i'll show you how to store things using a Game Cache. The following trigger can be used to store a hero.
-
Store Hero
- Events
- Conditions
-
Actions
- Game Cache - Store Paladin 0032 <gen> as Paladin of Heros in TutorialCache
- Game Cache - Save TutorialCache
- Trigger - Run Store Gold <gen> (ignoring conditions)
-
Store Gold
- Events
- Conditions
-
Actions
- Set Gold = (Player 1 (Red) Current gold)
- Game Cache - Store Gold as Gold of Recources in TutorialCache
- Game Cache - Save TutorialCache
- Trigger - Run Store Hero Name <gen> (ignoring conditions)
-
Store Hero Name
- Events
- Conditions
-
Actions
- Set HeroName = (Proper name of Paladin 0032 <gen>)
- Game Cache - Store HeroName as HeroName of Heros in TutorialCache
- Game Cache - Save (Last created game cache)
- Trigger - Run End Game <gen> (ignoring conditions)
Restoring things from the Game Cache
I am now going to show you how to restore all these things in a different map. The first thing we need to do is the re-create all the variables. It makes it alot easier if the new variables in the new map are the same as in the old map. After all the required variables have been made make this trigger.
-
Load Game Cache
-
Events
- Map initialization
- Conditions
-
Actions
- Game Cache - Create a game cache from TutorialCache.w3v
- Set TutorialCache = (Last created game cache)
-
Events
-
Restore Gold
-
Events
- Time - Elapsed game time is 0.00 seconds
- Conditions
-
Actions
- Set Gold = (Load Gold of Recources from TutorialCache)
- Player - Set Player 1 (Red) Current gold to Gold
-
Events
-
Restore Hero Name
-
Events
- Time - Elapsed game time is 0.00 seconds
- Conditions
-
Actions
- Set HeroName = (Load HeroName of Heros from TutorialCache)
- Game - Display to (All players) for 20.00 seconds the text: (Your heros proper name is the last game was: + (Load HeroName of Heros from TutorialCache))
-
Events
I hope you now find Game Caches alot easier, if you would like to ask me anything just private message me or email me at [email protected]. If you need it you maybe download the demo Here.
Attachments
Last edited by a moderator: