Making a NPC walk to a certain point.
Post Reply
Quote
Re: Making a NPC walk to a certain point.
Posted by David from IKG on Tue Feb 22nd at 2:20am 2005


How do I make someone walk to a certain point? Example: A combine soilder walk to the end of a room and walk around the corner and then see's me and shoots.

Thanks again. You guys are great and very helpful.





Quote
Re: Making a NPC walk to a certain point.
Posted by French Toast on Tue Feb 22nd at 2:27am 2005


info_node? I don't know I don't use NPC's [addsig]



Quote
Re: Making a NPC walk to a certain point.
Posted by whiteLegion on Tue Feb 22nd at 2:31am 2005


Hello. Their are several ways to have an NPC do what you said earlier. Try this way.

1. Place npc.

2. place a ai_goal_assault

3. place assault_rally point

4.place assault_assaultpoint

5. Have the ai_goal_assault target the rally point. And have the npc be the actor of the ai_goal_assault. Set the cue to "don't wait for cue". string the ai_goal assault to the assault_rallypoint.

6. String your assault_rally_point to your assault_ assault point(s).

7. Trigger the ai_goal_assault.

Notes: This is a simple assault. You can do so much more with these entities so experiment. Any questions PM me.

-WL
[addsig]




Quote
Re: Making a NPC walk to a certain point.
Posted by satchmo on Tue Feb 22nd at 2:32am 2005


The entity you need is path_corner. Give the Combine a name, and the put the path_corner entity (with name) to the first patrol point. If you want the Combine to patrol to several points, you can set up more than one path_corner entities.

For example, if you want him to patrol to the end of the room, put a path_corner there (name it p1), and also put a path_corner down the hallway (name it p2). Set the "next path_corner" in p1's property to p2. From the properties of the Combine, set "next patrol point" to p1. As soon as the soldier spawns, he'll start patrolling to these locations.

If you want him to patrol back and forth, then set the "next path_corner" in p2's property to "p1". If it's still confusing to you, let me know.

[addsig]




Quote
Re: Making a NPC walk to a certain point.
Posted by itisjp on Tue Feb 22nd at 2:39am 2005


http://www.gdconnect.com/Tutorials-read-209.html

This will help you out with what you want to do...





Quote
Re: Making a NPC walk to a certain point.
Posted by satchmo on Tue Feb 22nd at 2:42am 2005


I read the gdconnect tutorial, it doesn't really address his question. It just talks about info_nodes, which are not helpful if the NPC enemy cannot see the player after spawning. Path_corner would direct the NPC where to go regardless whether it can see the player (or other player ally NPC) or not. [addsig]



Quote
Re: Making a NPC walk to a certain point.
Posted by itisjp on Tue Feb 22nd at 3:08am 2005


info target might work, but if you are walking a longer path then i would try path_track and set up a series of path tracks linking one to the next one. If you create one you can go to a 2-D view select the path_track hold shift and drag to the next place you want your path to go. path_corner would work too.



Quote
Re: Making a NPC walk to a certain point.
Posted by satchmo on Tue Feb 22nd at 3:27am 2005


Really, path_track? I thought that's only for gunships and striders.

I used plenty of path_corners in my single player map sp_justice (http://www.snarkpit.com/maps.php?map=1643), and they worked beautifully.

[addsig]




Quote
Re: Making a NPC walk to a certain point.
Posted by David from IKG on Tue Feb 22nd at 10:30pm 2005


These are all great (yet complicated) answers. Thanks so much everyone.

All i want for my mod, is make it so that once i walk to a certain point, it will trigger a NPC to run to me or just run to a certain point. Which tutorial or way listed here would be best for that? I dont know which way i should choose. I think whitelegion's idea might be the one, but can someone confirm that for me first before i start mapping? Thanks once again.





Quote
Re: Making a NPC walk to a certain point.
Posted by whiteLegion on Wed Feb 23rd at 12:55am 2005


The assault path method I prescribed is the most effective. Especially if it is withen a combat context. Basically the NPC is fully combat effective but depending on which settings you use, must remain on the assault path. The way I prescribed is more complicated but is far far more versatile.

-WL

[addsig]




Quote
Re: Making a NPC walk to a certain point.
Posted by David from IKG on Wed Feb 23rd at 9:09pm 2005


its not working

is there an easier way?





Quote
Re: Making a NPC walk to a certain point.
Posted by satchmo on Wed Feb 23rd at 9:35pm 2005


I agree with whiteLegion, but the simplest way is using path_corner. It's not as versatile as assault_point, but it's as basic as you can get (and still gets the job done). [addsig]



Quote
Re: Making a NPC walk to a certain point.
Posted by David from IKG on Wed Feb 23rd at 11:31pm 2005


i forgot all about that entity. ill deff. try to use the path_corner instead. but how do i make it so that i trigger it? is it trigger_once? i doubt it....



Quote
Re: Making a NPC walk to a certain point.
Posted by whiteLegion on Thu Feb 24th at 11:02pm 2005


? posted by David from IKG

i forgot all about that entity. ill deff. try to use the path_corner instead. but how do i make it so that i trigger it? is it trigger_once? i doubt it....

Answer: If you want the event to be triggered you cannot use the path corner method. If you type a path_corner in the NPC's (ex: npc_combine_s) path_corner designation. Then the npc will atomatically move to that path_corner when the npc spawns. If you want basic movement you could use a scripted_sequence. To set this up place a scripted_sequence to where you want the npc to move to. In the scripted_sequence, target npc enter the name of the npc you want to move. enter "Run" (Or whatever you want) in the move to script variable. Now create a trigger. (Any kind you want ex:trigger_once) Withen the Outputs tab choose:

-On trigger (or on start touch, your call)

-Target the scripted_sequence. Whatever name you gave it.

-Select BeginSequence.

Thats it. The npc will run to the scrpted_sequence location. If you don't want the npc to be distracted by the player of other enemies then under the flags tab of the scripted sequence check no interuptions and overide ai.

That is one another method. But again I strongly recomend the ai_goal_assault method.

Another Way... Creat the npc that you want. Under the flags tab check template npc. This means the npc is not automatically spawned in the world when the game starts. To spawn the npc you need a npc_template_maker. Creat the npc_template_maker where you want the npc (soldier) to spawn. Set up a trigger that will trigger the template_maker to spawn. (make sure the template maker is appropriately stringed to the npc_combine_s (gave full name so you won't be confused. Now in the game when you trigger the template maker the npc_combine_s will spawn at the npc_template makers' location. But the npc_combine_s will not run to a specific point...yet. To set that up creat a aiscripted_schedule and an info_target. The info_target must be placed where you want the npc_combine_s to run to. The aiscripted_schedule can go anywhere. Give the info_target a name that the aiscripted_schedule can target. To set up the aiscripted_schedule give it a name, type in the name of the npc_combine_s withen the actors to effect variable. select "run to target" withen the schedule to run variable. The very last variable enter the name of the info_target. Now all you have to do is trigger the aiscripted_schedule. I recomend doing so by selecting your npc_template_maker and creating a new Output.

-On Spawn NPC

-aiscripted_schedule (enter whatever name you gave the aiscripted_schedule)

-StartSchedule

-I recomend a delay of .01 if a delay of 0 doesn't work.

Hope that works for you.

-WL

[addsig]





Post Reply