Papyrus, Change Actors Package Location Value

Post » Wed Jun 20, 2012 9:52 am

Hey.

As the topic title says, I want to change an actors package data, location, via Papyrus. An example is
the package "DefaultSandboxEditorLocation512", its location data is "Near editor location, radius 512".
"HousecarlWindhelm" is using this package and it's the only package on his package stack. Say I just
finished a dialogue with him, how would I change the location data of his package to an arbitrary cell?

I just started looking at Creation Kit and I'm finding the documentation to be a bit unorganized and scant.

Thank you.
-P
User avatar
Sammygirl500
 
Posts: 3511
Joined: Wed Jun 14, 2006 4:46 pm

Post » Wed Jun 20, 2012 2:00 pm

There are several methods:

1) You could start a quest assigning the housecarl to a reference alias, create an AI package that specifies your desired new sandbox location, and then add that package to the alias via the Reference Alias window.

2) You could create a new AI package for the housecarl, based on their current one but with two different Sandbox procedures in the package--one with their default location and one with your desired location. Then create a quest script with a conditional property like "Bool Property bTalkedToHousecarl Auto Conditional", set that property via a Papyrus dialogue fragment, and then add conditions to both procedures so that the default procedure executes when bTalkedToHousecarl is false, and the new procedure executes when that property is true.

3) You could similarly create a whole new AI package with your desired sandbox location, add your AI package directly to the housecarl's package stack, and again create a quest script with a conditional property, set that property via a Papyrus dialogue fragment and use EvaluatePackage(), and then add conditions to both AI packages so that the default package executes when the property is false, and the new package executes when that property is true.

(And at some future date, method #4 will be to use the Skyrim Script Extender, which will likely provide an Actor.AddPackage() function.)

Method #3 is probably excessive--#2 is more elegant, but #1 may be more compatible with other mods that affect housecarls, if that matters to you.
User avatar
Javaun Thompson
 
Posts: 3397
Joined: Fri Sep 21, 2007 10:28 am


Return to V - Skyrim