wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Tutorials > Trigger (GUI)/ AI editor Tutorials
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 03-18-2006, 02:40 PM   #1
Bob27
User
 
Join Date: Dec 2005
Posts: 116

Submissions (17)

Bob27 is a jewel in the rough (180)Bob27 is a jewel in the rough (180)Bob27 is a jewel in the rough (180)

Send a message via MSN to Bob27
Default Game Caches

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.





Then when the Game Caches variable has been created use this trigger to create the Game Cache.

Trigger:
Create Cache
Collapse Events
Map initialization
Conditions
Collapse Actions
Game Cache - Create a game cache from TutorialCache.w3v
Set TutorialCache = (Last created game cache)
Game Cache - Save TutorialCache

Storing Heros and Other Things

Now i'll show you how to store things using a Game Cache. The following trigger can be used to store a hero.

Trigger:
Store Hero
Events
Conditions
Collapse Actions
Game Cache - Store Paladin 0032 <gen> as Paladin of Heros in TutorialCache
Game Cache - Save TutorialCache
Trigger - Run Store Gold <gen> (ignoring conditions)

Remember that you will have to create all the nesecary variables in order for the triggers to work. This next trigger will show you how to store a players gold or lumber. This will require a variable, unlike storing a hero.

Trigger:
Store Gold
Events
Conditions
Collapse 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)

This next trigger will show you how to store a heros proper name, and one of the ways it can be used in a different map.

Trigger:
Store Hero Name
Events
Conditions
Collapse 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)

This will also require a variable.

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.

Trigger:
Load Game Cache
Collapse Events
Map initialization
Conditions
Collapse Actions
Game Cache - Create a game cache from TutorialCache.w3v
Set TutorialCache = (Last created game cache)

Now that the Game Cache has been re-created we can restore our heros, gold and hero names. This next trigger is used to restore the hero.

Trigger:
Restore Gold
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Set Gold = (Load Gold of Recources from TutorialCache)
Player - Set Player 1 (Red) Current gold to Gold

Now that our gold has been restored we can make a text message appear on the screen saying Your heros proper name is the last game was: and have the heros proper name appear. You can do this with almost anything. Heres the trigger for it.

Trigger:
Restore Hero Name
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse 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))

Conclusion

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 bob27dav@optusnet.com.au. If you need it you maybe download the demo Here.

Last edited by Bob27 : 03-19-2006 at 08:10 AM.
Bob27 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 03-20-2006, 04:04 AM   #2
jigrael
Worker Ant


Project Member: PoC
 
Join Date: Oct 2003
Posts: 783

Submissions (36)

jigrael is a splendid one to behold (695)jigrael is a splendid one to behold (695)jigrael is a splendid one to behold (695)jigrael is a splendid one to behold (695)

Hero Contest #3 - 1st PlaceBattle Droids Model Competition Winner

Default

Nice. I got a question, can I use game cache for a spell and the play that map(with the spell in) in bnet? and what about lan multiplayer?
__________________
Goodbye W3c. Great people and moments here. Time to move on

Last edited by jigrael : 03-20-2006 at 04:04 AM.
jigrael is offline   Reply With Quote
Old 03-20-2006, 06:15 AM   #3
Bob27
User
 
Join Date: Dec 2005
Posts: 116

Submissions (17)

Bob27 is a jewel in the rough (180)Bob27 is a jewel in the rough (180)Bob27 is a jewel in the rough (180)

Send a message via MSN to Bob27
Default

No you can't use Game Caches for multiplayer or b.net, just singleplayer.
Bob27 is offline   Reply With Quote
Old 03-21-2006, 06:21 PM   #4
phyrex1an
User
 
Join Date: Dec 2005
Posts: 7

phyrex1an has little to show at this moment (5)

Default

You can use game caches in multiplayer games, what you not can do is save them to a different game.
Your spell should work as good in multiplayer as in single player.
phyrex1an is offline   Reply With Quote
Old 03-21-2006, 06:27 PM   #5
Blade.dk
.
 
Blade.dk's Avatar


Respected User
 
Join Date: May 2005
Posts: 1,990

Submissions (15)

Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)

Approved Map: Azeroth's Arcane ArenaSpell session 01 winner

Send a message via MSN to Blade.dk
Default

phyrex1an is right.

Game caches works perfectly in multiplayer games, as long as you only want to use their contents in that game.
__________________
Spell Making Course: Part 1: Making a simple stomp spell.
I wonder if I'll ever finish part 2.
Blade.dk is offline   Reply With Quote
Old 04-16-2006, 09:11 PM   #6
moonliterhythm
User
 
Join Date: Mar 2006
Posts: 71

moonliterhythm has little to show at this moment (8)

Default

do game caches have any advantages over using global variables?
moonliterhythm is offline   Reply With Quote
Old 10-25-2006, 06:37 AM   #7
Leopard
Banned
 
Join Date: May 2006
Posts: 222

Submissions (6)

Leopard seems to be the reincarnation of TerranUp16 (-100)Leopard seems to be the reincarnation of TerranUp16 (-100)Leopard seems to be the reincarnation of TerranUp16 (-100)Leopard seems to be the reincarnation of TerranUp16 (-100)

Send a message via Yahoo to Leopard
Default

i have a question, now a have two map and how to link them?, for example, when the hero go to a region, he will be moved to the second map and the game reload??
Leopard is offline   Reply With Quote
Old 12-17-2008, 10:20 AM   #8
hillbillyboi
User
 
hillbillyboi's Avatar
 
Join Date: Jan 2006
Posts: 19

hillbillyboi has a little shameless behaviour in the past (-5)

Send a message via MSN to hillbillyboi
Default

heya :) umm ive made multiple game caches but i can never seem to get past the loading stage, when i load the next made it always says the message "Waiting for host" and it has the disconnect button available, but never loads..

any idea what could be wrong?
hillbillyboi is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 04:26 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services