HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to save Heros/Upgrades?

04-22-2004, 12:44 AM#1
Kalar
OK, I have made some pretty good maps, single player and multiplayer.. but I have this newb question: How in the hell do you save hero EXP/Items to advance to the next mission in the campaign? If possible, I would also like to know how to save upgrades. (IE: I get level 1 Steel Swords upgrade, And I want to have that next level)
04-22-2004, 12:51 AM#2
ThyFlame
Either use a save/load code or game cache. There are tutorials on both, though the current save/load tutorial is pretty weak on WC3C. Might need to google one.
04-22-2004, 03:18 AM#3
Kalar
doesn't help me much.. I knew you had to use game caches..
04-24-2004, 12:42 AM#4
ThyFlame
Look in the tutorial section as I said. Neither is a quick answer.
04-25-2004, 11:25 PM#5
Silversuns
Use code for multiplayer game and use the game cache for single game, cache doesnt work on multiplayer game. I can't help you about the cache cos I didnt work with it, but for the multiplayer (the code), you can find some good tutorial to help you in the tutorial section. It will give you a good start.
04-25-2004, 11:38 PM#6
ThyFlame
No... actually there aren't any good tutorials on it in there right now and I'm too backed up to write my own.
05-02-2004, 08:22 PM#7
Silversuns
I think the best way right now, it's probably to put your upgrade value in a variable(Integer) and transfert the variable value to the other map.
I think, all the thing you want to save must be in a different variable.

If it can give you a way to try, I hope it will help you ...
05-03-2004, 02:53 AM#8
Shimrra
Here is a simple Game Cache trigger to save and load a unit:

Code:
Save the Unit
    Events
    Conditions
    Actions
        Game Cache - Create a game cache from <CacheNameHere>.w3v
        Game Cache - Store <UnitHere> as <AnotherNameHere> of <ThirdNameHere> in (Last created game cache)
        Game Cache - Save (Last created game cache)

And the load trigger:

Code:
Load Trigger
    Events
    Conditions
    Actions
        Game Cache - Create a game cache from <CacheNameHere>.w3v
        Game Cache - Restore <AnotherNameHere> of <ThirdNameHere> from (Last created game cache) for Player <#> at <Region> facing 0.00

Here's a breakdown of what all the things in the <> mean:

<GameCacheName> - The name of the Game Cache you are creating
<UnitHere> - The unit that you want to save into the cache
<AnotherNameHere> - The name you want to save the unit as
<ThirdNameHere> - The category you want to save the unit as
<#> - The player number you want to restore the saved unit for
<Region> - Where you want to restore the saved unit at

Also note that all variables used in the above triggers need to have the same names or it will not work. You can restore the unit for another player then originally owned it, but you must load it from the same Game Cache, name, and category or the unit will not appear. I hope this helps you!

-Shimrra
05-04-2004, 12:14 AM#9
Wolfpox
QUESTION:
My hero transfers to the next level, with items. Yay.
Now the problem is, how do I transfer the money? Please just dumb it down for yours truly and tell me what triggery I'd need to do that?

[P.S. My problem is that in the second level I don't know how to load the integer value... it says "Use 'Game Cache - Load Integer Value' to load the integer... blah blah" but when I go to my second map there is no such function!]

[P.P.S. Upon futher inspection, I'm an idiot. The function was under set variable, of course....]
05-06-2004, 06:32 AM#10
Mrs. Train
I'm pretty new at every aspect of making maps. Thank you for spelling out the code on importing units. Who would have thought you needed to create the game cache again. You all rock.

One suggestion: there are no search results for 'game cache' or even 'cache' under the tutorial section, but the stuff here could be useful to lots of people.