Jump to content

AI Packages and their removal.


prodigium

Recommended Posts

Trying my luck here because I just couldn't find an answer by googling or searching the wiki, or maybe I just missed something.

 

Some background first, you can skip to the last paragraph for the actual question. In a mod I'm currently working on, at first I activated dialogue and travel packages by using the 'addscriptpackage' function, usually in a dialogue result script or in a base effect script. I did this because the wiki says packages added like this will terminate as soon as they are able (I usually checked the Must Complete flag). But I encountered a few situations where the package simply wouldn't activate by using addscriptpackage, but when I added the package directly to the NPC and activated the package by setting a quest variable that enabled a condition in the package, it worked every time.

 

So I removed all the instances where I used addscriptpackage and instead added all the packages to the npcs directly, and used quest variables and conditions to activate them. But because I now added the packages directly to the npcs, I don't know when or if they terminate themselves. So I added removescriptpackage functions to all my effect scripts and dialogue scripts to clean them up. But I'm not sure if this is necessary at all, specifically when using dialogue or travel packages.

 

So, what happens to dialogue or travel packages that are directly added to the npc, after their completion?

 

edit: After more googling, it appears removescriptpackage only works on (doh)... script packages. And that packages directly added to npcs never get removed, instead the game just evaluates the AI package list until one meets set conditions. So I guess I should just make sure the conditions enabling the package are never true again, since most of the time I use these packages only once.

Edited by prodigium
Link to comment
Share on other sites

On the NPC/Creature object, the first package from the top of the list, that has true conditions, will be the one in effect. Actors evaluate their packages periodically - every 15 seconds? If no packages have true conditions then the actor will just stand there by default, unless they are in combat. So if you want a package to take effect right away, set the conditions for the package and do the evp function on the actor - ActorREF.evp - http://geck.bethsoft.com/index.php?title=EvaluatePackage.

Removescriptpackage is only used for addscriptpackage like you found out.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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