Jump to content

LW 2.5, C++, parsing a scene for an entity or multiple entities.


Recommended Posts

Posted

Couldn't find a good topic on this, so I'm gonna ask myself.

Say I have a scene that I've loaded, and inside the scene I want to retrieve all of the entities of a specific type (like say, I want to get all the oil barrels for my barrel-romance simulator).

The problem is, I can't find a place to start. How would I implement a function where I could parse a scene for all of a type of entity?

Posted

Doesn't 2.5 return a root entity the entire scene is parented to? So you would just iterate through the children.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

You can use that. This is an example.

 

e is of type TEntity

en is a string

 

scene = LoadScene("abstract::myscene.sbx");
childCount = CountChildren(scene);
for(i=1;i<=childCount;i++)
{
e=GetChild(scene,i);
en=GetEntityKey(e,"name");
...
...

  • Upvote 1

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

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.

×
×
  • Create New...