Jump to content

Recommended Posts

Posted

Hello

 

I am trying to change a map while in game. The result I am getting at the moment is that each time I do a Map::Load() the new one is added to the old one. This means that the lights get freakish and objects that should not be there are still there. I looked around the command reference doc and I cant find a way to delete an old map as it is not assigned to a variable anywhere. Is there a way using the context or world object? I am doing this in C++ in case it is usefull.

Posted

When you load a map all the entities in the map get added to the world. There should be a Clear() function on the world which if you do that before you load your next map should remove all the entities in the world.

Posted

I dont want to destroy all the entities because its like an alternate world of the current one that we can switch back to at some point. I just found the setCurrent/getCurrent methods would those be better suited for that?

Posted

Well I'm pretty sure anything loaded will be displayed. I think you might want to load 1 map into 1 world, then switch to a different world and then load another map (which will put those entities into that world). I'm not sure if you can show/hide worlds from the world variable but if not you could either make a pivot in each world and loop through all entities and making it a child of this pivot (this might mess up other things in your entities) and then just hide/show that 1 pivot to hide/show all child entities, or just loop through each entities in each world and call Show/Hide on them.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...