darthplite Posted June 17, 2003 Share Posted June 17, 2003 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 More sharing options...
clu Posted June 17, 2003 Share Posted June 17, 2003 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 More sharing options...
darthplite Posted June 17, 2003 Author Share Posted June 17, 2003 Every time i make a script it wont find it and i will get an error at the top left part of the screen in red. So am i putting it in the wrong place?Where would you put it? Link to comment Share on other sites More sharing options...
clu Posted June 17, 2003 Share Posted June 17, 2003 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 More sharing options...
lassev Posted June 17, 2003 Share Posted June 17, 2003 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 More sharing options...
clu Posted June 17, 2003 Share Posted June 17, 2003 But wouldn't it just be more fun to complicate things with an unnecessary script as I suggested? Nice one, lassev. -clu Link to comment Share on other sites More sharing options...
lassev Posted June 17, 2003 Share Posted June 17, 2003 Oh, yeah, sorry. I totally forgot our little conspiracy to promote scripting in all possible cases. I'll try to keep that in mind later on. This lapse won't happen again Link to comment Share on other sites More sharing options...
darthplite Posted June 19, 2003 Author Share Posted June 19, 2003 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 More sharing options...
clu Posted June 19, 2003 Share Posted June 19, 2003 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 More sharing options...
lassev Posted June 20, 2003 Share Posted June 20, 2003 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 More sharing options...
clu Posted June 20, 2003 Share Posted June 20, 2003 I think I am in love with scripting. I need professional help. Link to comment Share on other sites More sharing options...
darthplite Posted June 20, 2003 Author Share Posted June 20, 2003 I would like to try a script but they are just not working! Would i type the key into the info_player_start or into a script runner? Link to comment Share on other sites More sharing options...
clu Posted June 20, 2003 Share Posted June 20, 2003 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 More sharing options...
clu Posted June 20, 2003 Share Posted June 20, 2003 Or if you want the script to run when the level starts, forget the trigger, and just target your "info_player_start" at the scriptrunner. -clu Link to comment Share on other sites More sharing options...
darthplite Posted June 21, 2003 Author Share Posted June 21, 2003 Alright this is driveing me crazy!I Have been trying to change the force powers you have in the game but it won't work!!! :swear:Clu could you Tell me step by step how to change the force powers? Link to comment Share on other sites More sharing options...
clu Posted June 21, 2003 Share Posted June 21, 2003 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 More sharing options...
darthplite Posted June 21, 2003 Author Share Posted June 21, 2003 Did'nt work.... I save my scripts inside a folder named fl in scripts. I make the script then make a target scriptrunner then i give it a key of Usescript then a value of fl/force am i right? Link to comment Share on other sites More sharing options...
clu Posted June 21, 2003 Share Posted June 21, 2003 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 More sharing options...
darthplite Posted June 22, 2003 Author Share Posted June 22, 2003 Still did'nt work.Oh well i give up. Link to comment Share on other sites More sharing options...
lassev Posted June 22, 2003 Share Posted June 22, 2003 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 More sharing options...
clu Posted June 22, 2003 Share Posted June 22, 2003 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.