• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Game Caches

Status
Not open for further replies.
Hey guys!

I know that you guys will just post linking me to several Game Caches tutorials, but the problem is, they don't really teach me how to restore units from map-to-map in a campaign.
I mean, I understand the storing of units, but I don't understand anything else after storing.

If you post, please post a step-by-step tutorial, fully-detailed or else I might fail as how I usually do. :D
Thanks for reading.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Storing a unit:

First create a game cache from your map.
  • Game Cache - Create a game cache from mapname.w3v
Enter the name of your map and add the .w3v. Yes, it must be .w3v even though your map is .w3x. You can check the map name in campaign editor -> general

Then store the unit.
  • Game Cache - Store Hero1 as MainHero of Heroes in (Last created game cache)
The Hero1 is a variable in this case where the hero is stored. You must set what unit you want to store.

MainHero is just some string that is used as a key to load the hero. Heroes is a similar key. You can enter whatever you want in there. Just don't overwrite data, use different keys like this:
  • Game Cache - Store Hero1 as MainHero of Heroes in (Last created game cache)
  • Game Cache - Store Hero2 as SecondaryHero of Heroes in (Last created game cache)
Then save the cache:
  • Game Cache - Save (Last created game cache)

Loading units:

Create game cache from the map you want to load the unit(s) from.
  • Game Cache - Create a game cache from mapname.w3v
For example if you are in map 3, then create the cache from map 2.

Restore the unit(s):
  • Set p1 = (Center of (Playable map area))
  • Game Cache - Restore MainHero of Heroes from (Last created game cache) for Player 1 (Red) at p1 facing 270.00
  • Set Hero1 = (Last restored unit)
  • Game Cache - Restore SecondaryHero of Heroes from (Last created game cache) for Player 1 (Red) at p1 facing 270.00
  • Set Hero2 = (Last restored unit)
  • Custom script: call RemoveLocation(udg_p1)
And that's all there is to it.
 
Level 2
Joined
Mar 15, 2010
Messages
9
I have a question..
can I save the game cache from each map(ex.map1,map2,map3) as GeneralGameCache.w3v???and load GeneralGameCache.w3v in each map???
TIA for the answers!!!
 
Level 2
Joined
Mar 15, 2010
Messages
9
As far as I know yes
you can use one Cache to hold all the data from start to finish

I already tried to use a GeneralGameCache for all the maps and Im wondering why sometimes it is working but sometimes it does not..

anyone ever tried this??
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
What I do, is save all files inside the same game cache called "ap0sCache.w3v" (not a real map name, just something to store data in).
This is useful because you can load caches of completely different maps without having to find in which 'file' you saved it.

You should only have 1 game cache per campaign.
Inside that game cache, you can store all data and easily reload it that way.
I just go a little further and use 1 game cache for all maps I use (so I can know whether you played a completely unrelated map of mine before).

So yes, you can load 2 hero's from completely different maps - note that the raw ID of the units should be the same otherwise it might bug.
This might be your problem, feljur: you're reloading the data, but it simply does not exist in the object editor (let's say you save a custom hero with raw ID "H0A5", while the map you're loading it in does not contain such an object, it'll just do nothing, probably). It's just a guess though.
 
Status
Not open for further replies.
Top