• Entities Npcs? Why aint ENT:Initialize() commands working anymore...?
    9 replies, posted
Hey, I was just about to make a npc shop then I found out that I couldn't use [code] self:SetHullSizeNormal() self.Entity:SetNPCState(NPC_STATE_SCRIPT) self.Entity:CapabilitiesAdd(CAP_ANIMATEDFACE, CAP_TURN_HEAD) self.Entity:SetHullType(HULL_HUMAN) [/code] 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 :) [editline]4th March 2013[/editline] I would like to keep it as a entity. Im making a shop. :)
[QUOTE=Errolight;39792336]What is a SNPC? And how do i exactly do it? And, thanks :) [editline]4th March 2013[/editline] I would like to keep it as a entity. Im making a shop. :)[/QUOTE] SNPC = Scripted Non Player Character. Also, it's only self.Entity if the ent uses a code such as: [CODE]local pos = somethingtodowith.HitPos local ent = yourentity ent:SetPos( pos ) ent:Spawn()[/CODE] It's best just to use an SNPC base, it doesn't mean it won't spawn within the shop.
[QUOTE=Angry pepper;39794937]SNPC = Scripted Non Player Character. Also, it's only self.Entity if the ent uses a code such as: [CODE]local pos = somethingtodowith.HitPos local ent = yourentity ent:SetPos( pos ) ent:Spawn()[/CODE] It's best just to use an SNPC base, it doesn't mean it won't spawn within the shop.[/QUOTE] 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..
[QUOTE=Errolight;39798011]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..[/QUOTE] Just saying what an SNPC is, and besides, you can use the majority of normal entity values on an SNPC.
[QUOTE=Angry pepper;39801075]Just saying what an SNPC is, and besides, you can use the majority of normal entity values on an SNPC.[/QUOTE] But how would I do that?
[QUOTE=Errolight;39805327]But how would I do that?[/QUOTE] 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"
Sorry, you need to Log In to post a reply to this thread.