Dzsozi (h03) Posted March 19, 2017 Share Posted March 19, 2017 Hello! I have a few models modded on my server that I can use with mapping, for example wall models. The problem is that they are modded on land masses, like a road from SF and such, but I would like to use their LODs, so they would be visible from a distance, the only problem is that their low LOD elements are the default GTA SA models, so a wall object has a road LOD element. I would like to change the low LOD elements of these walls to the modded object, so a wall would have a wall LOD. Here's what I came up with, but for some reason it doesn't work, the low LOD elements are the same GTA SA LODs. Does anyone know if it is possibble or know how to fix it, maybe I did something wrong in the script? I can't manage to do that by myself and I don't see any errors in the script or in the debugscript either. I would appreciate if somebody could help me with this. function fixWallModelLODs() for index, mod in pairs(mods) do if string.find(mod.fileName, "/walls/") then for k, v in pairs(getElementsByType("object")) do if getElementModel(v) == mod.modelID then setLowLODElement(v, v) end end end end end addEventHandler("onClientResourceStart",resourceRoot, function () fixWallModelLODs() end) Thank you in advance! Link to comment
NeXuS™ Posted March 19, 2017 Share Posted March 19, 2017 Does the setLowLODElement function get called? Link to comment
Dzsozi (h03) Posted March 19, 2017 Author Share Posted March 19, 2017 I checked it this way and it says false, but I don't know why. function fixWallModelLODs() for index, mod in pairs(mods) do if string.find(mod.fileName, "/walls/") then for k, v in ipairs(getElementsByType("object")) do if getElementModel(v) == mod.modelID then return outputChatBox(tostring(setLowLODElement(v, v))) end end end end end Link to comment
NeXuS™ Posted March 19, 2017 Share Posted March 19, 2017 Maybe try creating a new object with the same ID at the exact same position and set that object to the LowLODElement? Link to comment
Dzsozi (h03) Posted March 19, 2017 Author Share Posted March 19, 2017 (edited) I was thinking about that too, but I think there would be too much objects then. EDIT: And also, when using the useLODs setting in the maps' meta file, it won't change, the default SA model will still be visible as a LOD (I guess). Edited March 19, 2017 by Dzsozi Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now