What is Alias Package Data?

Post » Tue Sep 22, 2015 7:49 am

HI all,

I'm trying to run a custom Forced Greet AI Package on Lucan Valerius of the Riverwood Traders and it is failing.

I believe the reason it is failing is that Lucan is already running the MS13LucanValeriusTraderServices package as a result of it being in the "Alias Package Data" section of the "M13" (Golden Claw) quest.

The trouble is that this is happening after the Golden Claw quest has completed.

I am a new modder so I don't really know how these things work together. If someone could explain to me any of the following that would be appreciated:

1. What is Alias Package Data? Should such packages stop running once a quest has completed?

2. Should the package running from this Alias Package Data prevent aliases from the actor running? Is there a way to give actor packages priority over alias packages?

3. Is there a way to detect that an Alias Package Data package is running? I have tried calling GetCurrentPackage() on the Actor but that does not indicate any package is running.

4. Is there a way within a script to stop such packages from running?

Any additional information, suggestions, or references that contain more information are appreciated.

Thanks,

legume.

User avatar
C.L.U.T.C.H
 
Posts: 3385
Joined: Tue Aug 14, 2007 6:23 pm

Post » Tue Sep 22, 2015 9:45 am

Alias Package Data is effectively the same as AI package data for an Actor. Put simply, if an alias is filled with a given actor, that actor's AI package data is replaced by the Alias Package Data (so you assumed correctly.)

When a quest ends termination, all aliases are effectively removed (to the best of my knowledge); however, many quests continue to run in the background far beyond the final visible "Quest Complete" stage.

General rule of thumb: any Actor filling an alias has it's data effectively overwritten by the Alias Data, this includes scripts, packages etc. (to the best of my knowledge).

User avatar
Sandeep Khatkar
 
Posts: 3364
Joined: Wed Jul 18, 2007 11:02 am

Post » Tue Sep 22, 2015 8:17 pm

the package stack on a ref alias is an alternate package stack, that will override the one on the actor himself while that actor is in this alias

(IF the alias stack has a valid package, else it'll fall back to the actor packages)

if an actor is in multiple aliases with each their own stack, the stack from the quest with the highest priority "wins"

(and alias package stacks themselves are overridden by scene packages)

other than that, this stack will act like any normal actor's package stack while that actor's in that alias, = top down priority

should you want, the other way around, use alias data in a package, you need to set that package owned by the quest that alias is on.

if you want to use an actor that's maybe in some other quest at the time, it might be that actor's "reserved" by that other quest alias,

for this case, check "allow reserved" on your alias or otherwise your actor will drop out of that alias.

if he's not set to "optional", the whole quest would terminate then, so best also check optional, unless you're definitely sure that ref will be available when that quest starts

User avatar
SEXY QUEEN
 
Posts: 3417
Joined: Mon Aug 13, 2007 7:54 pm

Post » Tue Sep 22, 2015 7:19 pm

Thanks Garion and s7o.

Understanding how this all works has certainly helped a lot.

I'm still having trouble. I had all the above mentioned problems and worked them out.

I think there is something wrong with the Actor running this package. Would that be unheard of?

I have a script in the package's "Change" section and it triggers well after the quest has completed. I use GetQuestRunning() which returns 0. I have another (higher priority) quest that fills an alias with this actor and gives him a package stack with just the forced greet package I want to run. I can see this new quest is running (with GetQuestRunning()) but still the problematic package's "Change" script keeps running.

Anyway, thanks for all of the info.

I will keep trying to sort through it.

Thanks,

legume.

User avatar
Vincent Joe
 
Posts: 3370
Joined: Wed Sep 26, 2007 1:13 pm

Post » Tue Sep 22, 2015 1:56 pm

Well, I have figured out the cause is the Force Greet package is not passing it's conditions. (At least this is the cause after resolving all other issues above).

In particular the GetQuestRunning() for the quest I am making is failing.

It is curious why the same package would run on other Actors (Camilla of the Riverwood Traders) but not on Lucan.

And it is curious why the Package selection does not recognize the quest as running when everything else in the game does.

But knowing that is the trouble I should at least be able to find a work around.

Thanks again for the help,

legume.

User avatar
Lory Da Costa
 
Posts: 3463
Joined: Fri Dec 15, 2006 12:30 pm

Post » Tue Sep 22, 2015 6:29 am

glad you could sort it out, since i'm not really sure if i understood what your problem is.

a part of it seems to be your quest not running anyway - so if that's that quest that holds your alias, and if it SHOULD be running at the time but it's not:

if ANY alias fails to fill, the quest will be terminated.

check through all your aliases what the checkboxes say:

to take one as an example, say "allow disabled" is not checked:

if the actor it points to is disabled when that quest starts, the quest will terminate right on start.

if the quest is running and you disable your actor by script, console or whatever - the quest will terminate.

if the quest is running and you fill the alias with another ref that's disabled, the quest will terminate.

so friggin' check "allow disabled" :-)

the same goes for ALL checkboxes that say "allow" (if what you're trying to do doesn't demand for another setting, best just habitually check them all)

and to avoid the whole quest terminating thing alltogether, you can check "optional". this means the quest just won't care if that ref is there, dead, disabled or whatever.

this is also the only way to have an empty forced ref alias (for filling later) on your quest.

...and i really think you should read http://www.creationkit.com/Quest_Alias_Tab :-)

User avatar
Jay Baby
 
Posts: 3369
Joined: Sat Sep 15, 2007 12:43 pm

Post » Tue Sep 22, 2015 8:27 am

Thanks again s7o.

I had made progress last time I was working on it but I had not sorted it out. I have now though =)

My troubles were rather confusing and difficult to pinpoint but I think I have figured it out.

It seems that when Lucan Valerius is running as his MS13 quest alias he picks up a MS13LucanValeriusTraderServices AI package that he never gets out of. Even after the MS13 quest is no longer running.

I don't exactly know what it means by "he never gets out of it" but a force greet package for an alias in the quest I am making will not run if it has conditions (even though the conditions are true). If there are no conditions for the package it will run as expected so it seems that something about Lucan is preventing him from running the condition check of his package list.

Note: The same package will run on Camilla's MS13 quest alias even with conditions.

Note: I tried putting the package in the AI list for the Lucan alias in the MS13 quest above the TraderServices AI package but it still would not run.

I do run a fair number of experimental mods. I don't think any of them directly affect Lucan but the trouble could be related to that.

For any who are interested in my work around:

As a work around I have setup my scripts to Disable Lucan and Enable him again. When he is enabled he will pick up the AI package from the force greet quest that I am making.

Note: Some care must be taken to avoid disabling him in the middle of his scenes.

Below is some of the code I used to accomplish this:

Spoiler

Disclaimer: I don't know what I am doing!

There could very well be a better solution to this problem.

Only use this code if you understand and accept that.

Spoiler

;;;;;

;;;;; This section of code goes in the script fragment for the quest stage where you want the AI package to start.

;;;;;

; If the quest is not running don't bother with updates.
If (!Self.IsRunning())
Return
EndIf

; Get the closest merchant

;;; Note: for me this actor was retrieved from a separate data storage quest.
ReferenceAlias oMerchantAlias = s_qDataQuest.GetAlias(0) as ReferenceAlias
Actor aMerchant = oMerchantAlias.GetActorReference()

; Lucan has a special condition that he does not stop his MS13LucanValeriusTraderServices
; package. To work around this we must disable him and then re-enable him.

;;; Note: s_aLucanValerius must be setup as a script property referencing Lucan.
If (aMerchant && (s_aLucanValerius == aMerchant))
; If Lucan is currently in a scene just register for a polling time update so we can disable him later.
If (aMerchant.GetCurrentScene())
RegisterForUpdateGameTime(0.05) ; 0.05 == 3 minutes (in game time).
Return
EndIf

aMerchant.Disable()
aMerchant.Enable()
EndIf

;;;;;

;;;;; This goes in the same fragment script but under the Quest Tab "Scripts". Add it at the end and do not modify between the DO NOT EDIT lines of the script.

;;;;;

Event OnUpdateGameTime()
; Keep track of the stage of the quest in a local variable.
Int iStage = Self.getStage()

; If the quest is not running don't bother with updates.

;;; Note: I use stage 0 as an "initial" stage. For me the quest really starts at stage 10.
If (!Self.IsRunning() || (10 > iStage))
UnregisterForUpdateGameTime()
Return
EndIf

; In stage 10 we may need to wait for Lucan to finish a scene so he can be disabled, fixing his AI package.
If ((10 <= iStage) && (20 > iStage))
; Get the closest merchant
;;; Note: for me this actor was retrieved from a separate data storage quest.
ReferenceAlias oMerchantAlias = s_qDataQuest.GetAlias(0) as ReferenceAlias
Actor aMerchant = oMerchantAlias.GetActorReference()

; Lucan has a special condition that he does not stop his MS13LucanValeriusTraderServices
; package. To work around this we must disable him and then re-enable him.
;;; Note: s_aLucanValerius must be setup as a script property referencing Lucan.
If (s_aLucanValerius == aMerchant)
; If Lucan is still in a scene then wait longer.
Scene oMerchantScene = aMerchant.GetCurrentScene()
If (oMerchantScene)
; If Lucan is in the Callia Player Escort Scene stop the scene as it will never finish and is not needed.
;;; Note: the Camilla Escort scene may cause trouble. You will need to follow Camilla before it ends.
;;; Note: s_oCamillaEscortScene must be setup as a script property referencing MS13CamillaEscortPlayerScene.
If (s_oCamillaEscortScene == oMerchantScene)
oMerchantScene.Stop()
EndIf
Return
EndIf

aMerchant.Disable()
aMerchant.Enable()
EndIf

; If we get here we have finished processing this stage. Unregister for futher timing polls.
UnregisterForUpdateGameTime()
EndIf
EndEvent

Some lessons learned:

- Set your quest aliases as Optional to make sure your quest runs. This is particularly true when debugging troubles.

- Scenes override Package AI lists. Package AI lists in aliases override those in the base actor.

- Some Actors may be "Reserved" in other quests. Use "Allow Reserved" to allow them to be suggested.

- As s7o mentioned toggle all of the "allow" options to be safe unless they will cause problems.

Thanks again for the help,

legume.

User avatar
Yonah
 
Posts: 3462
Joined: Thu Aug 02, 2007 4:42 am

Post » Tue Sep 22, 2015 5:45 am

Package scripts accept only two functions: GetOwningQuest() and GetTemplate: http://www.creationkit.com/Package_Script

(FYI, Topic Info scripts accept only GetOwningQuest().)

;)

User avatar
Sabrina Schwarz
 
Posts: 3538
Joined: Fri Jul 14, 2006 10:02 am


Return to V - Skyrim