Entities Npcs? Why aint ENT:Initialize() commands working anymore...?

Hey, I was just about to make a npc shop then I found out that I couldn’t use



self:SetHullSizeNormal()
self.Entity:SetNPCState(NPC_STATE_SCRIPT)
self.Entity:CapabilitiesAdd(CAP_ANIMATEDFACE, CAP_TURN_HEAD)
self.Entity:SetHullType(HULL_HUMAN)


ect.

This happend after the update… Anyone know if they was remade? Or is there another way to use these?

Why not make it an SNPC instead ?
Also, you do realise that ‘self.Entity’ is same as ‘self’

What is a SNPC? And how do i exactly do it?

And, thanks :slight_smile:

[editline]4th March 2013[/editline]

I would like to keep it as a entity. Im making a shop. :slight_smile:

SNPC = Scripted Non Player Character.
Also, it’s only self.Entity if the ent uses a code such as:


local pos = somethingtodowith.HitPos
local ent = yourentity
ent:SetPos( pos )
ent:Spawn()

It’s best just to use an SNPC base, it doesn’t mean it won’t spawn within the shop.

What the heck are you talking about? That wasn’t what i said… I asked how to use SNPC / Make them spawn with a entity value. / spawn as a entity…

Just saying what an SNPC is, and besides, you can use the majority of normal entity values on an SNPC.

But how would I do that?

self.Entity:(Whatever command you want here) except, without .Entity… just self:

Yes… But, I was actaully asking how to make it spawn SNPC in stead of the model…

not complete sure what you are asking for, but go to garrysmod/gamemodes/base/entities/base_ai to get an idea of the meta functions/flags, etc associated with snpc scripting. you would end up creating a directory inside an entities folder, example: garrysmod/addons/myaddon/lua/entities/my_snpc/. It is likely you will want an init.lua, cl_init.lua, and a shared.lua. You can do something like download a snpc on gmod.org to get an idea of how to template, because to my knowledge there is no publicly available “skeleton”