triggering an AI package help

Post » Wed Apr 09, 2014 8:33 pm

I have built a tavern and populated it with NPCs. I need to make it so that when I pull a lever in the tavern, all the NPCs run outside as fast as they can, like an evacuation.

I originally had a script attached to the lever that called the PathToReference function on an actor, but it literally did nothing. And I read that AI Packages were the only way to control NPC behavior. So here I am trying to creation a package called Evacuate, that makes an NPC exit the room when the level in the room is activated. However, I can not figure out anyway to make the lever interact with an AI package.

I figured I would have a script attached to the lever that would cause the AI package to occur on the lever's activate function.

I started making a custom AI package called Evacuate that is a template of Travel, and when I attach it to an NPC and place it at the top of the package queue, it works! However, it works in the sense that as soon as the room loads, the NPC starts running to the target location. I can't figure out how to make it so the package happens on the lever.

TL;DR Is there a way to "activate" an AI Package on an event, e.g. a trigger activation?

User avatar
James Wilson
 
Posts: 3457
Joined: Mon Nov 12, 2007 12:51 pm

Post » Wed Apr 09, 2014 2:46 pm

The best way to do this would be to create a quest and include all your NPCs as aliases, for each of these aliases you can assign your AI package. If you then set your lever so that it started the quest all those NPCs fill the aliases and get the AI package dumped on them for the duration of the quest.

The good thing about doing this is that your NPCs can have their usual AI packages for when life is normal before you pull the lever.

User avatar
Benito Martinez
 
Posts: 3470
Joined: Thu Aug 30, 2007 6:33 am

Post » Wed Apr 09, 2014 6:36 pm

I'll try this as soon as I can tonight. Thank you very much for the quick response, it is very much appreciated.

User avatar
Tom Flanagan
 
Posts: 3522
Joined: Sat Jul 21, 2007 1:51 am


Return to V - Skyrim