ZioRed Posted June 7, 2013 Share Posted June 7, 2013 I have a map with only 2 cubes, one for the ground and one in the middle of it (no camera, light or anything else, I'm creating the camera through code). When I add the hook to Map::Load to cycle through the loaded entities, it isn't called at all for the cubes. Here is the code: void SceneLoaded (Entity* entity, Object* extra) { string text = entity->GetKeyValue("name"); std::stringstream ss; ss << "Entity: " << text; Print(ss.str()); } Map::Load("Maps/start.map", SceneLoaded); It seems that the callback is not called for any primitives, since I noticed that if I add a directional light, a camera or a model then the callback is called for only these kind of entities. Am I doing something wrong? Are you having this issue too? Also the callback (when gets called) is called for each child of an entity, so in example for the barbarian model the above code prints: Entity: SKIN_MESH Entity: BarbarianPelvis Entity: BarbarianLThigh Entity: BarbarianLCalf Entity: BarbarianLFoot Entity: BarbarianLDigit110 Entity: barbarian_knee_pad_L Entity: BarbarianRThigh Entity: BarbarianRCalf Entity: BarbarianRFoot Entity: BarbarianRDigit111 Entity: barbarian_knee_pad_R Entity: BarbarianSpine1 Entity: BarbarianSpine2 Entity: BarbarianSpine3 Entity: BarbarianRibcage Entity: BarbarianLCollarbone Entity: BarbarianLUpperarm Entity: BarbarianLForearm Entity: BarbarianLPalm Entity: BarbarianLDigit11 Entity: BarbarianLDigit12 Entity: BarbarianLDigit13 Entity: BarbarianLDigit21 Entity: BarbarianLDigit22 Entity: BarbarianLDigit23 Entity: BarbarianLDigit31 Entity: BarbarianLDigit32 Entity: BarbarianLDigit33 Entity: Barbarian_weaponL Entity: barbarian_shield Entity: barbarian_arm plate_01_L Entity: BarbarianRCollarbone Entity: BarbarianRUpperarm Entity: BarbarianRForearm Entity: BarbarianRPalm Entity: BarbarianRDigit11 Entity: BarbarianRDigit12 Entity: BarbarianRDigit13 Entity: BarbarianRDigit21 Entity: BarbarianRDigit22 Entity: BarbarianRDigit23 Entity: BarbarianRDigit31 Entity: BarbarianRDigit32 Entity: BarbarianRDigit33 Entity: Barbarian_weaponR Entity: barbarian_sword_03 Entity: barbarian_arm plate_01_R Entity: barbarian_shoulder pad_03_R Entity: BarbarianNeck Entity: BarbarianHead Entity: bon_gob_war_jaw Entity: bon_gob_war_face Entity: barbarian_helmet_02 Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
Rick Posted June 7, 2013 Share Posted June 7, 2013 You are talking csg? If so then you have to either attach a script to each csg model or set it's mass, otherwise the LE engine treats csg differently and you won't be able to get it this way. Literally make a new script, leave it empty, and attach it to the csg model and then you should see it show up. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 7, 2013 Share Posted June 7, 2013 A request has been made in the suggestion forum for this behavior. Quote Link to comment Share on other sites More sharing options...
ZioRed Posted June 7, 2013 Author Share Posted June 7, 2013 Oh thanks Rick, I'm currently just making tests to see how LE3 works. A request has been made in the suggestion forum for this behavior. Cool, because it's like a hack to create an empty script. Also the callback for each child of a model is pretty weird, I think it should be called only on the model root entity (and also the root of other models attached to it by the user in the editor, e.g. when you add a weapon to a character [it's not the case of barbarian since the weapon is inside the model itself]). Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
tjheldna Posted June 7, 2013 Share Posted June 7, 2013 Thanks Rick, I was wondering how to do the same thing. 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.