| 09-04-2002, 10:43 AM | #1 |
Well I figured out atleast how to make it so the game cache saves and loads up the hero you initially selected from the 8 in the first level... But now I have a dilema on linking maps that have two entrances... For example when you first exist the tomb of heroes, it takes you to the map "Field" and you come out near the bottom of the map... In the northend of the map you exit and load up the Village map... But I want to make it so you can come back to the Field from the village, but entering in on the northend of the map... I can't figure out how to do this since anytime I come back from the village I am at the bottom of the map near the cave you exited from in an earlier map... I know I could easily just save Field as Field2 as a clone map and simply change the initial trigger what region your hero is restored to... But if I do that for every map my campaign is going to end up being like 5x bigger with all the cloned maps... Is there anyway i can achieve this through a gamecache? I already made it so there is an initial quest in your first visit to the map and when you exit to the town the quest marks itself as complete and I save the quest as a boolean into the game cache... And in the initial phase of the map I have an If/Then/Else which checks to see if the boolean is there... If it isn't then you've never exited to the town before and it loads you up by the cave. If you have gone to the town before then the boolean is there and it starts you at the top of the map... The problem is game cache pretty much saves permantly, so your first time playing the game you'll never have a problem... But anytime you re-start from the beginning, the boolean is still saved in the cache marking the quest in the Field map complete... So when you reach the field for the first time, it loads you up in the north end by the town... I am kind of stumped for an answer on how to do this with Cache. |
| 09-04-2002, 03:10 PM | #2 |
Guest | These may be 2 possibilities: 1) The game cache will not be reset if the scores are NOT being shown. For example, If you save a cache and then end the map with skip dialog and skip show scores, the map WILL save a cache but it seems it will not overwrite an existing one. You may see a "waiting for host" message. 2) maybe the "boolean" is not being saved. I've successfully set up a cache system that allows for map zones, similar to the way Baldurs Gate works. What I did was to save a cache for the specific map that the hero is leaving, with all of the NPC's and other map conditions saved within it. Then save a within a "global" cache a simple integer that has an index of the map that was left as well as the hero information. That way when the map is reloaded, you can reset everything to the way it was when you first left the map. (IE. Any dead pre-placed units will not be there when reentering the map and harvested trees will remain harvested. It is even possible to save the black mask if you plan ahead.) Once the new map is loaded, you can check the Index from the "global" cache to see which map the hero came from. A simple condition will tell you what map you came from and where to restore your hero. The main thing to remember is that you have to atleast show scores whenever you save an updated cache and you leave a map. |
| 09-04-2002, 07:43 PM | #3 |
Hm well I do have skip score and skill dialogue. But it still seems to save the data.. because it always saves and loads up my hero properly... But I am not really sure how your trying to explain the linking maps to me... I actually want monsters to re-spawn so you can come back to the map and the monsters will be back... But items are the thing I want that if you've picked up, they will be gone... I am looking through the cache a bit now for a cache called "global" all I really want to do at the moment is make it so when you first enter the field from the tomb you appear by a cave "this I have done already" but if you enter the field from the village, I want you to appear by the village gate... |
| 09-06-2002, 02:20 AM | #4 |
The most important thing is changing the starting area when yo enter the map from the village your hero would be at the top part of the map and when entering the map from the tomb you would be at the bottom part of the map... and certain triggers get disabled so everytime he enters the village map he wont go "hm, a human town, blah blah blah" and the problem is I can get it working somewhat but what saves in game cache stays in game cache... So the first time you play the game say when you exit out of the tomb it creates a quest and when you get to the village it completes the quests and saves that info in cache so at the beginning of the map it checks the cache and if the quest is complete you start by the village, if not you start at the tomb entrance... But after you've done it once it saves it in the cache for all time... So if ever you start a new game with the same profile it automaticly thinks the quest is done cause it's in the cache |
| 09-06-2002, 04:07 AM | #5 |
Guest | This is what I was saying about the cache. Do a test.... SHOW scores and see what happens with your caches. It should reset your cache file. The Cache files are not reset if you dont show the scores. |
| 09-06-2002, 04:20 AM | #6 |
Easy solution: Real variables are just numbers. Turns out you can store them in the game cache so: Event Victory Action Set Next Level to whatever Set beatlevel = 1 (where 'beatlevel' is a real variable you made) Store beatlevel in game cache Event Map Initialization Condition Action Restore beatlevel from gamecache If beatlevel = 1, move hero to location X So it detects if you're coming back, and then puts you where you would be if you were, or if you're not, then it just lets you spawn at the normal start location. |
| 09-06-2002, 08:34 AM | #7 |
That would work but only the first time you play through the game on that profile.. every time you want to start from the beginning you would need to create another profile... Because when something gets stored into cache it stays there and can't be deleted. when a hero gets saved into cache everytime the map loads up, it loads that hero from the cache, it gets updated when it gets replaced... So when beatlevel is set to 1 and is saved into cache, whenever you go to that level and it has the trigger restore beatlevel from gamecache if beat level is = 1 then start at other starting position... So if I start from the beginning, that varible will still be in the cache, thus when I get to that level for the first time it will start me at the wrong location. I can't see how showing scores empties cache... the campaign shows scores after every level and still restores the heroes from cache... Only way that trigger would work is if you started a new profile every single time. |
| 09-06-2002, 10:09 AM | #8 |
Guest | Or had a Dialog asking if the wanted to continue a game or start a new one. |
| 09-07-2002, 07:34 PM | #9 |
Oh well, I am finding a way around it. I am just creating lots of clone maps rather then using the variables and game cache... it got VERY confusing and annoying when I made a map that had 3 different entrances and exits to it. Maps are pretty small in size anyway, it was only the imported music that made cloning maps big, but now that I found out how to import music in the mpq directly and select it from internal music, thats no longer a problem. |
| 09-11-2002, 05:52 PM | #10 |
Guest | Sardius, I don't understand why if you store the variable before exiting one map, then restore it upon entering another, that it doesn't work. Exit Tomb: Set FieldFromTomb = TRUE Store FieldFromTomb in Game Cache Load Field Map Exit Village: Set FieldFromTomb = FALSE Store FieldFromTomb in Game Cache Load Field Map Enter Field: Restore FieldFromTomb from Game Cache If FieldFromTomb == TRUE PutHeroAtBottom Else PutHeroAtTop Endif If you leave the Tomb for the FIRST time, FieldFromTomb is set and restored, placing the hero at the bottom. If you then enter the Village and return to the Field, FALSE is not stored in the game cache, overwriting the previous TRUE? Are you saying it won't overwrite the first stored value? Why not, anybody? Sounds weird. Care. |
| 02-09-2003, 08:02 AM | #11 |
thx :D i love you guys :D I just had a similar problem with game cache and a 'looking-for-host-message' |
