loading multiple .irr files?

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
n56
Posts: 4
Joined: Mon Feb 25, 2013 10:41 am

loading multiple .irr files?

Post by n56 »

making a multiple level game using different .irr files, how can we do this?
luthyr
Posts: 69
Joined: Wed Dec 30, 2009 5:47 pm

Re: loading multiple .irr files?

Post by luthyr »

Do you mean loading multiple .irr files into one active scene (manager) or having separate levels, each a different .irr file?

If you are wanting to simultaneously load multiple .irr files, I think you can just simply load them in succession.

If you want to treat them as separate level files, then you just need to call the SceneManager's clear function and load the next level.
n56
Posts: 4
Joined: Mon Feb 25, 2013 10:41 am

Re: loading multiple .irr files?

Post by n56 »

having seperate levels, i use thre clear but does that mean everything i had in the scenemanager goes? is there not a way to unload a level only?
luthyr
Posts: 69
Joined: Wed Dec 30, 2009 5:47 pm

Re: loading multiple .irr files?

Post by luthyr »

One thing you could do is load a level where the root node is another node, and simply remove that node if you'd like to keep everything else intact. It would act as a holder of all the level objects.

So: Create an empty scene node position (0,0,0) rotation (0,0,0) scale (1,1,1). Call loadScene and set the parent to be that empty scene node so all objects get loaded as a child of this object. Then if you call SceneManager->queueForRemoval() or emptyNode->remove() or whatever to remove it from the scene, you can keep the rest of the SceneManager objects.
Last edited by luthyr on Fri May 10, 2013 7:30 pm, edited 1 time in total.
n56
Posts: 4
Joined: Mon Feb 25, 2013 10:41 am

Re: loading multiple .irr files?

Post by n56 »

when clearing the scenemgr i get an error?
luthyr
Posts: 69
Joined: Wed Dec 30, 2009 5:47 pm

Re: loading multiple .irr files?

Post by luthyr »

That's not enough info to tell what's going on, but if you remove objects from the scene, you have to be absolutely sure nothing is referencing them still. For instance, you cannot remove objects if they are queued up to draw (which is why QueueForRemoval() is safer). Otherwise, if anything is trying to access those now deleted objects outside of the scene manager, it will crash.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: loading multiple .irr files?

Post by Mel »

It is better to handle the scene clear outside the begin/end calls, it is the best way to be sure you aren't picking something you shouldn't
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply