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

Campaign: Hero?

Status
Not open for further replies.
Level 5
Joined
Jun 27, 2008
Messages
141
Hi! Need some help of you nice people on the hive!

I was thinking of making a hero based campaign until i ran into the problem that i dont know how to make the heros stats, items and exp stay to the next map. Please give me an answere!
 
Level 12
Joined
Nov 24, 2007
Messages
543
First, decide on what your gamecache should be called. I'll call mine TestCache.w3v. Open up your first playable map. Again, go to the trigger editor to before the Victory! line. Add these lines:Game Cache - Create a game cache for TestCache.w3v
Game Cache - Store Paladin 0000 as John the Paladin of Map 1 in (Last Created Game Cache)
Game Cache - Save (Last Created Game Cache)
You may be wondering "Why would I want to store him 'of Map 1'? Why not just 'of Heroes' or something?" The answer is simple: If, say, your player completes the game then goes back to map #3, if you use 'of Heroes' for every map, you will then create a level 14 hero with uberhaxx items, or whatever the hero was at the start of your last map. You don't want that, now, do you? So we save him 'of Map 1' so that Map 2 knows to use the hero from the map before, and not from map 14. So for map 1 you use "of Map 1", map 2 you use "of Map 2", etc. (You may not want them to be called "of Map #").

Okay. You have map #1 save the hero, but how do you make map #2 load him? Simple. Create a region where you want him to appear. Next, create a Unit variable with his name, or something. Then, add this to your Initialization trigger, after a brief wait (NOT right at the beginning!).Game Cache - Reload all game cache data from disk
Game Cache - Create a game cache for TestCache.w3v (do not forget the .w3v!)
Game Cache - Restore John the Paladin of Map 1 at (Center of (GameCacheRegion <gen>)) facing (Default Building Facing 270.00) degrees
Set John = (Last Restored Unit)Add that to every map (with appropriate changes) and go and test it. You now have your very own fully-working game cache!
 
Status
Not open for further replies.
Top