Jump to content

Home

Target_counters...


darthplite

Recommended Posts

I have been trying to get a group npcs to spawn after another group dies. I am useing a target counter and so far i have given two npc a targetname deathcount and the counter a targetname deathcount and a count of 2. My three other npc i want to spawn after the first group dies have a targetname spawn and an npc_target deathcount. So did i forget to type something in?

Link to comment
Share on other sites

I'm not sure, but this is how I might do it:

 

1) Create target_counter with a "count" of 2 as you did. Give it a targetname "deathcount (which you also did)

 

2) Give the counter a key "usescript" with a value of "my_spawn_script" (or whatever)

 

3) For the first 2 NPCs, give them each a key of "closetarget" with the value "deathcount"

 

4) Now, when the last of those two NPCs die, it will trigger the "my_spawn_script"

 

5) Fire up behaved. Within your "my_spawn_script" just write the following :

 

use spawn

 

("spawn" being the targetname you chose for your 3 new NPCs you want to have appear)

 

Hope that makes sense.

 

-clu

Link to comment
Share on other sites

Put it in the 'scripts' directory in the base folder, maybe in a subdirectory called 'myscripts' or whatever.

 

So, if you have a script called "my_spawn_script.IBI" that lives in "GameData\base\scripts\myscripts" you refer to it in Radiant like the following:

 

key: Usescript

value: myscripts/my_spawn_script

 

Note the (1) direction of the slash, (2) the abscence of any reference to the "scripts" directory itself and also (3) the fact that you don't need the "IBI" extension. Any one of these might be why it isn't finding your script.

 

Hope this helps.

 

-clu

Link to comment
Share on other sites

You don't actually need any scripts. Just target the dying NPCs to the counter with, uh, closetarget (I use myself the NPC_target key). Then target the counter straight (with the count number you have) to the guys to be spawned , the old fashioned target - targetname way. The new guys need nothing but targetname "wearethebadguys" and the counter the corresponding target "wearethebadguys"

Link to comment
Share on other sites

Ok i got two more brain busters for you. :)

 

1.I need to know how you would get one door to stay closed till you kill a group of npcs.

 

2.I have been trying to do scripting with gtk radiant and have had no luck because i am missing the the gamesource folder and whenever i download jk2 radiant it screws up gtk radiant.So is there somewhere i can download just the gamesource folder?

Link to comment
Share on other sites

1) Aha! Here is where my "kill-the-last-npc-to-fire-a-target-scriptrunner" complicated thing comes into play (actually, I bet lassev will have an easier solution).

 

Anyway, I would have your last NPC trigger a script as I stated in earlier post, then have the script "enable" the door.

 

If you have trouble with opening a door through script, make your door a func_static instead and open it with the "move" command.

 

2) I think you can just download the "tools" from Raven's website, right? They should have the gamesource folder in release 1 or 2 of the JKII tools.

 

-clu

Link to comment
Share on other sites

2) I think you can just download the "tools" from Raven's website, right? They should have the gamesource folder in release 1 or 2 of the JKII tools.

Yeah, but you must also remember that the paths in BehavEd are not right, when you install it. You must go to setting/paths (or what ever) and correct them to point to the right directory. Only after that BehavEd will work as intended.

 

1.I need to know how you would get one door to stay closed till you kill a group of npcs.

If you mean literally stay closed, you can make the door toggled. Then just target the counter to the door. When the counter launches, it will toggle the door to open position. Otherwise you can use for example the locked parameter. It should keep the door nonfunctional as long as the door is used by something (I think it won't cancel the autotriggers, but I'm not sure, however). I don't remember if door entity has inactive parameter, but it along with a target_activate could be your third option.

 

I wouldn't personally go for clu's func_static. Although you could mess with scripts that way, it is still unnecessarily complicated.

Link to comment
Share on other sites

I would definitely go with Lassev's solution first (much simpler), but if you eventually need to do a script, you can create one by:

 

1) Creating a trigger (just drag a box and texture it with system/trigger, then right click and make a trigger_once, bring up the entities window and make it player only

 

2) Create a target_scriptrunner with a key of "Usescript" and a value of "scriptys/myscript"

 

3) Deselect everything. Select the trigger, then the scriptrunner and hit "ctrl k"

 

-clu

Link to comment
Share on other sites

1) Create and compile a script like this (use whatever values you want:

 

affect ( "kyle", FLUSH )

{

set ( "SET_NO_ACROBATICS", "true" );

set ( "SET_FORCE_JUMP_LEVEL", "0" );

set ( "SET_FORCE_PUSH_LEVEL", "0" );

set ( "SET_FORCE_PULL_LEVEL", "0" );

set ( "SET_FORCE_SPEED_LEVEL", "0" );

set ( "SET_FORCE_HEAL_LEVEL", "0" );

set ( "SET_FORCE_GRIP_LEVEL", "0" );

set ( "SET_FORCE_MINDTRICK_LEVEL", "0" );

set ( "SET_FORCE_LIGHTNING_LEVEL", "0" );

set ( "SET_SABER_DEFENSE", "3" );

set ( "SET_SABER_OFFENSE", "3" );

set ( "SET_SABER_THROW", "0" );

}

 

2) Create a target_scriptrunner with a "Usescript" key that uses this script

 

3) Select info_player_start, THEN the scriptrunner and hit "ctrl k" (important that you dselect in that exact order to target your info_player start AT the scriptrunner)

 

4) Starting the level will execute the script

 

-clu

Link to comment
Share on other sites

That should work. Look at your info_player_start and scriptrunner. Remember the red line with the arrow has to point towards your scriptrunner (from the info_player_start

 

Did you compile your script? (stupid question) Make sure you have the force.ibi file in there (not just force.txt)

Link to comment
Share on other sites

If you have this kind of fundamental problems with scripts, you could just go forward and open kejim_post map Raven gave out as reference. Look how scripts and scriptrunners are used in that map. All the scripts are also available in your tools/SP_scripts/kejim_post folder.

Link to comment
Share on other sites

Agreed. By going through Kejim_Post and the scripts provided by Raven, you'll really get a good handle on how they work.

 

Unfortunately it's tough to tell what's going wrong with your particular case without just guessing. Keep plugging away and you'll probably find some small error in the way you're setting it up.

 

-clu

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...