Jump to content

Map::Load hook


ZioRed
 Share

Recommended Posts

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

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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]).

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...