SNPC animation bug

I’ve been having this bug forever and I still can’t get to the bottom of it. I can spawn SNPC just fine from the menu and have them work as expected but as soon as I try to spawn them with LUA i get all sorts of crazy animation problems.

I’ve made a video here to show you what I mean.

Here is the code I use to spawn them.



	newSpawn = ents.Create(npcType)
	newSpawn:SetPos( vector )
	newSpawn:SetKeyValue ("spawnflags", "512")
	
	if(newSpawn:GetClass() == "npc_combine_s") then -- combine need weapons
		newSpawn:SetKeyValue( "additionalequipment", "weapon_ar2" )
		newSpawn:Fire("StartPatrolling", "", 5)
	elseif(newSpawn:GetClass() == "npc_citizen" || newSpawn:GetClass() == "npc_barney") then
		newSpawn:SetKeyValue("citizentype", 1)
		newSpawn:SetKeyValue( "additionalequipment", "weapon_smg1" )
		-- newSpawn:Fire("SetReadinessHigh")
		newSpawn:Fire("StartPatrolling", "", 5)
	else
		print("newSpawn:GetClass() not recongnized.")
	end
	newSpawn:Spawn()
	newSpawn:Activate()


Any help you can provide would be greatly appreciated.

Is this single player or a dedicated server? I have that same problem on my dedicated server.

I had this problem until blackops helped me out, Valve didn’t include scene files for some reason, I got them out of the GCF by following this guy’s instructions: http://forums.artofwarcentral.com/showpost.php?p=5674&postcount=2

This link was a godsend, I struggled for a month with them thinking it was my fault.

Ahh yes, that’s seems to have fixed it. Only thing though in that guys description you should read .cfg as .gcf

Yep, I wish I knew about this fix month’s ago. :frowning: