View Full Version : 2 questions

07-07-2002, 09:43 PM
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)

07-08-2002, 05:19 AM
Noone interested in helping :( ?

Wes Marrakesh
07-08-2002, 05:22 AM
1) scripting
2)no clue

07-10-2002, 10:34 AM
I got q1 anwered anyone for q2?

07-10-2002, 12:15 PM
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"

07-10-2002, 08:45 PM
Thanks, very simple to understand.

07-12-2002, 06:13 AM
For q1 what script will I need exactly?

07-12-2002, 10:42 PM

07-12-2002, 11:35 PM
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.

07-13-2002, 02:27 AM
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:(

07-13-2002, 05:54 AM
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?

07-13-2002, 08:37 PM

07-13-2002, 11:45 PM
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 )

07-16-2002, 04:02 AM
Well count isn't actually a limitation as you can use -1 which is infinite.

07-18-2002, 04:37 AM
Did you try count -1 ? Does it work ?
Then its solved.

07-18-2002, 06:39 AM
I've used count -1 and had no problems.