• 🏆 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!

[Trigger] How can I load units?

Status
Not open for further replies.
Level 2
Joined
Mar 15, 2010
Messages
9
How can i save unit and load it in another map..
please help..TIA

Im working on a campaign and im a newbhie..
The campaign "the founding of durotar" really inspire me..
How can I save a unit and load it to another map..
Im really confused on how to use the "Game and Game Cache" triggers..

This is the senario Im working with..
I have a map named map1 when my main unit reaches a certain
point on map1(example is a cave entrance)..
The map1 will be saved as well as the unit..
Then map2 will be loaded as well as the saved unit..
Again when my main unit reaches a
certain point in map2(example is the cave exit),the game will be saved again as well as the main unit,
then saved game of map1 will be loaded as well as the main unit..

The question is how can I retrieve the unit I saved from map2 and load it to map1's loaded saved data or vice versa..

Thanks to those who will provide me answers..TIA
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
There are a ton of tutorials on this...

Look at how blizzard did this in the campaigns...

The principles are you save a hero tothe game cache and then save the gamecache. The gamecache has a certain name.

You then load the gamecache in your other map (with the same name) and restore the hero from it. It stores inside the gamecache using 2 strings which are kind of like array indicies so must be the same strings in both maps.
 
Level 2
Joined
Mar 15, 2010
Messages
9
tnx for the infos ^^

There are a ton of tutorials on this...

Look at how blizzard did this in the campaigns...

The principles are you save a hero tothe game cache and then save the gamecache. The gamecache has a certain name.

You then load the gamecache in your other map (with the same name) and restore the hero from it. It stores inside the gamecache using 2 strings which are kind of like array indicies so must be the same strings in both maps.

Thanks alot DOC!!really apreciate it but what do you mean by (with the same name)??
Thanks again
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Well, when you create a gamecache you have to specify it with a name. Inorder to load a gamecache, the other map must create one with the same name as was used in the previous map.

Obviously you will also need to save the cache and load the cache as well as this.
 
Level 2
Joined
Mar 15, 2010
Messages
9
Well, when you create a gamecache you have to specify it with a name. Inorder to load a gamecache, the other map must create one with the same name as was used in the previous map.

Obviously you will also need to save the cache and load the cache as well as this.

I understand now thank you so much!!
Big help for newbs!!BTW I did it already..
Thanks again!!
 
Status
Not open for further replies.
Top