addon issues (surfaceproperties, mdlcache, particles, lua autorun etc.)

I have a variety of issues with my latest addons, that I need some help with. I have no idea what to do about them!

Firstly, here is the error log I get, from the console. It should help

The first big issue is with the autorun lua, included in a content pack the addon is reliant on. Here is the current file:


game.AddParticles("particles/KizzycocoaParticles.pcf")
game.AddParticles("particles/SBaHJParticles.pcf")

sound.Add( {
	name = "MCWood.Steps",
	channel = CHAN_BODY,
	volume = 1.0,
	level = 80,
	pitch = 100,
	sound = {"player/footsteps/wood1.wav",
		"player/footsteps/wood1.wav",
		"player/footsteps/wood1.wav",
		"player/footsteps/wood3.wav"}
} )
sound.Add( {
	name = "MCCloth.Steps",
	channel = CHAN_BODY,
	volume = 1.0,
	level = 80,
	pitch = 100,
	sound = {"player/footsteps/wood1.wav",
		"player/footsteps/wood1.wav",
		"player/footsteps/wood1.wav",
		"player/footsteps/wood3.wav"}
} )
sound.Add( {
	name = "MCGlass.Steps",
	channel = CHAN_BODY,
	volume = 1.0,
	level = 80,
	pitch = 100,
	sound = {"player/footsteps/wood1.wav",
		"player/footsteps/wood1.wav",
		"player/footsteps/wood1.wav",
		"player/footsteps/wood3.wav"}
} )
sound.Add( {
	name = "MCStone.Steps",
	channel = CHAN_BODY,
	volume = 1.0,
	level = 80,
	pitch = 100,
	sound = {"player/footsteps/wood1.wav",
		"player/footsteps/wood1.wav",
		"player/footsteps/wood1.wav",
		"player/footsteps/wood3.wav"}
} )
physenv.AddSurfaceData([[
"banskitball"
{
	"base" "rubber"
	"elasticity" "1000"
	"dampening" "0.1"
	"friction" "0.1"
	"density" "10000"
}

"mc_cake"
{
	"base" "carpet"
	"stepleft"	"MCWool.Steps"
	"stepright"	"MCWool.Steps"
	"scraperough" ""
	"scrapesmooth" ""
	"impacthard" "MCWool.Steps"
	"impactsoft" "MCWool.Steps"
}
"mc_cake.small"
{
	"base" "mc_cake"
}
"mc_cake.medium"
{
	"base" "mc_cake"
}

"mc_wood"
{
	"base" "wood"
	"stepleft"	"MCWood.Steps"
	"stepright"	"MCwood.Steps"
	"scraperough" ""
	"scrapesmooth" ""
	"impacthard" "MCWood.Steps"
	"impactsoft" "MCWood.Steps"
}

"mc_stone"
{
	"base" "concrete"
	"stepleft"	"MCStone.Steps"
	"stepright"	"MCStone.Steps"
	"scraperough" ""
	"scrapesmooth" ""
	"impacthard" "MCStone.Steps"
	"impactsoft" "MCStone.Steps"
}

"mc_glass"
{
	"base" "glass"
	"stepleft"	"MCGlass.Steps"
	"stepright"	"MCGlass.Steps"
	"scraperough" ""
	"scrapesmooth" ""
	"impacthard" "MCGlass.Steps"
	"impactsoft" "MCGlass.Steps"
}

"mc_wool"
{
	"base" "carpet"
	"stepleft"	"MCWool.Steps"
	"stepright"	"MCWool.Steps"
	"scraperough" ""
	"scrapesmooth" ""
	"impacthard" "MCWool.Steps"
	"impactsoft" "MCWool.Steps"
}
]])

The problem with it, is that it causes particle and surface errors in Gmod.

It does not apply the surface data at all. None are loaded up.
It also says it has errors precaching all of the particles (even they display fine in-maop).

Aside from the autorun lua not working correctly, it has various other, smaller issues, that mostly just spam up the console.

The second issue is all the MDLCache issues. the models work, but these messages persist.
There is a “lua jit” that is disabled. what is this? do I need to re-enable it?
the NAV file says it’s wrong. I made it by typing nav_generate in Gmod, and attaching that to the addon.
and finally, the message “Map file wasn’t found, copying it from addon…”. I think this is also an issue. what does it mean?

There is one final question, about auto-downloading workshop addons. My latest addon is reliant on 5 addon packs (it would have been 2, if the upload tools actually worked properly. I had to upload them in under 150mb each). I’ve tried to fix this by setting up some auto-download code in a lua script inside of each individual maop addon (not inside the content packs). it seems to work for multiplayer, but not for singleplayer. is there any way to fix this?
Here is the code:


resource.AddWorkshop( "425546102" )
resource.AddWorkshop( "425556700" )
resource.AddWorkshop( "425558261" )
resource.AddWorkshop( "425565448" )
resource.AddWorkshop( "425579876" )

Thanks in advance for any and all replies!

You can ignore the particle ‘error’ messages in your console.
physenv.AddSurfaceData is bugged and can only be called ONCE per session. ( See bug reprt: https://github.com/Facepunch/garrysmod-issues/issues/1821 )

You can pretty much ignore the ‘MDLCache’ error messages as well, they are caused by loading models compiled with different models compilers ( Different from GMods )

You can ignore the Lua JIT message too, it is shown to everybody.

Nav file message can be pretty much ignored unless you want to make NextBots ( New NPCs ) be able to walk around your map. It will take much more than entering a single console command if you want to this properly. https://developer.valvesoftware.com/wiki/Navigation_Meshes

This means the map doesn’t exist in maps/ folder and will be instead loaded from a (workshop) addon. Nothing to worry about.



[(GM) SBaHJ: THE MAOP 2: THE SEQEUL] lua/autorun/autorun.lua:1: attempt to call field 'AddWorkshop' (a nil value)
  1. unknown - lua/autorun/autorun.lua:1

Two things about this:

  1. Name your filename something unique, so it doesn’t get overridden by other addons ( themaop2thesequel.lua is good for example )
  2. If the only thing the file contains is resource.AddWorkshop(), put the file into autorun/server/(whatever.lua) instead.

Well, I’m actually making it on request of a user who did this for my last addon. I’ll look at that page, and try to puzzle it out. Still, what is causing the error? is it simply that the nav file is wrong at some part? and if so, how would I locate where?

Ah, yes. I heard about that when trying to sort this out. Thing is, I’ve tuned out all addons except for my own, so it should be working. I’m not sure why it isn’t when it’s the only mod being loaded into the game.

Even so, when will this be fixed? I see the issue was submitted at the start of march, and we’re nearing the end of April. Is this fix coming soon?
On a side note, ambient_generics also got broken at some point. I’ve worked around them (had to move the entire maop 2048 units away from 0.0.0, as a hotfix), but do you know if the fix for them is on it’s way as well?

Ah, the other autorun. I completely forgot about it! I’ll sort that out now.

also, I’m not sure it is just for server auto-downloading or not. I had wanted it to make the client auto-download the files. it seems there’s no way. Is there a clientside equivalent of this command I’m missing?

Answering these together. is there not a way to fix them, though? I worry that users will complain about my addon if I leave them to error like this. That is a very noticable error to shrug off, and it triggers the error notification on the top left of the screen. The previous addons I’ve had with custom particles and models worked fine, so I’m unsure what has happened between then and now.

The error means that your nav file is either: corrupted or doesn’t exist.

I can’t tell you when it will be fixed.

ambient_generics are already fixed in the next update.

resource.AddWorkshop is for servers only. If you need players to download certain addons for your mod, use this feature:

You don’t need to fix them.The only thing that triggers the “Something is creating script errors” message are script errors, i.e. your autorun.lua.

Ah, ok. Probably an issue with the nav file itself then.

Argh, I see. Bleh, that’s really frustrating. I had added some special Minecraft and Basketball materials in there, which had custom sounds and bounciness, and they aren’t working at all, even though it’s the only instance of that command.

I’ve tried that, but, well,

So really, even though it’s there, people are still having troubles x_x
I really just want to try and help make it quick and painless for people, so these kinds of issues don’t become terribly common. The item stats for current subscribers paint a grim picture of how many people download the addon without the content packs. So most people are likely having issues with the textures/models

aaah, ok! well, glad that’ll be sorted then!

Ok, so, I’ve sorted everything out that I needed to. the lua is fixed, and the other errors, I guess I’ll need to ignore.

My last issues still lie with the surface properties and auto download of these extra addons. I can’t find any solution to bypass these issues.

Is there any way whatsoever to somehow hack in the surface properties, if I can’t do it via the broken LUA?

And is there any way to get clients to auto-download addons?