JavaGuy Posted September 12, 2002 Share Posted September 12, 2002 Thanks again for everyone's help. I've hit another problem. The script looks like this: //Generated by BehavEd rem ( "Script to make stormtroopers run toward rocks" ); affect ( "stormtroopergroup1", /*@AFFECT_TYPE*/ FLUSH ) { set ( "SET_BEHAVIORSTATE", "BS_DEFAULT" ); set ( "SET_WALKING", "true" ); set ( "SET_NAVGOAL", "nav1" ); } I have the stormtroopers' NPC_targetname set to "stormtroopergroup1", but when the script runs they don't do anything. Another question--is there a way in ICARUS simply to make an NPC notice the presence of the player? And another--is there a way to fire targets/triggers from ICARUS? And one more--how does one make Kyle walk around and do stuff when camera mode is enabled? According to the ICARUS manual, all the cool SET_ commands to do that stuff are NPC-only, yet in the SP game there are plenty of cut-scenes where he does stuff. Thanks! Sam Link to comment Share on other sites More sharing options...
duncan_2001 Posted September 12, 2002 Share Posted September 12, 2002 I think you should have a look at these tutorials: www.geocities.com/rellenbroek/main_realscripts.html I know the answers to your last two questions. To fire a target/trigger you need the use command- USE(targetname). To make the player visible in cutscenes you need to make a new NPC to act as the player that is invisible the rest of the time (sounds confusing but it's explained in the tutorial). Not certain about your other questions but: I'm not sure if you can give the same NPC_targetname to multiple NPCs. I think an NPC will notice the player if it's in its field of vision. Link to comment Share on other sites More sharing options...
Bell Posted September 13, 2002 Share Posted September 13, 2002 put the navgoal part in a task command, here's a simple one i did that worked //Generated by BehavEd rem ( "cinkyle1" ); set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_NONE" ); set ( /*@SET_TYPES*/ "SET_WALKING", /*@BOOL_TYPES*/ "true" ); wait ( 13000.000 ); task ( "kylego" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "cinkyle1nav1" ); } dowait ( "kylego" ); if an npc doesn't automatically notice a player you can script them to look at them, if you are talking about when they notice the enemy you can make a spawnscript for them with a line that increases their field of view. Link to comment Share on other sites More sharing options...
JavaGuy Posted September 13, 2002 Author Share Posted September 13, 2002 Still doesn't work. Here's what my script looks like now: //Generated by BehavEd rem ( "Script to make stormtroopers run toward rocks" ); affect ( "stormtrooper1", /*@AFFECT_TYPE*/ FLUSH ) { task ( "gonav1" ) { set ( "SET_NAVGOAL", "nav1" ); } dowait ( "gonav1" ); } I removed all but one of the NPCs, and his NPC_targetname is "stormtrooper1", so there should be no conflicts there, if that was the problem. (Does anyone know for sure whether it's permissible to have multiple NPCs with the same NPC_targetname? It seems to me it should be.) To verify that the script was actually running, I temporarily changed it to one that gave me a disruptor rifle. Sure enough, when I walked through the trigger I got the disruptor. Then I changed it back to what it is above. When I walk through the trigger, the stormtrooper still just stands there (he's far enough away that he doesn't see me). I doubled-checked that the nav point is a waypoint_navgoal_4 and that its script_targetname is "nav1" as well. I don't know what else to do. Link to comment Share on other sites More sharing options...
Catscratch Posted September 13, 2002 Share Posted September 13, 2002 You shouldn't be using script_targetname for navgoal. targetname works well. Wht's the main thing that you want to do ? Link to comment Share on other sites More sharing options...
JavaGuy Posted September 13, 2002 Author Share Posted September 13, 2002 That was it! Thanks a million. I love this forum. For the record, this is what the ICARUS manual says: "For NPCs, their script_targetname will be the same as the NPC_targetname you specify for them in the map editor. For all other entities, you must specify a script_targetname if you intend to affect them at some point." I guess maybe it means only for an "affect" command. What I am trying to do is this: There's a bunch of stormtroopers milling about, far enough away that they don't see the player (they're close enough to shoot at him when they do see him, though). The player is sort of hiding in a bunch of rocks, and if he comes out the wrong way the troopers will come after him. I'm still tweaking the behavior states 'n' stuff, but at least now the script is working. Thanks again to everyone for your help. Sam Link to comment Share on other sites More sharing options...
Catscratch Posted September 13, 2002 Share Posted September 13, 2002 Well. Give the same npc_targetname to the npcs who will attack kyle. Put a trigger_once or trigger_multiple(Put "wait","2" if you use trigger_multiple. Create a target_scriptrunner and give "Usescript", "attack". Target the target_scriptrunner from the trigger_once/multiple. Open behaveD. put an Affect. Set the npc_targetname as the affect's target. Put a set command with set_enemy variable and "kyle" as its target. Also put a set command with set_aggression with value of "5". Save it as attack.txt then compile. hoops. When your player triggers the entity which in the wrong way, the npcs should be all over him. If you play the first ladder, the author used the same way as the spawnscript of the npcs which will make the npcs attack you immediately when they spawn. Link to comment Share on other sites More sharing options...
JavaGuy Posted September 13, 2002 Author Share Posted September 13, 2002 That sort of works, except that the NPCs don't give chase. They just stand in place and shoot at me. I tried setting SET_CHASE_ENEMIES to true, but that didn't seem to make a difference. So basically I did what you recommended but also put in some navgoal commands. I'm still experimenting and tweaking, but I'm pretty happy with how it's working so far. Thanks again! Link to comment Share on other sites More sharing options...
Catscratch Posted September 14, 2002 Share Posted September 14, 2002 Did you try putting a point_combat with investigate option checked near the trigger ? Investigate makes npcs to go to the spot if they hear a sound. Any other solution would be setting the npcs range shorter. They just fire at ya because they have rifles. If a reborn gets the set_enemy and set _aggression command then it chases the enemy because a reborn is a melee fighter. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.