Loading multiple maps sequentially

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Psycholo D

Loading multiple maps sequentially

Post by Psycholo D »

Hi Folks,

I'm just getting started using the Irrlicht engine and I want to use it for
displaying multiple maps sequentially (like leaving one level and
entering the next one which is a different map).

Now, I have looked around but haven't found any solution other than
creating a new IrrlichtDevice and doing all the initialization stuff over
and over again. This, however, does not appeal to me because it doesn't
look nice and I have to initialize values that do not change.

Does anyone know how to load another (by the way: BSP-) map in an
elegant way?


Regards,

D.
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

It'll probably have to be done with collision events. "Walk into a invisible square or hit a door and be transported to another map". I am still trying ot figure out how to do this myself...
Psycholo D

Post by Psycholo D »

No, I don't need to know when to switch levels, but HOW to do this elegantly.
Like someone hits "N" and jumps into the next level; now the question is, what has to be reloaded and reinitialized. I cannot find something like removeMesh or something.

Hope someone knows an answer...

D.
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

I think I know this one. Have the trigger in place ( IF, WHILE, whatever works ) and unload the device:

Code: Select all

device->drop();
Then start again from after you have initialised the drivers ( I think ), tell it to load the the new map, probably give a load screen if it is gonna be long, and then initalise the device again loading the new map. I think that's right, that's what I was planning to do.
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

What you want is removeChild, not delete mesh.

Code: Select all

smgr->getRootSceneNode()->removeChild(NodePointer);
As far as elegance, that's the iffy spot. Games like HalfLife and Red Faction have you hit a spot and load a map that would be a continuation. At the swapping point, there is a little stub of the next level that you can't be at from the previous level. This gives the illusion of seemless movement.
Crud, how do I do this again?
Post Reply