ParaToxic Posted January 30, 2013 Share Posted January 30, 2013 Hey ya I would like to make a processscene function that goes through the scene and give me all entitys that have the same mesh filename . That is for my ActorSystem.I would like to have some dummy objects in my scene, which represents the spawn points of the different actors and in my code I would like to create for each actor in the scene a Actor instance with some keys .... but I need something else as the name ( which you can get with the FindChild function ). I thought ybout the javascriptfunction getElementsById Maybe somebody can help me with that, Thanks Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted January 31, 2013 Share Posted January 31, 2013 If I understand you correctly you are wanting to spawn named actors in real time at given waypoints and then retrieve those actors by name? Why not simply store pointers to those objects as they are created along with the names you want to reference them as in a map container. You can then write a function to search the indexed map container for any named Actor and return a pointer to the actor instance. You could also used a named key to store the Actor name in the entity itself. You could save the pointer and class name as keys too if you wanted so you could cast it back to the the Actor Class. I'm not sure if you actually meant the waypoints (markers, dummy objects etc) themselves but the same techniques could be used. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
ParaToxic Posted January 31, 2013 Author Share Posted January 31, 2013 I think that is the answer to the question Thanks Quote Link to comment Share on other sites More sharing options...
Rick Posted January 31, 2013 Share Posted January 31, 2013 The way I usually do this is In the Lua scripts of the objects in question (spawn point for player) I give it a special key that I then look for when loading the scene. What I thought was really cool was when I was using the C# implementation I made a plugin system for the scene loader where each C# class object was it's own DLL. When the game loaded it would dynamically load all these DLL's that were in a specific folder to the project. Then in the Lua scripts I would make a property that would be the string representation of the C# class namespace + name. The when loading I would use reflection to dynamically create the C# object based on this string. These objects would share a common interface since I used them for like things that had different functionality, but this made the scene loading part really small and simple and didn't require me to change it when I added new placeholders. I just made the DLL for that placeholder object, stuck it in the plugin folder, and game the namespace + string name for that object in Lua and BOOM! I wish C++ had proper reflection Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted January 31, 2013 Share Posted January 31, 2013 I wish C++ had proper reflection Yup For leadwerks 3 I think we should come up with a module/plugin pattern. The asset store is no where near plugin and play as result. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 31, 2013 Share Posted January 31, 2013 The Lua side of LE3 is basically a plugin pattern already. The C++ side could probably use something like this but the lack of reflection makes that hard. Quote Link to comment Share on other sites More sharing options...
Canardia Posted January 31, 2013 Share Posted January 31, 2013 I think it's all about defining and agreeing on a interface pattern. When all functions and classes follow the same pattern, you could reuse C++ code much easier. Additionally also a game design pattern should be agreed on, which works for all kind of games, except maybe some experimental games. Most things in life can be done much better with agreements, than with forced programs. 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...
ParaToxic Posted January 31, 2013 Author Share Posted January 31, 2013 Thanks for the answers.The stuff with the entity key was also a first idea , but I wasn't sure if the program doesn't crash when I check a entity for a non existent key...Well now I have it Thanks I hope he LE3 Framework has this kind of pattern system, because I would like to make advanced functions and stuff like own shader frameworks ... etc. isn't "possible" ( I mean without hooks ) with the current framework. 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.