deniz Posted June 6, 2011 Share Posted June 6, 2011 hi all, I am trying to set view range parameters of entities loaded with LoadModel (we need to call this to enable lua scripts) but calling EntityViewRange() does not seem to have any effect for such entities (loaded with LoadModel) when I create meshes at run-time using LE-commands (CreateMesh, CreateSurface etc.), then EntityViewRange() works on them. I tried to load the model with LoadMesh but it did not worked again (I have to use LoadModel anyway to run models' lua-scripts). do I have to set a parameter in the lua-script or do I have to do something else? any suggestions? Quote Link to comment Share on other sites More sharing options...
macklebee Posted June 6, 2011 Share Posted June 6, 2011 it can be set using the model's lua script under the Properties Appearance tab. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted June 10, 2011 Share Posted June 10, 2011 Please post an example showing what you are trying to do. Otherwise it is very hard to guess what might be happening. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
deniz Posted June 13, 2011 Author Share Posted June 13, 2011 Please post an example showing what you are trying to do. Otherwise it is very hard to guess what might be happening. What do you mean by example? the code or the model in question or both? in case just the code is sufficient: TEntity ent = LoadModel("xyz.gmf"); EntityViewRange(model, VIEWRANGE_INFINITE); // this does not have any effect then I tried this: TEntity ent = LoadMesh("xyz.gmf"); EntityViewRange(model, VIEWRANGE_INFINITE); // this does not have any effect as well but if I try the following the code, EntityViewRange works just fine TMesh mesh = CreateMesh(); TSurface surf = CreateSurface(mesh); //... // some commands to set vertices, normals and define a simple quad //... UpdateMesh(mesh); EntityViewRangemesh, VIEWRANGE_INFINITE); // this works just fine.. so my question is: how can I change the view-range of the model? the model is exported from MAX using gmf-exporter. remember: we are adding the model (or multiple copies/instances of it) to the scene during run-time. so dragging an instance or multiple instances of the model into the scene and then loading the scene is out of question here. do we have to include something in the lua-script of the model? Quote Link to comment Share on other sites More sharing options...
Game Producer Posted June 13, 2011 Share Posted June 13, 2011 Hmm, so you want it to show always, then VIEWRANGE_INFINITE should work, if you want something else, try VIEWRANGE_NEAR: http://www.leadwerks.com/wiki/index.php?title=Entities#EntityViewRange Is your camera view range setup correctly? Please notice that: The entity will not be drawn if it is further from the camera than the view range. If the recursive parameter is set to 1, all children in the entity's hierarchy will be set as well. To change the world's view ranges, use SetWorldCullRange. [/Quote] EDIT: also try setting recursive parameter to 1: EntityViewRange( mode, VIEWRANGE_INFINITE , 1 ) Quote Intel Dual Core 3GHz / GeForce GTS 450 - 1024 MB / Driver ver 267.59 / 8 GB RAM / Win 7 - 64 bit / LE2.50 / BMAX 1.48 game producer blog - Dead Wake Zombie Game powered by Leadwerks Engine Twitter - Unfollow me Link to comment Share on other sites More sharing options...
deniz Posted June 13, 2011 Author Share Posted June 13, 2011 Hmm, so you want it to show always, then VIEWRANGE_INFINITE should work, if you want something else, try VIEWRANGE_NEAR: http://www.leadwerks.com/wiki/index.php?title=Entities#EntityViewRange Is your camera view range setup correctly? Please notice that: EDIT: also try setting recursive parameter to 1: EntityViewRange( mode, VIEWRANGE_INFINITE , 1 ) setting the recursive parameter to 1 solved the problem, thanks 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.