MasteR Posted April 1, 2010 Share Posted April 1, 2010 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. Quote 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 More sharing options...
Canardia Posted April 1, 2010 Share Posted April 1, 2010 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. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
ZioRed Posted April 1, 2010 Share Posted April 1, 2010 Perhaps you are looking for ForEachEntityDo which allows you to cycle through entities by their class type (ENTITY_SPOTLIGHT, ENTITY_CAMERA, ENTITY_MODEL, etc). Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
MasteR Posted April 1, 2010 Author Share Posted April 1, 2010 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. Quote 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 More sharing options...
Guest Red Ocktober Posted April 2, 2010 Share Posted April 2, 2010 try GetEntityKey(entity,"classname")... --Mike 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.