Jump to content

Help required from experienced CK/Papyrus users.


Recommended Posts

Posted

Sorry for the wall of text.

 

I am writing a large expansion to one of my mods.  I have been beta testing it now for a month.   Recently I ran across an issue that I cannot resolve.

 

I have a quest to take Brelyna some potion ingredients and then get her to make a potion.  At stage 60 you give her the potion at stage 70, you run up to the arch-mages quarters and use his potions table.  This happens because of an AI package "SitFurniture" that has the condition stage==70 - stage==90.  When you find her, she is generally down in the Hall of Attainment and so has to run through three load doors to get up there.

 

This quest has run flawlessly in at least 50 tries.   Recently, I and a couple of the beta testers have run into a bug where she just sits in the Hall of Attainment and does nothing.   I have a debug dialog line "Show me your package" and it reports that she has the package to use the potions table.  I used the console to check if the conditions of the package were correct and used the dialog line to confirm that she in fact had the correct package running.  But she did not.  I tried moveto player near the table.  I checked the quest with SQV and it all looked OK.   I tried saving and reloading several times.  I tried triggering this at multiple times of the day using wait.  I tried loading up Nether's and taking her as a follower up to the table.  Nothing I did had any effect.  When it was broke, nothing I could do had any effect on her expected behavior.

 

Today, I tried it again and it worked without me doing anything.  ?????WTF????  I did absolutely nothing between yesterday and today.

 

She has a Quest Alias in another  quest and I added a bit of code to it using Event OnPackageStart(Package akNewPackage) and OnPackageEnd(Package akOldPackage)

 

I noted that the quest changes are triggering the expected package changes.

 

However, I can no longer get this to fail.  I tried it a dozen times and it worked just fine.

 

Does anyone have any insight as to why a loaded AI package might not run?

Posted (edited)

Not all conditions met.

 

The table is located in a different cell and might not be loaded, or no access (locket door), or similar.

To this issue points the "it mostly works".

 

Split the package into 2 parts.

 

Move into cell. (package condition "not in cell whrre table is").

as soon as in cell second package start.

 

 

An example original game is Niyya how to split to avoid not loaded issues.

 

Not needed but maybe usefull the modification.

 

https://www.loverslab.com/files/file/38165-niyya-survives-and-heavymetal-version/

 

 

If you want to try a retrigger of your package with a follower framework, set the once a day flag.

 

Travel packages with the "must complete" flag set cannot be removed, they always kick in until completed.

If such a package fails, due to missing objects, conditions, you need a sledgehammer. The condition will not be checked again inside

the package. Here the once a day flag is useful to restart.

 

 

 

 

 

 

 

 

 

 

Edited by Tlam99
Posted
1 hour ago, fishburger67 said:

Does anyone have any insight as to why a loaded AI package might not run?

 

A small list:

1) The AI Package was changed in the mod between save games and she is still running some twisted version of the old package.

2) One or more of the package conditions was changed, she's still running the old one, etc.

3) The interior/navmesh/target object was changed after that package fired off and she's still looking to path to the original version.

4) Something attached a quest alias to the object she was originally trying to interact with and has reserved it in a way she can no longer access.

5) The cell the NPC is in has to be reloaded - some bit of the old data has remained locked to the loaded cell and cannot be refreshed while inside it.

6) Creation Engine AI runs full speed into walls trying to get somewhere that definitely isn't in that direction.  This most often happens when they are supposed to interact with an object via package and a minor hiccup has prevented it from working.

 

In general, if I am trying to diagnose a fucked up AI package, I will completely remake the package and everything it connects to and delete all past version of it, then when re-entering the game, hit the affected NPC with something that causes the to EvaluatePackage.  Many times, I;ve seen them heading for an object that no longer exists and still try to interact with it.  I think the intended furniture interactions are built into the current AI state, and ocassionally operate even when the furniture in question is gone.  I have seen an NPC sit down into a non-existent chair before, still trying to execute the package they were on when the save game happened and before I deleted or moved the chair.

 

 

Posted

Thank you both for the insights.

 

)

Quote

Something attached a quest alias to the object she was originally trying to interact with and has reserved it in a way she can no longer access.

This may very well be the issue.  Brelyna has lots of vanilla quests and I have Amorous Adventures which has more.  The furniture in question is in the Arch-mages potion table and so I don't feel comfortable marking it as Reserves Reference.  However, an SQV on the quest shows the alias filled. 

 

This "The cell the NPC is in has to be reloaded - some bit of the old data has remained locked to the loaded cell and cannot be refreshed while inside it." also might be an issue although I have tried resetAI and disable/enable and so on without success.

 

If it ever fails again for me, at least I have something to try.  I set the "Must Complete" flag but did not set the Once A Day because this quest frequently gets run two times a day.

Posted (edited)
45 minutes ago, fishburger67 said:

have tried resetAI and disable/enable and so on without success.

This will not remove a failing travel package.

 

 

This function can bring about undesired results with travel packages.

 

 

 

  • Forhttps://ck.uesp.net/wiki/EvaluatePackage_-_Actor
  •  
  • example, if you have a travel package with them going to whiterun, the package will run as expected.
  • If however you call EvaluatePackage for when conditions for a different package is met to travel to say, Windhelm, the previous package will continue to run for a random amount of time.
  • Should the previous package run to the point where it reaches its destination, thus ending the package, after EvaluatePackage() was called, the next package will not process

 

  • For example, if you have a travel package with them going to whiterun, the package will run as expected.
  • If however you call EvaluatePackage for when conditions for a different package is met to travel to say, Windhelm, the previous package will continue to run for a random amount of time.
  • Should the previous package run to the point where it reaches its destination, thus ending the package, after EvaluatePackage() was called, the next package will not process
Edited by Tlam99
Posted (edited)
19 hours ago, Tlam99 said:

This will not remove a failing travel package.

 

 

This function can bring about undesired results with travel packages.

 

 

 

  • Forhttps://ck.uesp.net/wiki/EvaluatePackage_-_Actor
  •  
  • example, if you have a travel package with them going to whiterun, the package will run as expected.
  • If however you call EvaluatePackage for when conditions for a different package is met to travel to say, Windhelm, the previous package will continue to run for a random amount of time.
  • Should the previous package run to the point where it reaches its destination, thus ending the package, after EvaluatePackage() was called, the next package will not process

 

  • For example, if you have a travel package with them going to whiterun, the package will run as expected.
  • If however you call EvaluatePackage for when conditions for a different package is met to travel to say, Windhelm, the previous package will continue to run for a random amount of time.
  • Should the previous package run to the point where it reaches its destination, thus ending the package, after EvaluatePackage() was called, the next package will not process

Yep, knew about all this.  I have been writing mods now for over 10 years (since LE first came out)  and have written thousands of lines of papyrus.  Whatever this issue is, it is going to be something really unusual.

 

Note that this is not a travel package, it is a SitTarget package.  Further, I know her active package to be mine because I am writing's ID to the log file.  She is also sleeping/sitting/walking around Hall of Attainment when I approach her depending on the time of the day so she is not running a travel package.    I now write her package changes to a log file and they are always vanilla sandbox or sleep packages.

 

Thanks for all your help though.

Edited by fishburger67

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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