Snpcs

Those are npcs that use valve’s npcs as a base, this is like the stool model manipulator do but with codding. Each npc have a single AI,texture and weapon, Then if you are a lua codder with this base you can make any kind of snpc using the existings npcs. This is still beta, there is no garantee that all snpcs will work perfectly and also I will not be able to improve they if i don’t recibe any help. I will take full credit for this and i need to say thanks to Xystus234 to help me with the snpc issue. You must have Counter Strike Source, Half Life 2, Half Life episode 1 and Half Life episode 2 or you will see errors. Install in your addons folder in your garrysmod directory

http://www.garrysmod.org/img/?t=dll&id=56352

http://s3.garrysmod.org/img/dl/56352_1.jpg

List of ents
This is the list of snpcs that you can found in this file, It mean what npc base use each single snpc. You can modify the init.lua of each snpc to make you own snpcs with your own weapon, model, etc. All explation is in the code, then i reserved for myself any aditional explanation.(If you want to add npcs i recommended use the stool model manipulator in order to know the model .mdl [http://www.garrysmod.org/downloads/?a=view&id=13643])

npc_cscanner-> sent_advisor
npc_cscanner -> sent_shieldscanner
npc_citizen -> sent_hostage
npc_manhack -> sent_baby
npc_manhack -> sent_crow
npc_combine_s -> sent_traitor
npc_zombine -> sent_zombine
npc_combinegunship -> sent_gunship
npc_hunter -> sent_hunter
npc_fisherman -> sent_fisherman
npc_antlion_grub -> sent_grub
npc_antlion -> sent_worker
npc_antlionguard -> sent_guard
npc_hunter -> sent_ministrider
npc_combinedropship -> sent_advisorpod
npc_cscanner -> sent_mortarsynth
combine_mine -> sent_bomb
npc_vortigaunt -> sent_doctor
npc_strider -> sent_strider
npc_alyx -> sent_alyx
npc_stalker -> sent_synth
npc_barney -> sent_magnusson

Instructions:

  1. During any gamemode write in console for example sent_traitor to spawn a npc traitor.
  2. You can customize the model of the sent, just go ahead and change the model in init.lua, For example models/alyx_ep2.mdl

http://img141.imageshack.us/img141/4540/snpcsbl7.jpg

The evil baby interests me. Anyway really cool snpc’s as simple as it is. Here’s a lua king for the hell of it :smiley:

Edit:

LOL Wait Download?

At the top now.

K thanks.

Edit:

You guys have to be kidding me. 100 views and 3 replies? Come on! These are actually fun to play around with. Especially death crow. Could I make a video for you :smiley:

personally I’m going to try the synths should be interesting

Bug: When i undo a dead snpc, i get an error. And the snpc dead body don’t vanish.

Example: when i try to undo a killed a strider, this error pops up!
[lua]
entities/sent_strider/init.lua:27: Tried to use a NULL entity![/lua]
Also, when i kill a baby, his/her body stays upon the air!

Edit:
when i spawn a slave, this error pops up.
[lua]
entities/sent_slave/init.lua:26: attempt to index global ‘sself’ (a nil value)[/lua]
I think i know why…
[lua]
sself.ent:SetModel(“models/vortigaunt_slave.mdl”)[/lua]

Bug no you mean just an msg in screen, Any solution?

Too fix the second error, replace line… Wait, look:
[lua]AddCSLuaFile( “cl_init.lua” ) // Make sure clientside
AddCSLuaFile( “shared.lua” ) // and shared scripts are sent.
include(‘shared.lua’)

function ENT:SpawnFunction( ply, tr )

if ( !tr.Hit ) then return end

local SpawnPos = tr.HitPos + tr.HitNormal * 30
local ent = ents.Create( "sent_slave" ) 
ent:SetPos( SpawnPos )
ent:Spawn()
return ent

end

function ENT:Initialize()
self.Entity:SetModel(“models/blackout.mdl”)
self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
//self.Entity:SetSolid( SOLID_VPHYSICS )
self.ent = ents.Create( “npc_vortigaunt” )
//self.ent:SetKeyValue(“citizentype”,“4”)
self.ent:SetModel(“models/vortigaunt_slave.mdl”)
self.ent:SetPos( self:GetPos() )
self.ent:SetAngles( self:GetAngles() )
self.ent:Spawn()
sself.ent:SetModel(“models/vortigaunt_slave.mdl”)
//undo.ReplaceEntity(self,ent)
//cleanup.ReplaceEntity(self,ent)
//self:Remove()
end

function ENT:OnRemove()
self.ent:Remove()
end[/lua]
TWO “self.ent:SetModel(“models/vortigaunt_slave.mdl”)”?
and one of them has sself, instead of self… Thus, the error.
Isn’t it easier just to remove line 26?
Edit:
I have just noticed that the vortigaunt doctor has the same error.

Ok, and i mean also for the baby

No idea, but i think this happens when a model don’t have a physics, but “models/props_c17/doll01.mdl” does have a physics so… But! It has another model!
[lua]
self.Entity:SetModel(“models/blackout.mdl”)[/lua] Maybe it’s that that’s messes things up.
Edit:
i have just noticed that every snpc have that model. Strange… Can you explain why?

Is the model of the Entity without this all snpcs will not work properly. Maybe somebody knows how to fix the msg in screen when you kill one snpcs and try to undo it.

This is the init.lua to fix for the sent_slave, the code is similar to another snpcs :

[lua]
AddCSLuaFile( “cl_init.lua” ) // Make sure clientside
AddCSLuaFile( “shared.lua” ) // and shared scripts are sent.
include(‘shared.lua’)

function ENT:SpawnFunction( ply, tr )

if ( !tr.Hit ) then return end

local SpawnPos = tr.HitPos + tr.HitNormal * 30
local ent = ents.Create( "sent_slave" ) -- name of the folder
ent:SetPos( SpawnPos )
ent:Spawn()
return ent

end

function ENT:Initialize()
self.Entity:SetModel(“models/blackout.mdl”)
self.ent = ents.Create( “npc_vortigaunt” ) – this a npc which use a vortigaunt npc as a base
self.ent:SetModel(“models/vortigaunt_slave.mdl”) – the is the model when you spawn the npc
self.ent:SetPos( self:GetPos() )
self.ent:SetAngles( self:GetAngles() )
self.ent:Spawn()
self.ent:SetModel(“models/vortigaunt_slave.mdl”) – the is the model of the npc ragdoll
end

function ENT:OnRemove()
self.ent:Remove()
end
[/lua]

Thank you. Now you should somehow fix the undo bug.

I ask here for somebody that can fix it. If somebody do he can take credit.

I think to solve the problem in the sent_baby is to replace the orginal code for this one in init.lua, but i need a solution more professional :

[lua]AddCSLuaFile( “cl_init.lua” ) // Make sure clientside
AddCSLuaFile( “shared.lua” ) // and shared scripts are sent.
include(‘shared.lua’)

function ENT:ragdoll_finder() – fuction to remove the ragdoll
for k, v in pairs( ents.FindByClass( “prop_*” ) ) do
v:Remove()
end
end

function ENT:SpawnFunction( ply, tr )

if ( !tr.Hit ) then return end

local SpawnPos = tr.HitPos + tr.HitNormal * 30
local ent = ents.Create( "sent_baby" ) -- name of the folder
ent:SetPos( SpawnPos )
ent:Spawn()
return ent

end

function ENT:Initialize()
self.Entity:SetModel(“models/blackout.mdl”)
self.ent = ents.Create( “npc_manhack” ) – this a npc which use the manhack npc as a base
self.ent:SetPos( self:GetPos() )
self.ent:SetAngles( self:GetAngles() )
self.ent:Spawn()
self.ent:SetModel(“models/props_c17/doll01.mdl”) – the is the model of the npc ragdoll
ragdoll_finder() – remove the ragdoll
end

function ENT:OnRemove()
self.ent:Remove()
ragdoll_finder() – remove the ragdoll
end[/lua]

Edit:

I make a new update with the fixes
About the corpses should be desactivated the option “keep corpses”.

It’s not really a SENT that your fighting, it’s a SENT that spawns a HL2 enemy with a diffrent model. That’s why there’s an error with the SENTS being removed, I screwed up with coding it.

Is good to use with gamemodes, For example install this and during any gamemode in your server write in console sent_traitor to spawn a npc traitor (List of sent in the first post). People when spawn sent from the console don’t undo it, then should be fine.

More pics:

http://img114.imageshack.us/img114/6480/gmconstruct0040kd0.jpg

http://img505.imageshack.us/img505/8654/gmconstruct0008wn9.jpg

http://img223.imageshack.us/img223/1917/gmconstruct0047wg5.jpg

http://img99.imageshack.us/img99/6673/gmconstruct0054eq5.jpg

Sweet nice job!

:confused: Not to sound like flaming but, it’s basically old NPCs with others models, right? (crow / flying babies are manhack, synth are stalkers with different models and odessa is well… Just a rebel with a different model…)

also do the advisor / advisor pod REALLY do something or they just stand there making animations?

Not old npcs, just normal and new npcs with others models and weapons. The new worth is in the past you only have the chance to use npc_citizen or npc_combine_s for your models, and now you can use any kind of npcs with any kind of animation for example npc_fastzombie,npc_alyx,npc_metropolice with a custom model that you made, then is usellfull for people who make models and also for gamemodes to use those snpcs during current games.

Have a look here all the npcs that you can use as a base :

The advisor pod don’t have movement because the npc base don’t have fight animations.

I like the idea but when I saw it I was expecting to see the npc’s rewritten in lua. I also thought it was odd that you didn’t just use the normal models, but no big deal figuring out whats what. Also if someone uses an npc as a base how easy is it to change its behavior?

Sorry but is not possible to change anything else that isn’t the model or the weapon. So a moderator see this plz change the title of the thread which could be “Sent npcs”. The currently title just confuse people because are not really snpcs.