Attackpony Posted June 27, 2017 Share Posted June 27, 2017 I have placed an npc to stay on location via a stayatself package. However after a quest stage is set I want this npc to start patrolling. How do I swap his package in a script? Link to comment Share on other sites More sharing options...
Jojash Posted June 28, 2017 Share Posted June 28, 2017 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 More sharing options...
shavkacagarikia Posted June 28, 2017 Share Posted June 28, 2017 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 More sharing options...
Attackpony Posted June 29, 2017 Author Share Posted June 29, 2017 Thanks, I think controlling packages with conditions works well. Link to comment Share on other sites More sharing options...
Recommended Posts