NPCs make no sense

Spawning a NPC from the ‘q’ menu with a SMG allows a Combine soldier to shoot.

Doing the same thing with lua code results in the npc NOT shooting. What Gives?



function ENT:SpawnFunction( ply, tr )

	if ( !tr.Hit ) then return end
	
	local SpawnPos = tr.HitPos + tr.HitNormal * 20
	
	local ent = ents.Create( "npc_combine_s" )
	
	ent:SetPos( SpawnPos )
	ent:Give("weapon_smg1")
	ent:Spawn()
	ent:Activate()
	
	return ent
	
end

Wouldn’t it require a schedule?

Like a schedule to attack?

It shouldn’t because the spawn menu doesn’t give it a schedule.

SNPC’s needs scheduels.

If anyone knows where the default sent’s are located, please look in them and see if they have sched’s, because I have a hunch they do…

Do you mean the default HL2 entities?

… I’m confused. I thought it was about NPC’s.

I assume he meant SNPCs, because they are entities too.

Should have wrote SNP’s instead of SEnts, then.

Anywho, I dont know where it’s located, sorry.

the base entity is “base_ai” the only schedule it runs is SCHED_IDLE_WANDER

the ones from the NPC spawn in differently.