| 07-04-2006, 02:01 PM | #1 |
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 |
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 | |
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? |
| 07-04-2006, 02:46 PM | #4 | ||
Quote:
Custom Script: call StoreReal(udg_gc, "location", "x", GetUnitX(HERO)) Custom Script: call StoreReal(udg_gc, "location", "y", GetUnitY(HERO)) Quote:
Then you'll need a more complex system. |
| 07-04-2006, 02:56 PM | #5 |
hmmm I see.... well thanks for helping me |
| 07-04-2006, 03:09 PM | #6 |
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 | |
Quote:
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 |
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 | |
Quote:
|
| 07-04-2006, 04:35 PM | #10 |
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 |
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 |
Store it in the game cache too. |
| 07-04-2006, 04:44 PM | #13 |
thanks *reps* |
| 07-04-2006, 05:59 PM | #14 |
Not to be cheeky or anything. You gave everybody rep but me... |
| 07-04-2006, 07:35 PM | #15 | |
Quote:
|
