Jump to content

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


Pastaspace
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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

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