Get the error model paths

Hey!

I wonder if it’s any console or lua run command to get all the models I’ve at the map, and print out a table of those I miss (with path to it, so I might fix them)

Any ideas?
(This might also need to include static props)

Thanks for helping!

[lua]
concommand.Add(“print_error_models”,function()

for k,v in pairs(ents.GetAll()) do

    local mdl = v:GetModel()
    if mdl and !util.IsValidModel(mdl) and mdl:find("^models/") then

        print("Error model: "..mdl)
    end
end

end)
[/lua]

Untested.

Not working completly



[@lua\autorun\print_errors.lua:6] bad argument #1 to 'IsValidModel' (string expected, got nil)


Changed the code slightly, try it now.

Works now, but I get a output like:



(...)
Error model: *262
Error model: *263
Error model: *264
Error model: sprites/glow01.spr
Error model: sprites/glow01.spr
Error model: sprites/glow01.spr
Error model: sprites/glow01.spr
Error model: sprites/glow01.spr
Error model: sprites/glow01.spr
Error model: *265
Error model: *266
Error model: *267
Error model: *268
Error model: *269
Error model: *270
(...)


I need more specified paths of those errors

Changed code again, now it filters out everything that doesn’t start with “models/”

Now it doesnt print anything at all…
Since that old script that showed those *### didn’t had any “/models” in it.
So would be useless maybe to filter it.

Well *### are brush models so you wouldn’t want those anyways.
Guess my attempt failed then, sorry:frown:

Damn :frowning: Let’s hope somone else knows how to solve this ^^

[editline]05:22PM[/editline]

Okey, I’ve done some wiki checkings and so on. And I edited the code.

[lua]
concommand.Add(“print_error_models”,function()
for k,v in pairs(ents.FindByClass(“prop_*”)) do

	local mdl = v:GetModel() 
	
	if not util.IsValidProp(mdl) then
		print("Error model: ".. mdl)
	end
end  

end)
[/lua]

It doesnt print static models though. As I have noticed. So if someone knows how to print it.
Please say how!

[editline]05:38PM[/editline]

It doesn’t need to be exactly LUA to get the static models. Can be something else too