editor: multiple fixes & improvements related to LODs
- [X] editor_main: Makes useLODs setting enabled by default. It's a feature that the game uses for world objects, there is no reason to disable it for new maps.
- [X] editor_main: Modernizes the map scripting extensions script: gets rid of the clientside engineSetModelLODDistance to 300, which did not make sense. Let's keep the default model LOD distances.
- [X] editor_main: Adds missing LOD models to the table. Rockstar hid these object=>lod associations in binary IPL files. Fixes #555 Credits to @spooky-spook (
spookysporkson Discord) - [X] edf & editor_main: Fixes LOD models not creating for objects during mapping
Why would maps have useLODs disabled by default????? It's literally a game feature that should be enabled automatically for maps imo.
Tested! Ready for review, im satisfied with the result
New maps will look like this
This script's purpose is to make removeWorldObject map entries and LODs work
I don't think that useLODs should be a good idea to be true as default, since most players are not aware of what LODs do in the first place. And this may affect players with low-end PCs. Other than that, seems like a good refactor overall.
The LOD object model only loads when the object becomes far away, replacing the normal object (or so it should). I doubt it's bad in terms of performance...
I know me and many MTA players have always hated seeing objects disappear at a low distance, due to the lack of LOD loaded because the script only did createObject once without assigning any LOD... It's especially frustrating and immersion-breaking in the map editor while you're mapping to see these objects disappear.
Actually, keep this on hold. I'm gonna make a mtasa-blue function to return the new LOD_TABLE :-) It will be useful to have this in MTA itself
Updated to use new upcoming feature from https://github.com/multitheftauto/mtasa-blue/pull/3831
Work on this PR is paused until we figure out https://github.com/multitheftauto/mtasa-blue/pull/3831
i cant test this PR due to these errors
EDIT: nvm getObjectLowLODModel still not implemented in mtasa-blue
[01:29:56] ERROR: [editor]\edf\edf.lua:33: attempt to call global 'getObjectLowLODModel' (a nil value)
[01:29:56] ERROR: [editor]\editor_main\server\interface.lua:11: call: failed to call 'edf:edfRepresentElement'
[01:29:56] WARNING: [editor]\edf\edf.lua:825: Bad argument @ 'getElementData' [Expected element at argument 1, got boolean]
[01:29:56] WARNING: [editor]\editor_main\server\IDhandler.lua:45: Bad argument @ 'getElementType' [Expected element at argument 1, got boolean]
[01:29:56] WARNING: [editor]\editor_main\server\IDhandler.lua:47: Bad argument @ 'getElementID' [Expected element at argument 1, got boolean]
[01:29:56] ERROR: [editor]\editor_main\server\util.lua:119: [editor]\editor_main\server\IDhandler.lua:71: attempt to concatenate local 'idString' (a boolean value) [string "?"]
[01:29:56] ERROR: [editor]\editor_main\server\util.lua:121: [editor]\editor_main\server\IDhandler.lua:71: attempt to concatenate local 'idString' (a boolean value)
I will remake this PR. I don't think there will be an addition of a function to get the LOD of a model in mtasa-blue. So we need to do this in Lua.
I am thinking of a new resource. Map utilities or something like that. To handle LOD etc.