Jump to content

GetEntityClass, SetEntityClass


MasteR
 Share

Recommended Posts

SUGGESTED FUNCTIONALITY ALREADY EXISTS

Background information:

 

Decided today to begin my decent into the Leadwerks engine.

Created a simple program that loaded the Tunnels.sbx for me to view. I then learned that "Lights must be separately created by searching the scene entity").

 

Problem:

 

There was no way to tell what each entity created in the Leadwerks editor was.

GetEntityType is "the entity collision type".

GetEntityKey is "the specified key name" for the entity.

 

There is no method to return what an entity’s class is (I use "class" as “type” refers to collision type)e.g. PointLight, Camera, Model, etc.

 

I noticed that in the Leadwerks editor entities can’t share the same "name" (key). This meant that even if you created the scene from scratch with the above problem in mind you still would not be able to use GetEntityKey effectively.

 

Solution:

 

Add an extra parameter to the base entity class that will store the entity’s "type or class" e.g. PointLight = 0, Camera = 1, Model = 2, etc.

 

I'm using C++ and am aware that I could create my own class which creates an entity and also stores its "class", but this solution will not solve the problem with scenes created in the Leadwerks editor.

Thus this functionality should also be added into the Leadwerks editor as an additional property that can be edited when creating entities.

AMD Athlon 64 X2 Dual Core 6000+ (3.0 GHz)

4 GB DDR2 RAM

2 x NVIDIA GeForce 9500 GT 512 MB (SLI 1.0 GB)

Windows XP Pro

Link to comment
Share on other sites

I then learned that "Lights must be separately created by searching the scene entity").

Lights will be loaded automatically if you have the Entities folder in your project and use Framework.

 

 

There is no method to return what an entity’s class is (I use "class" as “type” refers to collision type)e.g. PointLight, Camera, Model, etc.

GetEntityKey(e,"class") returns the class of an entity.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

GetEntityKey(e,"class") returns the class of an entity.

 

I see clearly I need to delve one step deeper into the Wiki. Thank you very much Lumooja, will be a little more vigilant in my research and testing in the future.

 

However I’m still seeing some shortfalls, but I’ll take this discussion up in the C++ programming forum.

AMD Athlon 64 X2 Dual Core 6000+ (3.0 GHz)

4 GB DDR2 RAM

2 x NVIDIA GeForce 9500 GT 512 MB (SLI 1.0 GB)

Windows XP Pro

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