AndyTheSaurus Posted September 10 Share Posted September 10 I wanted to add a number of my NPC's to a settlement (that does not yet exist). The NPC's all have workshop scripts and Faction workshop dialoges, but I cannot find a way to bind them into a settlement (even by selecting the master workshop station to do this). I have examined other preset settlment (agricultural) members but cannot see anything relevant in their faction settinge or packages. Link to comment Share on other sites More sharing options...
pepperman35 Posted September 10 Share Posted September 10 Maybe this will help. You can put this script on an activator such as a button (link that button to the settlement's workbench). Scriptname TestWorkshopNPCSpawnerScript extends ObjectReference Hidden Const ActorBase Property WorkshopNPC Auto Const WorkshopParentScript Property WorkshopParent Auto Const Event OnActivate(ObjectReference akActionRef) if akActionRef == game.getplayer() ; spawn a new NPC ; get linked workbench WorkshopScript workshopRef = GetLinkedRef() as WorkshopScript WorkshopParent.CreateActorPUBLIC(workshopRef) endif EndEvent Link to comment Share on other sites More sharing options...
AndyTheSaurus Posted September 10 Author Share Posted September 10 (edited) Thanks, but I'm not trying to spawn new NPC's, just puting up a beacon will do that - and provide a mixture of who knows what. I'm trying to link in existing npc's that I have created. Can your script be altered to do that?????? Also, I tried this anyway in a quest script and it does not compile - GetLinkedRef() is not known. Edited September 10 by AndyTheSaurus Link to comment Share on other sites More sharing options...
SKKmods Posted September 11 Share Posted September 11 Quest WorkshopParent = Game.GetFormFromFile(0x0002058e, "Fallout4.esm") as Quest (WorkshopParent as WorkshopParentScript).AddActorToWorkshopPUBLIC(WorkshopNPCScript assignedActor, WorkshopScript workshopRef, bool bResetMode = false) OR (WorkshopParent as WorkshopParentScript).AddPermanentActorToWorkshopPUBLIC(Actor actorToAssign = NONE, int newWorkshopID = -1, bool bAutoAssign = true) Link to comment Share on other sites More sharing options...
AndyTheSaurus Posted September 11 Author Share Posted September 11 I came across this : In Creation Kit, edit your script so it includes in its properties: workshopparentscript Property WorkshopParent Auto Const Then add the line: WorkshopParent.AddPermanentActorToWorkshopPUBLIC(settlerRef, workshopID) where 'settlerRef' is the Object Reference of your spawned settler and 'workshopID' is the ID of the workshop you want to assign the settler to. Then compile the script and make sure the WorkshopParent property has filled properly. Unfortunately, they did not mention how to get the NPC reference. Using the Actor ID kepps the compiler (initially) happy, but does not fill. Then there's the WorkshopID Link to comment Share on other sites More sharing options...
Lemecc Posted September 14 Share Posted September 14 You can find something in the base game that does this and study that, specifically quest DN121 "Out of the Fire". One of the quest stages adds Jake to the workshop if you've fulfilled certain conditions. That said, is scripting even necessary in this case? You haven't stated you want to do it after an event or condition of some kind, which is the only reason why scripting would be necessary. If you want to add the NPC to the workshop and there's no need for any prerequisites, all you need to do is link their ref to the workshop with WorkshopItemKeyword. Link to comment Share on other sites More sharing options...
Recommended Posts