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.