Jump to content

Process a scene with model filename


ParaToxic
 Share

Recommended Posts

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 :D

 

Maybe somebody can help me with that,

Thanks

Link to comment
Share on other sites

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.

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

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 :(

Link to comment
Share on other sites

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.

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

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

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