Jump to content

distance of object


Bean666

Recommended Posts

buildingSF = createObject(9900, -1055.4000244141, 1298.1999511719, 59, 0, 0, 0)

local x, y, z = getElementPosition(buildingSF)

objLowLOD = createObject ( 5154, x,y,z,0,0,0,true )

setLowLODElement ( buildingSF, objLowLOD )

engineSetModelLODDistance ( 5154, 300 )

tried this example from the wiki, but it doesn't work, only the lowlod object is visible from afar, anyone knows how to be able to see created buildings from afar? 

EDIT: fixed, i missed the bool: isLowLod. setLowLODElement is no longer necessary. 

EDIT #2: Also, im wondering if converting .map files to lua files are safe and won't cause any lags? im refering to Patrick's converter, since i might consider replacing some of my map files to lua ones.

Edited by Bean666
Link to comment
  • Moderators
20 hours ago, Bean666 said:

EDIT #2: Also, im wondering if converting .map files to lua files are safe and won't cause any lags? im refering to Patrick's converter, since i might consider replacing some of my map files to lua ones.

I never tested it, but I don't think it would make any big difference. But unnecesarry to convert it, except if you want to do something with elements, etc...

  • Like 1
Link to comment
  • Moderators

It can be an issue with very large maps. Loading a map outside of Lua is faster as it eliminates calls between Lua and C/C++.

When I created the draw-distance resource, it created some issues when generating lowLOD objects all at once. This is of course clientside, but I guess a server wouldn't like it either. (Not sure if the Lua map implementation uses coroutines, but that would add some complexity for the external scripting implementations)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...