AggrorJorn Posted June 1, 2013 Share Posted June 1, 2013 I am posting as a result from this topic: http://www.leadwerks...o-c/#entry56549 When I load a map, I check if the object in a scene exists (in C++). CSG brushes are not loaded by default. Only with A script attached to it when the brush has a non zero mass. Now I have this trigger that doesn't need a script and also doesn't have a mass. In order for me to load it I have to attach an empty script to it in order for it to be loaded in. Can we have a merge (by default set to true) option that allows us to get brushes as entities when loading a map? This option is actually present but doesn't seem to affect loading behaviour. 3 Quote Link to comment Share on other sites More sharing options...
Rick Posted June 1, 2013 Share Posted June 1, 2013 +1 Seems silly to have to attach an empty script just to be able to get csg from code. Quote Link to comment Share on other sites More sharing options...
beo6 Posted June 1, 2013 Share Posted June 1, 2013 Just an idea until Josh decides: set the mass in the editor to anything else then 0 and reset it in your code. Trigger::Trigger(Entity* entity) { this->entity = entity; //... this->entity->SetMass(0); } Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 1, 2013 Author Share Posted June 1, 2013 Your object wont get parsed in the Load function since it doesn't have a mass or script attached to it. Thus in order to do what you do, you first have to set mass or attach a script. Then it gets parsed via the callback and you can set a mass. Quote Link to comment Share on other sites More sharing options...
Rick Posted June 1, 2013 Share Posted June 1, 2013 I think what he means is to set the mass to say 5 in the editor, then when you process your entity set the mass to 0 so it doesn't have mass. The setting of the mass to a non zero value will make sure it can be processed via Map::Load() and setting it back to 0 after you processed it makes sure it doesn't fall to the ground. This should work and is another alternative until Josh gives us a merge flag for CSG Quote Link to comment Share on other sites More sharing options...
beo6 Posted June 1, 2013 Share Posted June 1, 2013 That is exactly what i wanted to say. Thanks Rick. For what exactly is the option "Merge on load" in the editor? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 1, 2013 Author Share Posted June 1, 2013 @beo: sorry, I missread you post. You are correct. Just saw that as well. I think that is supposed to do exactly what we suggested, but it doesn't work since it is false by default. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 1, 2013 Author Share Posted June 1, 2013 Or perhaps this goes for entities, that you want to skip in Load callback... Anyhow, I can't find any information on it. Quote Link to comment Share on other sites More sharing options...
Rick Posted June 2, 2013 Share Posted June 2, 2013 Coming back to this the mass thing will work but you might actually want mass on some csg objects and so automatically just setting the mass to 0 might not work as you'd have to be very specific then for each object to check if it's the one you ant mass on and then not set it. Where the script method you don't have to worry about that, or better yet the "merging" flag we are hoping for solves all. 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.