Jump to content

How to swap an NPC package in a script?


Recommended Posts

Unfortunately, to my knowledge, you can't remove or add packages via scripts anymore. What you can do is set conditions for those packages and then call evaluatePackage() on your NPC so they know which one they should be using.

 

So in your specific example you'd add one condition to your StayAtSelf package which would check if the quest is not at the stage where they'd patrol. You'd also add a condition to your patrol package to check if the quest is at the patrol stage. Then when your quest is set to the patrol stage, in that stage's fragment you'd run something like: MyNPC.EvaluatePackage().

Link to comment
Share on other sites

Yep Jojash is right, you cannot directly add or remove packages from NPCs with script and his suggestion will work perfectly. But I will also suggest a bit different way, if you don't want to directly add package on npc with conditions, you can make new reference alias with startpatrolling package and force your NPC there when needed and then call evaluatePackage()

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...