Jump to content

Home

2 questions


dimi30

Recommended Posts

Question 1:

 

Is it possible to make it so every some seconds new NPCs are

spawned(infinite NPCs unless the player leaves an area)?

 

Question 2:

 

How do I get an NPC to get into an emplaced gun?(I know this may be a little stupid question)

Link to comment
Share on other sites

for question 2:

 

You must give the emplaced gun a targetname

key: targetname

value: gun1

 

 

You should place a ref_tag for the npc to look at when using the gun, so he doesnt turn his back to the player in the case of a first encounter

 

key: targetname

value: emplaced_aim

 

the NPC needs the following settings:

 

key: parm1

value: gun1

 

key: spawnscript

value: path to the script (read below)

 

the Script needs to consist of the following:

 

use (get(SET_PARM1));

set ( /*@SET_TYPES*/ "SET_VISRANGE", 4000 );

set ( /*@SET_TYPES*/ "SET_WATCHTARGET", "emplaced_aim" );

set ( /*@SET_TYPES*/ "SET_FIRE_WEAPON", /*@BOOL_TYPES*/ "true" );

 

 

At first the NPC will use the object that is named in the parm1-value, with other words the gun

Visrange should be selfexplaining

with SET_Watchtarget the npc (on the gun) will look at a placed ref_tag named "emplaced_aim" describing the direction the npc should watch

the last command gives you the option for a kinda peaceful npc who uses the gun but is not shooting with it in the case of "false"

Link to comment
Share on other sites

I'm sure it's been done in one of the Artimus levels in SP. You can sit and pick off stormtroopers all day long if you stay there. I'm not sure how it's done though. It probably is a set number of ST's that will respawn when killed. Makes sense to me.

Unfortunately, I'm not much more help than that. Sorry:(

Spoon_Gouge

Link to comment
Share on other sites

Originally posted by RichDiesal

As far as I know, it is not possible. You need to have a physical NPC entity in your map for each NPC that will appear.

 

There might be a way around that, but I don't know of one.

 

But I did not say I want it without a physical NPC. If its still not possible then is it at least possible that when an NPC is killed another is spawned at the same time?

Link to comment
Share on other sites

Well i figured out something. Have you ever noticed the count key for NPC's ?

 

Place a NPC.

Key : Count Value : 5

Key : targetname Value : Spawning

 

 

Place a func_timer.

Key : target Value : Spawning

Key : wait Valye : 60

and check its start_on option.

 

 

Now every 60 seconds there will be a new npc from the spawn point even if the previous npc dies or not.

 

I'm trying to use target_counter so when the npc dies it triggers the target_counter(and then triggers the npc again) and the new npc comes out.

 

Because of the count limitation, this is not the actual solution, at least it seems so for now :D

 

I found out that you dont need any other entities. Just place a NPC.

Key : targetname Value : spawn1

Key : Count Value : 15

Key : NPC_target Value : spawn1

 

Now when you kill the npc, it will call itself so 15 npcs will be spawned in a row :D (A new npc will be spawned after a npc dies )

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...