Making a NPC walk to a certain point.

Making a NPC walk to a certain point.

Re: Making a NPC walk to a certain point. Posted by David from IKG on Tue Feb 22nd 2005 at 2:20am
David from IKG
60 posts
Posted 2005-02-22 2:20am
60 posts 6 snarkmarks Registered: Jan 16th 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.
Re: Making a NPC walk to a certain point. Posted by French Toast on Tue Feb 22nd 2005 at 2:27am
French Toast
3043 posts
Posted 2005-02-22 2:27am
3043 posts 304 snarkmarks Registered: Jan 16th 2005 Occupation: Kicking Ass Location: Canada
info_node? I don't know I don't use NPC's
Re: Making a NPC walk to a certain point. Posted by whiteLegion on Tue Feb 22nd 2005 at 2:31am
whiteLegion
57 posts
Posted 2005-02-22 2:31am
57 posts 485 snarkmarks Registered: Jan 15th 2004 Occupation: Student Location: USA
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
Re: Making a NPC walk to a certain point. Posted by satchmo on Tue Feb 22nd 2005 at 2:32am
satchmo
2077 posts
Posted 2005-02-22 2:32am
satchmo
member
2077 posts 1809 snarkmarks Registered: Nov 24th 2004 Occupation: pediatrician Location: Los Angeles, U.S.
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.
Re: Making a NPC walk to a certain point. Posted by itisjp on Tue Feb 22nd 2005 at 2:39am
itisjp
18 posts
Posted 2005-02-22 2:39am
itisjp
member
18 posts 2 snarkmarks Registered: Dec 3rd 2004 Occupation: Programmer Location: USA
http://www.gdconnect.com/Tutorials-read-209.html

This will help you out with what you want to do...
Re: Making a NPC walk to a certain point. Posted by satchmo on Tue Feb 22nd 2005 at 2:42am
satchmo
2077 posts
Posted 2005-02-22 2:42am
satchmo
member
2077 posts 1809 snarkmarks Registered: Nov 24th 2004 Occupation: pediatrician Location: Los Angeles, U.S.
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.
Re: Making a NPC walk to a certain point. Posted by itisjp on Tue Feb 22nd 2005 at 3:08am
itisjp
18 posts
Posted 2005-02-22 3:08am
itisjp
member
18 posts 2 snarkmarks Registered: Dec 3rd 2004 Occupation: Programmer Location: USA
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.
Re: Making a NPC walk to a certain point. Posted by satchmo on Tue Feb 22nd 2005 at 3:27am
satchmo
2077 posts
Posted 2005-02-22 3:27am
satchmo
member
2077 posts 1809 snarkmarks Registered: Nov 24th 2004 Occupation: pediatrician Location: Los Angeles, U.S.
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.
Re: Making a NPC walk to a certain point. Posted by David from IKG on Tue Feb 22nd 2005 at 10:30pm
David from IKG
60 posts
Posted 2005-02-22 10:30pm
60 posts 6 snarkmarks Registered: Jan 16th 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.
Re: Making a NPC walk to a certain point. Posted by whiteLegion on Wed Feb 23rd 2005 at 12:55am
whiteLegion
57 posts
Posted 2005-02-23 12:55am
57 posts 485 snarkmarks Registered: Jan 15th 2004 Occupation: Student Location: USA
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
Re: Making a NPC walk to a certain point. Posted by David from IKG on Wed Feb 23rd 2005 at 9:09pm
David from IKG
60 posts
Posted 2005-02-23 9:09pm
60 posts 6 snarkmarks Registered: Jan 16th 2005
its not working :sad:

is there an easier way?
Re: Making a NPC walk to a certain point. Posted by satchmo on Wed Feb 23rd 2005 at 9:35pm
satchmo
2077 posts
Posted 2005-02-23 9:35pm
satchmo
member
2077 posts 1809 snarkmarks Registered: Nov 24th 2004 Occupation: pediatrician Location: Los Angeles, U.S.
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).
Re: Making a NPC walk to a certain point. Posted by David from IKG on Wed Feb 23rd 2005 at 11:31pm
David from IKG
60 posts
Posted 2005-02-23 11:31pm
60 posts 6 snarkmarks Registered: Jan 16th 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....
Re: Making a NPC walk to a certain point. Posted by whiteLegion on Thu Feb 24th 2005 at 11:02pm
whiteLegion
57 posts
Posted 2005-02-24 11:02pm
57 posts 485 snarkmarks Registered: Jan 15th 2004 Occupation: Student Location: USA
David from IKG said:
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. :smile: 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