• Create NPC Template
    4 replies, posted
Hi guys, I'm trying to make Dropship functional, I made everything working, except one thing that I don't know how to make. I'm trying to flag a Combine soldier NPC entity with flag NPC Template (code: 2048), I tried this: [code] local ent = ents.Create( "npc_combine_s" ) ent:Fire( "SpawnFlags", 2048 ) [/code] and keyvalue, too. But none of them worked. Please help me about this. Thank you.
ent:SeKeyValue( "spawnflags", 2048 )
I tried this already, when Dropship lands, I'll get this error in console: [code] npc_combinedropship : Template NPC s_1_template not found! npc_combinedropship : Has no dustoff point for NPC 0! npc_combinedropship : Template NPC s_1_template not found! npc_combinedropship : Has no dustoff point for NPC 0! [/code] Here is my code: [code] local npc_template = ents.Create( "npc_combine_s" ) npc_template:SetKeyValue( "Weapon", "weapon_ar2" ) npc_template:SetKeyValue( "SquadName", "overwatch" ) npc_template:SetName( "s_" .. pid .. "_template" ) npc_template:SetKeyValue( "spawnflags", "2048" ) npc_template:Spawn()-- Won't spawn, need it for dropship! dropship:SetKeyValue( "NPCTemplate", "s_" .. pid .. "_template" ) dropship:SetKeyValue( "Dustoff", self.Targets[pid] ) [/code] I can't understand what am I doing wrong.
I think you must have a template entity, not the direct NPC entity for that. Look up some hammer tutorials for this.
I looked at TWHL, he used the same method, he created a NPC soldier and checked "Template NPC", I've used [URL="http://www.nickurko.com/source-sdk-dropships.html"]here [/URL]& [URL="http://twhl.info/tutorial.php?id=132"]here [/URL]already to create a map (and it was working), but Lua method isn't working :rolleyes: :( [editline]3rd July 2015[/editline] Guys looks like Source Engine doesn't support template NPC those created after loading maps, I tried with ent_create (in HL2 & GMod), but it didn't create a template. Donno where should I report to?
Sorry, you need to Log In to post a reply to this thread.