HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Level Changing Returning To Point Of Level Entry

07-04-2006, 02:01 PM#1
Dr.Nexus
Ok so I've figured out how to change the level but I need to figure out how to make it so that when the hero comes back to the first map he returns to the point where he entered the second map make sense? I've seen it on the orc campaigns so I know it can be done I just don't know how
07-04-2006, 02:13 PM#2
The)TideHunter(
Store the units X and the units Y in a gamecache, and load it on the new map.
use Store Real.
07-04-2006, 02:21 PM#3
Dr.Nexus
Quote:
Originally Posted by The)TideHunter(
Store the units X and the units Y in a gamecache, and load it on the new map.
use Store Real.
this may sound stupid but where do I find the X and Y coordinates and what if I want to use the same map? like he goes from the first to the second then back to the first with the same gold you had on the first map and the units are all where they were?
07-04-2006, 02:46 PM#4
Captain Griffen
Quote:
Originally Posted by Dr.Nexus
this may sound stupid but where do I find the X and Y coordinates

Custom Script: call StoreReal(udg_gc, "location", "x", GetUnitX(HERO))
Custom Script: call StoreReal(udg_gc, "location", "y", GetUnitY(HERO))

Quote:
and what if I want to use the same map? like he goes from the first to the second then back to the first with the same gold you had on the first map and the units are all where they were?

Then you'll need a more complex system.
07-04-2006, 02:56 PM#5
Dr.Nexus
hmmm I see.... well thanks for helping me
07-04-2006, 03:09 PM#6
Thunder_Eye
No it's not very complex, I assume you're making a campaign, so.
You need to store a integer or something to keep track where the unit came from, so say it looks like this
chart of the maps:
  1
  |
2-3-4

Say you start in map one, you move on to map 3. Store the integer in the gamecache as 1.
Then continue on to map 3.
At map three, load the integer and check what number it is, if it is 1, then reload the hero at the top of the map.
07-04-2006, 03:30 PM#7
The)TideHunter(
Quote:
Originally Posted by Captain Griffen
Custom Script: call StoreReal(udg_gc, "location", "x", GetUnitX(HERO))
Custom Script: call StoreReal(udg_gc, "location", "y", GetUnitY(HERO))

Why make things hard to understand? you can store it without Jass.
Very simple...
Trigger:
Actions
Game Cache - Store (X of (Position of (YourUnit))) as UnitX of Locations in (Your GameCache)
Game Cache - Store (Y of (Position of (YourUnit))) as UnitY of Locations in (Your GameCache)
07-04-2006, 03:45 PM#8
Captain Griffen
I was worried about leaks.

Which was rather silly, since the leaks last untill the end of the map...about a nano-second later.
07-04-2006, 04:28 PM#9
Dr.Nexus
Quote:
Originally Posted by Thunder_Eye
No it's not very complex, I assume you're making a campaign, so.
You need to store a integer or something to keep track where the unit came from, so say it looks like this
chart of the maps:
  1
  |
2-3-4

Say you start in map one, you move on to map 3. Store the integer in the gamecache as 1.
Then continue on to map 3.
At map three, load the integer and check what number it is, if it is 1, then reload the hero at the top of the map.
how do you do that?
07-04-2006, 04:35 PM#10
Alevice
Something like if unit enters region "From West map to East Map", set HeComesFrom 1, save and go to EastMap.w3x.

In EastMap.w3x load all data, if HeComesFrom == 1, create Hero at "From East map to West Map".
07-04-2006, 04:40 PM#11
Dr.Nexus
well that problems solved then... so I've got one last question say I wanted to save the heroe's gold at the end of every map and load it onto the next what would i do for that?
07-04-2006, 04:42 PM#12
Alevice
Store it in the game cache too.
07-04-2006, 04:44 PM#13
Dr.Nexus
thanks *reps*
07-04-2006, 05:59 PM#14
The)TideHunter(
Not to be cheeky or anything.
You gave everybody rep but me...
07-04-2006, 07:35 PM#15
Dr.Nexus
Quote:
Originally Posted by The)TideHunter(
Not to be cheeky or anything.
You gave everybody rep but me...
sorry I must've skipped over you on accident