Jump to content

AI Package Question?


pepperman35

Recommended Posts

What is the relationship between workshop NPCs (i.e., NPCs having the workshopnpcscript attached and being linked to the workshop with the workshopitem keyword) and AI packages? Within my custom settlement I have a doctor vendor NPC that has five AI packages. Workpkg8x8; patientroundspkg16x2; dataentrypkg18x2; sleeppkg20x8; and generalsandbox(anytime). When this npc IS NOT linked to the workshop she will execute her packages flawlessly; however, if I link her to the workshop then she refuses to execute those packages. Trying to understand this phenomenon and what work arounds their might be if any.

Link to comment
Share on other sites

Job #1 is to find out WHAT package they are actually running then walk that cat back to who owns it. You will need to Debug.Trace your actor with GetCurrentPackage() to see.

 

Whilst I dont do guessing, it is highly probable that its an AI package from WorkshopParent active. Actors assigned/registered to a workshop have default workshop packages applied to them by WorkshopParentScript using the unusual ApplyToRef function which dips them into WorkshopParent.WorkshopActorApply alias which can apply Packages, Keywords, Factions & etc but does not hold them in the alias.

Link to comment
Share on other sites

Okay so I tried using the script you provided for Zorkaz as it seemed to be similar enough but unfortunately, it would not compile for me.

ScriptName SKK_Global
;console: cgf "SKK_Global.GetActorInfo" 00000000

Function GetActorInfo(ObjectReference ThisREF) Global 
Keyword pWorkshopLinkHome = Game.GetFormFromFile(0x0002058f, "Fallout4.esm") as Keyword
Keyword pWorkshopItemKeyword = Game.GetFormFromFile(0x00054ba6, "Fallout4.esm") as Keyword
Keyword pWorkshopLinkSandbox = Game.GetFormFromFile(0x0022b5a7, "Fallout4.esm") as Keyword
Keyword pWorkshopLinkCenter = Game.GetFormFromFile(0x00038c0b, "Fallout4.esm") as Keyword
If (ThisREF != None)
Debug.Trace("SKK_Global.GetActorInfo, " + ThisActor )
Debug.Trace("SKK_Global.GetActorInfo WorkshopID, " + (ThisActor as WorkshopNPCScript).GetWorkshopID() )
Debug.Trace("SKK_Global.GetActorInfo CurrentPackage, " + ThisActor.GetCurrentPackage() )
Debug.Trace("SKK_Global.GetActorInfo WorkshopLinkHome, " + ThisActor.GetLinkedRef(pWorkshopLinkHome) )
Debug.Trace("SKK_Global.GetActorInfo WorkshopItemKeyword, " + ThisActor.GetLinkedRef(pWorkshopItemKeyword) ) 
Debug.Trace("SKK_Global.GetActorInfo WorkshopLinkSandbox, " + ThisActor.GetLinkedRef(pWorkshopItemKeyword).GetLinkedRef(pWorkshopLinkSandbox) )
Debug.Trace("SKK_Global.GetActorInfo WorkshopLinkCenter, " + ThisActor.GetLinkedRef(pWorkshopItemKeyword).GetLinkedRef(pWorkshopLinkCenter) )
EndIf
EndFunction
Compiling "SKK_Global.psc"...
C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base\SKK_Global.psc(10,45): variable ThisActor is undefined
C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base\SKK_Global.psc(11,57): variable ThisActor is undefined
C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base\SKK_Global.psc(11,67): cannot cast a none to a workshopnpcscript, types are incompatible
C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base\SKK_Global.psc(12,60): variable ThisActor is undefined
C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base\SKK_Global.psc(12,70): none is not a known user-defined script type
C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base\SKK_Global.psc(0,0): Error while trying to typecheck script skk_global: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
No output generated for SKK_Global.psc, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on SKK_Global.psc
Link to comment
Share on other sites

Okay, great!

 

Here's the output. So it appears that this NPC is using WorkshopSandboxRelaxation20x4 which is not one of the package that I have assigned to her in her package stack.

 

[01/17/2021 - 12:22:01PM] SKK_Global.GetActorInfo, [workshopnpcscript < (07CD161B)>]
[01/17/2021 - 12:22:01PM] SKK_Global.GetActorInfo WorkshopID, 23
[01/17/2021 - 12:22:01PM] SKK_Global.GetActorInfo CurrentPackage, [Package < (0005C2A5)>]
[01/17/2021 - 12:22:01PM] SKK_Global.GetActorInfo WorkshopLinkHome, [ObjectReference < (0022D0F1)>]
[01/17/2021 - 12:22:01PM] SKK_Global.GetActorInfo WorkshopItemKeyword, [workshopscript < (00161F4B)>]
[01/17/2021 - 12:22:02PM] SKK_Global.GetActorInfo WorkshopLinkSandbox, [ObjectReference < (0022D0F1)>]
[01/17/2021 - 12:22:02PM] SKK_Global.GetActorInfo WorkshopLinkCenter, [ObjectReference < (0016557A)>]
Link to comment
Share on other sites

Find WorkshopSandboxRelaxation20x4 in CK and right click to find which quest uses it, then find in that quest which alias applies it to actors. Hint: already told you above :wink:

 

The next plan A question is what PRIORITY is that quest and what PRIORITY is your quest.

 

Lastly look at the package conditions as they may offer a plan B bypass.

Link to comment
Share on other sites

Okay, sounds easy enough. At the moment, I have no quests associated with the mod. My doctor/vendor npc is hand placed, linked up, and includes their desired packages. I have soooo much to learn. So I take it that running EvaluatePackage() on her wouldn't solve my problem. BTW, I have the same issue on all those Botanists that were spawned in.

Edited by pepperman35
Link to comment
Share on other sites

If you are not applying the packages via a quest that you can make higher priority than WorkshopParent quest which originates the packages, then you need exploit the conditions on the workshop packages themselves.

 

Adding your actors to the WorkshopNoPackages faction should do the trick.

 

Yes its a really really complex nest of undocumented dependencies, took me several hundred hours to untangle them and there is still work to do. On a 6 year old platform.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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