Nimzog Posted June 4, 2014 Share Posted June 4, 2014 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. Quote Link to comment Share on other sites More sharing options...
Rick Posted June 4, 2014 Share Posted June 4, 2014 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. Quote Link to comment Share on other sites More sharing options...
Nimzog Posted June 4, 2014 Author Share Posted June 4, 2014 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? Quote Link to comment Share on other sites More sharing options...
Rick Posted June 4, 2014 Share Posted June 4, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.