Jump to content

Problem setting low LODs


Recommended Posts

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

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

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...