[Help] Loading and deleting

Dibalo

01-12-2006 15:57:35

Hi again and my apologizes for this newbie question. :oops: I´m wondering map loading and deleting in PSLM2. Let´s assume that I have 2 maps. First I go to the mountains in my game. Then I travel to the lakes. These two areas have their own maps. So: how can I delete the previous map from the system and load the new map after deleting previous? If I travel from the mountains to the lakes, the system will delete the mountain map data and load the lake map data. If I decide to travel to the mountains again, the system will delete the lakes and load the mountains. I hope you undestood.

Thanks.

tuan kuranes

01-12-2006 16:54:44

The way it works you have to merge your two small maps into a big one, then split it with mapsplitter and then PLSM2 will handle load, unload of part of terrain needed.

Dibalo

01-12-2006 18:14:40

I undestand it but I that´s not exactly what I´m searching for. :(

It´s more like... hmm... I´ve undestood that PLSM can handle multiple maps and change the showed map with smgr->setOption("CurrentMap", &map") (or something like that). I think that the right explanation would be: I have two planets (Earth and Mars). If I want to travel to the Earth, I want to delete Mars maps because I have no use for them in Earth. If I want to travel to the Mars, I want to delete Earth maps because I have no use for them in Mars.

Or is your answer still compatible for my requests? Can user somehow decide, which pages are allowed to show or something like that?

tuan kuranes

02-12-2006 12:14:44

Sorry, misunderstood.

You best bet would be to go for multiple scene manager, one for mars, one for earth, when switching times come, just switch scene manager.

Dibalo

02-12-2006 18:59:07

Sorry, misunderstood.

You best bet would be to go for multiple scene manager, one for mars, one for earth, when switching times come, just switch scene manager.

Thanks for your solution. I think that it could still be better to list all maps to the system beforehand and then just change maps with setOption("CurrentMap",...). Am I right that the PLSM doesn´t keep another maps´ data in the system (I mean heightmapdata, alphamaps etc..)? So it wouldn´t be serious memory consumption to list all maps to the system (like loading ""paginglandscape2.cfg" containing all map definitions)? Or?

Dibalo

02-12-2006 21:52:56

I solved this. Just had to search other posts and update PLSM wit CVS.

Solution: When I want to delete the current map, I´ll use setOption with "ResetScene". When I want to load new map, I'll use setOption with "CurrentMap" and setOption with "LoadMap". It seems it works and no memory leaks. :)

Thanks to you Tuan. :)