HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Can I save everything in a map into a cache?

09-03-2002, 08:01 AM#1
Sardius
Like say I have a re-occuring map... Like a certain region takes you inside of a cave which loads up an entirly different map... But you have an exit to the cave that you can leave through and return to the map you just came from...
How can I cache it so everything that has happened in that level still remains, like any enemies you've killed remain dead and any items you've aqquired will no longer be there...
I have made a link to jump back and forth between two levels and have tried fiddling a bit with game cache but everytime I return to the level all the items and monsters are back again.
09-04-2002, 06:18 AM#2
Guest
I think the editor can do that, but it would be very painful if you're dealing with many objects. I think you'd have to create a boolean variable for every item/critter/etc. for each map such that each time you kill a critter it sets its own variable. Like If "ThisCritter009 is killed" then "Set Critter009Dead = True"
Then store it to game cache. Save the Game Cache on the way out. Carry it throughtout all your maps to keep the checks loaded.

That is if you can find the "Game Cache - Load Real/Integer/such and such" actions, as I can not seem to find them on my editor :D
(though the "Game Cache - store such and such" options tell me they're supposed to be there)
As such I can't really say if the above nonsense would work or not, since I can't load anything from my Cache except units, and thus can't test it :(

edit:
oh, there they are... found the Game Cache load functions :D . Need to use "Set Variable = Game Cache - Restore whatever".
Made a little test maps, and yes you can use a boolean array to store object status between maps .... but I don't know any good way to do it. I only had 9 objects to track in my test, and put them all into the array one at a time, which is slow, and boring, and probably looked down upon by people who know how to use the editor alot better than I do (which is most people :p )
09-04-2002, 05:13 PM#3
Guest
Probably better to store a few "master" booleans, that recreate everything when you return to the map, positioned at key points in your story structure.