gamecreator Posted December 29, 2016 Share Posted December 29, 2016 I was thinking of using the map load hook to remove rocks in a map and replace them with my own since they need to be interacted with (broken apart). Something like the following: void MapLoadCallback(Entity* entity, Object* extra) { std::string text = entity->GetKeyValue("name"); if(text.compare("rock")==0) { Vec3 pos; pos=entity->GetPosition(); entity->Release(); // Create new breakable rock here at pos } } I know people have used this hook to create progress bars and I think Josh said that it wasn't intended for that. So I wonder if this is something that might screw up my program. I haven't tried it yet but before I code it in, I was wondering if this would be ok to do. The other option is to use ForEachEntityInAABBDo and specify the entire map. Not sure if that would be slow. Thoughts or other options? Quote Link to comment Share on other sites More sharing options...
Rick Posted December 29, 2016 Share Posted December 29, 2016 Your other option is to loop over all the entities in the world after you've loaded the map. world->entities I think is the list you would loop over. 1 Quote Link to comment Share on other sites More sharing options...
gamecreator Posted December 29, 2016 Author Share Posted December 29, 2016 That seems the best way to go. Thanks! 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.