Hey, Im makin a single player map and i need some help. How do I get NPC's with sabers to follow a certain root. I want 2 npcs with lightsabers to spawn, then run in a certain direction then wait for you to attack them. Its a ladder level so I want it so that after you kill first 2 dudes, 2 more come out of a door in the far end of the room and run towards you, then after them, 4 more and so on and so on....I also need help with the spawning, I want it so that after you kill a certain number the next batch spawns. For example if there are 4 dudes in the room, i want the player to kill all 4 in any order to spawn the next batch, someone tried to explain this to me but i dint get it
im not a mapper but as far as i know, npcs dont have any kind of routing like bots do, there a bit more smarter than bots. they usually wait where they are placed and interact with the player depending wheather they are good or bad.
yea i know, but i want them to run in a certain way? do i need to mkae a script for that or something?
here i found this thread for you http://forums.filefront.com//showthread.php?t=110696
minilogoguy18here i found this thread for you http://forums.filefront.com//showthread.php?t=110696
That was one messy tutorial. But who knows, maybe it works (I couldn't read it through succesfully, so I wouldn't know).
- - - -
However, for the consecutive spawning you need to use target_counters. For the target_counters, you will need to organize your NPCs (waves) in a certain manner. Note that since each wave is spawned independently, it doesn't matter how you locate them physically in relation to the other waves, as only one wave exists during any period of time.
Give all the NPCs of the first wave a certain targetname (same for each of them). The first wave you have to spawn with a trigger, when the player enters the room (unless you want them to be spawned right from the beginning, in which case don't give them a targetname at all). And give them all the same NPC_target. Then create a target_counter and give it a targetname corresponding to the NPC_target you gave the first wave. Set the counters count value to reflect the numbers of NPCs in the first wave.
Now follow carefully: Create a small trigger_once, and place it somewhere the player can't go, like inside some detail brush. Target the target_counter to this trigger_once. And then target the trigger_once to the second wave.
Create the NPCs of the second wave, and give them all a targetname that you used as a target key in the trigger_once you created at the end of the first wave procedure. Then give the second wave an NPC_target key, unique, NOT the same the first wave had. Then just proceed just like with the first wave by creating the counter etc.
This way you can create as many waves as you want, each having a unique number of NPCs.
NPC_target is the target the NPC will trigger at the moment of death.
Target_counter is a capricious entity. That's why you need the otherwise useless looking trigger_once between it and whatever you want to trigger by counting. Make sure the player can't trigger the trigger_once by accidentally walking into it. You can also use flags to control this, though.
omg! i did it! thanks so much man...you are king! lol, now about the other part, is it possible to make a NPC follow certain wps once its spawned? I know oyu can do it with non-saber wielding NPC's but the NPC's im using do have sabers? any help would be great, even tho youve helped enough!
You have one basic practical problem with that: If you force the NPCs to walk to a certain location, what keeps the player from attacking and killing the NPCs while they are helplessly walking there, instead of following their inherent combat AI?
Like you said pretty much yourself, saber wielding NPCs have a strong AI. I don't know if it's possible to bypass it other than using BS_Cinematic. However, that's just one command more, so it's not impossible to test it.
What you basically need are the navgoals at the intended locations and a spawnscript for each NPC, containing the set_navgoal command to the desired location. You might also need a chain of waypoints from the spawning location to the final location. In practice, unfortunately, the nonexistent pathfinding algorithm of JA often encounters troubles as well, so you might need to mess with the system for a long time.
I'm 100% sure the basic principles of navgoaling have been covered many times over, if you search the forums. There might also be tutorials somewhere 'round the net. I have also a local copy of an excellent navgoaling tutorial, no longer online, on my HD. If you send me a PM with an email address, I might be willing to send you a zipped copy of it (~2 MB). However, free support is not included in that deal :p
yea i dont mind if someone kills the npc while its walking; heres the map: Its a rectangular room and there are 2 doors the one you came in, and the one across from you where the Saber-Droids come out. WHen you first enter there is one droid, as soon as you kill it, 2 mor droids spawn behind the door accross from you. When they spawn i want them to trigger the door and come out and run towards you, and after you kill them, 4 droids come out, i just thought it would be a cool way of spawning so they dont just appear but if it cant be done, than thats cool, thanks