YouGroove Posted June 8, 2013 Share Posted June 8, 2013 It would be great to have automatically : Entities animated models loaded. Actually static models are loaded, why not animated characters ? what is the problem ? The solution in C++ is to attach some empty Lua script, and load character by it's name and code in a callback function Not so good workflow. As we should load map and find in it all models we placed could it be static or characters, we should not have ot laod them as they are in the map. Strange non common system , that is same map loading a LE2 Why not doing like other 3D engines, and load all what you put on the map ? 1 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
ZioRed Posted June 8, 2013 Share Posted June 8, 2013 It's not a problem with animated characters since I had same issue with primitives. I hope it will be changed so that we'll not be forced to have an empty script or having mass. Also having a callback for each entity is definitely not needed, it would be much better to have an Entity::Find to search for an entity by name among all the currently active entities (indipendently from having loaded a map or instanced through code), but leaving a callback to be called after the map has been fully loaded (that is all its entities loaded, not one by one that is unuseful if we had a generic Find). Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
klepto2 Posted June 8, 2013 Share Posted June 8, 2013 For me it worked with static and animated entities, will check it again later, but it worked 5 minutes ago. The callback thing was long awaited feature since LE2. You can not only make (in my opinion) cleaner code to handle special entites, but you can also integrate some kind of progress indicator. The callback itself has nearly no penaltiy on speed, as a maploader always needs to lpad an entity one by one and it doesn't hurt calling a small function providing such info. Well, for me the callback can be extended to provide some progress info as well beside sthe loaded entity. Like number of entiy and total entity count. Mybe some kind of mapinfo class might be suitable. These infos could be sotred in the header and don't need much space. Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Rick Posted June 9, 2013 Share Posted June 9, 2013 Do we know if the entities are actually loaded at the time right before calling the callback or is everything loaded internally and then it fires the callback for each entity? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 9, 2013 Share Posted June 9, 2013 I too prefer the entity callback. It allows you to store only the objects that you actually need. The documentation states that you have to specify a boolean when you want to load script and flowgraph information. However this seems to happen anyway. Also, I have no problem loading in a scene with animation. It works right away. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted June 9, 2013 Author Share Posted June 9, 2013 Also, I have no problem loading in a scene with animation but you do it by code with the callback. It's not puttign some character without any lua script in the editor and just call LoadMap without any callback : it won't work. And models can be characters or rocks, so wich will be loaded without callback and any lua Script ? i can't imagine a scene where you put 200 rocks models, and you have to load all entities yourself with callbacks and putting or each some empty Lua script.? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 9, 2013 Share Posted June 9, 2013 There already is an option for that but it is undocumented and it does not work in combination with map hooks. So it either doesn't work or it does something else. http://www.leadwerks.com/werkspace/topic/6893-csg-mergedont-merge-option/ Quote Link to comment Share on other sites More sharing options...
YouGroove Posted June 9, 2013 Author Share Posted June 9, 2013 To resume how does it works : when to load them, when it is done automatically ? 1) For static entities like rocks to load automatically ? (the rocks in my level don't necessary need collision if they are decorative in some parts, and they don't need mass as they are static) 2) For models with physics ? 2) For animated characters ? ******************************* I think the best would be LE3 to grow up instead of relying in LE2 map loading system 1) you place pivots or empty objects in the scene with some name : you manage yourself the laoding of 3D models 2) you place characters, models in the level editor and save map they are automatically loaded independently (even without mass or script) It depends on your game style also, some adventure game with some 4 or 10 NPC at screen , you prefer the engien to auto load them. I have some example RPG project, where there can be 20 characters on the map, not grouped, your code just manage to display and animate the nearest ones, the others are just hidden and not managed. For this example, indeed : auto load characters. Strange any other 3D engine, automatically loads characters or models if you have placed them in the map. why LE3 is so weak on that point ? A map loading, is loading all stuff you put in the level editor. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted June 9, 2013 Share Posted June 9, 2013 I think the best would be LE3 to grow up instead of relying in LE2 map loading system Odd I was thinking the same thing about someone else.... Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 9, 2013 Share Posted June 9, 2013 What are you talking about? Everything you place in the editor is loaded via the LoadMap function. Animations, prefabs csg, eveything is there. You can call hooks on loaded entities that are models, have a script or have mass. The only thing that we are requesting is that you simply add a checkbox for CSG that allows you to call a hook on it during map loading, without having to add a script or set its mass. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted June 9, 2013 Author Share Posted June 9, 2013 Just tested you need to attach some script. Any entity placed on the level in the editor should be loaded could it have script or not. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rick Posted June 9, 2013 Share Posted June 9, 2013 @YouGroove You only have to do that for CSG. Your normal 3D models will be loaded and passed to the callback. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted June 9, 2013 Author Share Posted June 9, 2013 @Rick : If i don't attach some Lua script to Goblin or Barbarian , they are not loaded automatically by calling LoadMap only (no entity callback) If i add some Lua script in the editor , they are auto loaded by calling the LoadMap with no CallBack function. I mean in any engine, if you place characters, geometry, anything : All that is loaded by calling one function like LoadMap and don't need any entity callback functions and any script. So if LE3 could load alone all what we place with the editor automatically with one call to loadmap only, it would be better i think. (no more annoying work arounds) Quote Stop toying and make games Link to comment Share on other sites More sharing options...
klepto2 Posted June 9, 2013 Share Posted June 9, 2013 You don't need the callback, its optional. You can access all entities in a world after your map is loaded like this: for(std::list<Entity*>::iterator it = world->entities.begin(); it != world->entities.end(); it++) { Entity* entity = *it; Leadwerks::System::Print(entity->GetKeyValue("name")); } The script workaround is just for CSG objects, which are normally collapsed and optimized while the map is loaded and so they are no real entities anymore. Everything else is loaded out of the box. Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI 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.