Spawn NPC through script and have it follow another NPC?

Post » Sat May 28, 2011 3:55 am

Is it possible for me to tell an NPC to follow another npc if it was spawned with the PlaceAtMe command?

This is for increased patrol NPCs with active spawns in the wastes. I want to identify a patrol leader who is set on a path by hand then have a chance to spawn X number of other NPCs to follow that patrol leader around.
This is also being done during a ref walk function...
User avatar
kirsty joanne hines
 
Posts: 3361
Joined: Fri Aug 18, 2006 10:06 am

Post » Sat May 28, 2011 12:16 pm

Sounds like you want an http://geck.gamesas.com/index.php/Accompany_Package.
User avatar
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Sat May 28, 2011 5:11 pm

Sounds like you want an http://geck.gamesas.com/index.php/Accompany_Package.


sadly my question is a little more complex. I need to give the newly spawned npc (spawned through script) a target so that the package knows who to follow.
User avatar
John N
 
Posts: 3458
Joined: Sun Aug 26, 2007 5:11 pm

Post » Sat May 28, 2011 5:41 am

Couple different ways that I can think of. One is to use a guard package with an xmarker as the target. Then move the xmarker each frame to the NPC you want them to follow.

You could use a follow package in the same way, but you have to use an actor as the target. The actor should have a few settings like saa 0, setghost 1, setdestroyed 1,setunconscious 1 to keep it alive, and keep other actors from interacting with it.
User avatar
Maeva
 
Posts: 3349
Joined: Mon Mar 26, 2007 11:27 pm

Post » Sat May 28, 2011 6:23 am

Well, I have about 50-100ish patrols in the wastes that need this kind of functionality. So if a portable simple solution exists that would be best...
Hopefully I wont need to make 50-100 unique AI script packages or float a ton of X markers all over the place... hmm
User avatar
Ricky Rayner
 
Posts: 3339
Joined: Fri Jul 13, 2007 2:13 am

Post » Sat May 28, 2011 6:16 am

You might be better off placing an NPC in a far remote cell and setting him to initially disabled.

You can then activate him with reference.enable, then apply the appropriate functions to him such as moving him to the player, or to a spot near the player, activating a travel package, et al.

Spawning is really hinkey for 'true' NPCs. Always has been.
User avatar
El Khatiri
 
Posts: 3568
Joined: Sat Sep 01, 2007 2:43 am

Post » Sat May 28, 2011 4:21 am

I found the answer and it was easier than I was expecting. I kind of feel dumb in fact. I didn't realize that AI packages can be told to look for almost anything even form lists..
All I needed to do was make it so the follower npc has a package that explicitly points to any possible leaders. I can spawn as many as I like with PlaceAtMe or hand placed spawns and they all line up like magic.
User avatar
Hussnein Amin
 
Posts: 3557
Joined: Sun Aug 05, 2007 2:15 am


Return to Fallout: New Vegas