├── .gitignore └── Scripts └── Source └── User ├── Fragments └── Quests │ ├── QF_WorkshopFeralGhoulAttack0_00097CC7.psc │ ├── QF_WorkshopGunnerAttack02_000CFF72.psc │ ├── QF_WorkshopMirelurkAttack_SI_002407D0.psc │ ├── QF_WorkshopRaiderAttack01NEW_001125E2.psc │ ├── QF_WorkshopRaiderAttack02NEW_001125E3.psc │ ├── QF_WorkshopRaiderAttack03_001125A6.psc │ ├── QF_WorkshopRaiderAttack04_000C97A8.psc │ ├── QF_WorkshopSuperMutantAttack_00097CC6.psc │ └── QF_WorkshopSuperMutantAttack_0024918C.psc ├── PowerGridTools.psc ├── WSFWIdentifier.psc ├── WorkshopEventsQuestScript.psc ├── WorkshopFramework ├── Aliases │ ├── ConfigureSpawnedAssaultNPCs.psc │ ├── MonitorAssaultAlias.psc │ ├── RemoveFromAliasOnDeath.psc │ ├── RemoveOnDeath.psc │ └── RemoveSubdueTargetFromAlias.psc ├── AssaultManager.psc ├── AssaultSettlement.psc ├── F4SEManager.psc ├── Forms │ ├── FormInformation.psc │ └── RealInventoryProxyItem.psc ├── Fragments │ ├── Perks │ │ └── PRKF_WSFW_ActivationsPerk_01015131.psc │ ├── Quests │ │ ├── QF_WorkshopFeralGhoulAttack0_00097CC7.psc │ │ ├── QF_WorkshopGunnerAttack02_000CFF72.psc │ │ ├── QF_WorkshopMirelurkAttack_SI_002407D0.psc │ │ ├── QF_WorkshopRaiderAttack01NEW_001125E2.psc │ │ ├── QF_WorkshopRaiderAttack02NEW_001125E3.psc │ │ ├── QF_WorkshopRaiderAttack03_001125A6.psc │ │ ├── QF_WorkshopRaiderAttack04_000C97A8.psc │ │ ├── QF_WorkshopSuperMutantAttack_00097CC6.psc │ │ └── QF_WorkshopSuperMutantAttack_0024918C.psc │ └── Terminals │ │ ├── TERM_WSFW_Messages_Menu.psc │ │ ├── TERM_WSFW_Options_Menu_Activ_010158CE.psc │ │ ├── TERM_WSFW_Options_Menu_Advan_0101BBB0.psc │ │ ├── TERM_WSFW_Options_Menu_Assignment.psc │ │ ├── TERM_WSFW_Options_Menu_DoorM_0101E2D8.psc │ │ ├── TERM_WSFW_Options_Menu_Functionality.psc │ │ ├── TERM_WSFW_Options_Menu_Messa_010082CB.psc │ │ ├── TERM_WSFW_Tools_Power_menu_0102CE8C.psc │ │ ├── TERM_WSFW_Tools_menu.psc │ │ └── TERM__WSFWFrameworkControls0101607B.psc ├── GoE_Reflection.psc ├── HUDFrameworkManager.psc ├── InjectionManager.psc ├── Library │ ├── ControllerQuest.psc │ ├── DataStructures.psc │ ├── LockableQuest.psc │ ├── MasterQuest.psc │ ├── ObjectRefs │ │ ├── ArrayLargeInt1024.psc │ │ ├── ExportExtraData.psc │ │ ├── Fiber.psc │ │ ├── FiberController.psc │ │ ├── LockableObjectRef.psc │ │ ├── LockableWorkshopObjectScript.psc │ │ ├── Mutex.psc │ │ ├── PreventDroppingOnGround.psc │ │ ├── PreventLooting.psc │ │ ├── ProductionRecord.psc │ │ ├── ProtectedObjectRef.psc │ │ ├── ProtectedWorkshopObjectScript.psc │ │ ├── ResourceTypeConsumption.psc │ │ ├── ResourceTypeConsumptionMissing.psc │ │ ├── ResourceTypeProduction.psc │ │ ├── Task.psc │ │ ├── Thread.psc │ │ ├── ThreadStarter.psc │ │ └── WorkshopAVReacting.psc │ ├── SettlementLayoutRegistrationQuest.psc │ ├── SimpleInjectionManager.psc │ ├── SlaveQuest.psc │ ├── StoryEventQuest.psc │ ├── ThirdParty │ │ └── Cobb │ │ │ ├── CobbLibraryRotations.psc │ │ │ └── CobbLibraryVectors.psc │ ├── ThreadManager.bak.psc │ ├── ThreadManager.psc │ ├── ThreadRunner.bak.psc │ ├── ThreadRunner.psc │ ├── UtilityFunctions.psc │ ├── VersionedLockableQuest.psc │ └── WorkshopMenuInjectionQuest.psc ├── MainQuest.psc ├── MainThreadManager.psc ├── MainThreadRunner.psc ├── MessageManager.psc ├── NPCCreationManager.psc ├── NPCManager.psc ├── ObjectRefs │ ├── ClutteredItem.psc │ ├── DisplayRack.psc │ ├── Fiber_PersistenceRemoveDeletedObjects.psc │ ├── Fiber_PersistenceUpdateBase.psc │ ├── Fiber_PersistenceUpdateObjects.psc │ ├── Fiber_PersistenceUpdateQueue.psc │ ├── InteriorWorkshopRoomboundHelper.psc │ ├── InvisibleWorkshopActorSpawner.psc │ ├── InvisibleWorkshopObject.psc │ ├── MoveContainerItemsOnLoad.psc │ ├── PreventExportingRefHolder.psc │ ├── PreventScrappingVanillaRefHolder.psc │ ├── RealInventoryDisplay.psc │ ├── RealInventoryDisplayPoint.psc │ ├── SelfResettingRef.psc │ ├── Thread_AddNPCToWorkshop.psc │ ├── Thread_ExportObjectData.psc │ ├── Thread_FindAndScrapObject.psc │ ├── Thread_PlaceObject.psc │ ├── Thread_RestoreObject.psc │ ├── Thread_ScrapObject.psc │ ├── Thread_ScrapVanillaObject.psc │ ├── Thread_ToggleInvisibleWorkshopObjects.psc │ └── Thread_UpdateClutteredItems.psc ├── PersistenceManager.psc ├── PlaceObjectManager.psc ├── Quests │ ├── CanarySaveFileMonitor.psc │ ├── DoorFinder.psc │ ├── DoorManager.psc │ ├── FetchLocationData.psc │ ├── FindLayoutItems.psc │ ├── StoryEventManager.psc │ └── TaskManager.psc ├── ScrapFinder.psc ├── SettlementLayoutManager.psc ├── UIManager.psc ├── WSFW_API.psc ├── WSFW_APIQuest.psc ├── Weapons │ ├── SettlementLayout.psc │ └── SettlementLayoutLayer.psc ├── WorkshopControlManager.psc ├── WorkshopFunctions.psc ├── WorkshopFunctions.psc.bak ├── WorkshopMenuManager.psc ├── WorkshopObjectManager.psc ├── WorkshopObjectManager_EliminatedPowerGridToolsUsage.psc ├── WorkshopProductionManager.psc └── WorkshopResourceManager.psc ├── WorkshopNPCScript.psc ├── WorkshopObjectScript.psc ├── WorkshopParentScript.psc ├── WorkshopRadioBeaconRecruitScript.psc └── WorkshopScript.psc /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | Scripts/Source/User/WorkshopFramework/MainQuest.psc.bak 3 | Scripts/Source/User/WorkshopFramework/Weapons/SettlementLayout.bak 4 | -------------------------------------------------------------------------------- /Scripts/Source/User/Fragments/Quests/QF_WorkshopGunnerAttack02_000CFF72.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopGunnerAttack02_000CFF72 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack03Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | ; set workshop alert value 47 | Alias_Workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 48 | else 49 | ; now quest should shutdown when everything unloads 50 | kmyQuest.StopQuestWhenAliasesUnloaded = true 51 | endif 52 | ;END CODE 53 | EndFunction 54 | ;END FRAGMENT 55 | 56 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 57 | Function Fragment_Stage_0020_Item_01() 58 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 59 | Quest __temp = self as Quest 60 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 61 | ;END AUTOCAST 62 | ;BEGIN CODE 63 | kmyQuest.StartAttack() 64 | ;END CODE 65 | EndFunction 66 | ;END FRAGMENT 67 | 68 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 69 | Function Fragment_Stage_0050_Item_00() 70 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 71 | Quest __temp = self as Quest 72 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 73 | ;END AUTOCAST 74 | ;BEGIN CODE 75 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, attackFactionValue = 5) 76 | ;END CODE 77 | EndFunction 78 | ;END FRAGMENT 79 | 80 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 81 | Function Fragment_Stage_0100_Item_00() 82 | ;BEGIN AUTOCAST TYPE REScript 83 | Quest __temp = self as Quest 84 | REScript kmyQuest = __temp as REScript 85 | ;END AUTOCAST 86 | ;BEGIN CODE 87 | ; failsafe - make sure registered for cleanup 88 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 89 | SetObjectiveCompleted(10) 90 | ; clear workshop alert value 91 | Alias_Workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 92 | ;END CODE 93 | EndFunction 94 | ;END FRAGMENT 95 | 96 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 97 | Function Fragment_Stage_0200_Item_00() 98 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 99 | Quest __temp = self as Quest 100 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 101 | ;END AUTOCAST 102 | ;BEGIN CODE 103 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 104 | ;END CODE 105 | EndFunction 106 | ;END FRAGMENT 107 | 108 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 109 | Function Fragment_Stage_0400_Item_00() 110 | ;BEGIN CODE 111 | ; Make this workshop player owned 112 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 113 | ;END CODE 114 | EndFunction 115 | ;END FRAGMENT 116 | 117 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 118 | Function Fragment_Stage_1000_Item_00() 119 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 120 | Quest __temp = self as Quest 121 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 122 | ;END AUTOCAST 123 | ;BEGIN CODE 124 | ; check to see if attack needs to be resolved by script 125 | 126 | ; WSFW - 1.0.8 127 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 128 | 129 | 130 | if kmyQuest.CheckResolveAttack() 131 | if IsObjectiveDisplayed(10) 132 | MessageManager.ShowMessage(WorkshopGunnerAttack02LoseMessage) 133 | 134 | ;WorkshopGunnerAttack02LoseMessage.Show() 135 | endif 136 | FailAllObjectives() 137 | else 138 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 139 | MessageManager.ShowMessage(WorkshopGunnerAttack02WinMessage) 140 | 141 | ;WorkshopGunnerAttack02WinMessage.Show() 142 | endif 143 | CompleteAllObjectives() 144 | endif 145 | ; remove everyone from the "grateful" faction 146 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 147 | ; clear alert value 148 | Alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 149 | ;END CODE 150 | EndFunction 151 | ;END FRAGMENT 152 | 153 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 154 | 155 | ReferenceAlias Property Alias_Workshop Auto Const 156 | 157 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 158 | 159 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 160 | 161 | Message Property WorkshopRaiderAttack03Message Auto Const 162 | 163 | Message Property WorkshopGunnerAttack02LoseMessage Auto Const Mandatory 164 | 165 | Message Property WorkshopGunnerAttack02WinMessage Auto Const Mandatory 166 | -------------------------------------------------------------------------------- /Scripts/Source/User/Fragments/Quests/QF_WorkshopMirelurkAttack_SI_002407D0.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopMirelurkAttack_SI_002407D0 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack03Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 47 | else 48 | ; now quest should shutdown when everything unloads 49 | kmyQuest.StopQuestWhenAliasesUnloaded = true 50 | endif 51 | ;END CODE 52 | EndFunction 53 | ;END FRAGMENT 54 | 55 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 56 | Function Fragment_Stage_0020_Item_01() 57 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 58 | Quest __temp = self as Quest 59 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 60 | ;END AUTOCAST 61 | ;BEGIN CODE 62 | kmyQuest.StartAttack() 63 | ;END CODE 64 | EndFunction 65 | ;END FRAGMENT 66 | 67 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 68 | Function Fragment_Stage_0050_Item_00() 69 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 70 | Quest __temp = self as Quest 71 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 72 | ;END AUTOCAST 73 | ;BEGIN CODE 74 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, attackFactionValue = 5) 75 | ;END CODE 76 | EndFunction 77 | ;END FRAGMENT 78 | 79 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 80 | Function Fragment_Stage_0100_Item_00() 81 | ;BEGIN AUTOCAST TYPE REScript 82 | Quest __temp = self as Quest 83 | REScript kmyQuest = __temp as REScript 84 | ;END AUTOCAST 85 | ;BEGIN CODE 86 | ; failsafe - make sure registered for cleanup 87 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 88 | SetObjectiveCompleted(10) 89 | ; clear alert value 90 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 91 | ;END CODE 92 | EndFunction 93 | ;END FRAGMENT 94 | 95 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 96 | Function Fragment_Stage_0200_Item_00() 97 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 98 | Quest __temp = self as Quest 99 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 100 | ;END AUTOCAST 101 | ;BEGIN CODE 102 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 103 | ;END CODE 104 | EndFunction 105 | ;END FRAGMENT 106 | 107 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 108 | Function Fragment_Stage_0400_Item_00() 109 | ;BEGIN CODE 110 | ; Make this workshop player owned 111 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 112 | ;END CODE 113 | EndFunction 114 | ;END FRAGMENT 115 | 116 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 117 | Function Fragment_Stage_1000_Item_00() 118 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 119 | Quest __temp = self as Quest 120 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 121 | ;END AUTOCAST 122 | ;BEGIN CODE 123 | ; check to see if attack needs to be resolved by script 124 | ; WSFW - 1.0.8 125 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 126 | 127 | 128 | if kmyQuest.CheckResolveAttack() 129 | if IsObjectiveDisplayed(10) 130 | MessageManager.ShowMessage(WorkshopMirelurkAttack_SI_LoseMessage) 131 | ;WorkshopMirelurkAttack_SI_LoseMessage.Show() 132 | endif 133 | FailAllObjectives() 134 | else 135 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 136 | MessageManager.ShowMessage(WorkshopMirelurkAttack_SI_WinMessage) 137 | ;WorkshopMirelurkAttack_SI_WinMessage.Show() 138 | endif 139 | CompleteAllObjectives() 140 | endif 141 | ; remove everyone from the "grateful" faction 142 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 143 | ; clear alert value 144 | Alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 145 | ;END CODE 146 | EndFunction 147 | ;END FRAGMENT 148 | 149 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 150 | 151 | ReferenceAlias Property Alias_Workshop Auto Const 152 | 153 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 154 | 155 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 156 | 157 | Message Property WorkshopRaiderAttack03Message Auto Const 158 | 159 | Message Property WorkshopMirelurkAttack_SI_LoseMessage Auto Const Mandatory 160 | 161 | Message Property WorkshopMirelurkAttack_SI_WinMessage Auto Const Mandatory 162 | -------------------------------------------------------------------------------- /Scripts/Source/User/Fragments/Quests/QF_WorkshopRaiderAttack01NEW_001125E2.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopRaiderAttack01NEW_001125E2 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack01Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack01Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 47 | else 48 | ; now quest should shutdown when everything unloads 49 | kmyQuest.StopQuestWhenAliasesUnloaded = true 50 | endif 51 | ;END CODE 52 | EndFunction 53 | ;END FRAGMENT 54 | 55 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 56 | Function Fragment_Stage_0020_Item_01() 57 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 58 | Quest __temp = self as Quest 59 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 60 | ;END AUTOCAST 61 | ;BEGIN CODE 62 | kmyQuest.StartAttack() 63 | ;END CODE 64 | EndFunction 65 | ;END FRAGMENT 66 | 67 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 68 | Function Fragment_Stage_0050_Item_00() 69 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 70 | Quest __temp = self as Quest 71 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 72 | ;END AUTOCAST 73 | ;BEGIN CODE 74 | ; put everyone in "grateful" faction 75 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs) 76 | ;END CODE 77 | EndFunction 78 | ;END FRAGMENT 79 | 80 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 81 | Function Fragment_Stage_0100_Item_00() 82 | ;BEGIN AUTOCAST TYPE REScript 83 | Quest __temp = self as Quest 84 | REScript kmyQuest = __temp as REScript 85 | ;END AUTOCAST 86 | ;BEGIN CODE 87 | ; failsafe - make sure registered for cleanup 88 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 89 | SetObjectiveCompleted(10) 90 | ; clear alert value 91 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 92 | ;END CODE 93 | EndFunction 94 | ;END FRAGMENT 95 | 96 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 97 | Function Fragment_Stage_0200_Item_00() 98 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 99 | Quest __temp = self as Quest 100 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 101 | ;END AUTOCAST 102 | ;BEGIN CODE 103 | ; remove everyone from the "grateful" faction 104 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 105 | ;END CODE 106 | EndFunction 107 | ;END FRAGMENT 108 | 109 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 110 | Function Fragment_Stage_0400_Item_00() 111 | ;BEGIN CODE 112 | ; Make this workshop player owned 113 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 114 | ;END CODE 115 | EndFunction 116 | ;END FRAGMENT 117 | 118 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 119 | Function Fragment_Stage_1000_Item_00() 120 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 121 | Quest __temp = self as Quest 122 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 123 | ;END AUTOCAST 124 | ;BEGIN CODE 125 | ; check to see if attack needs to be resolved by script 126 | ; WSFW - 1.0.8 127 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 128 | 129 | if kmyQuest.CheckResolveAttack() 130 | if IsObjectiveDisplayed(10) 131 | MessageManager.ShowMessage(WorkshopRaiderAttack01LoseMessage) 132 | ;WorkshopRaiderAttack01LoseMessage.Show() 133 | endif 134 | FailAllObjectives() 135 | else 136 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 137 | MessageManager.ShowMessage(WorkshopRaiderAttack01WinMessage) 138 | ;WorkshopRaiderAttack01WinMessage.Show() 139 | endif 140 | CompleteAllObjectives() 141 | endif 142 | ; remove everyone from the "grateful" faction 143 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 144 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 145 | ;END CODE 146 | EndFunction 147 | ;END FRAGMENT 148 | 149 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 150 | 151 | ReferenceAlias Property Alias_Workshop Auto Const 152 | 153 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 154 | 155 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 156 | 157 | Message Property WorkshopRaiderAttack01Message Auto Const 158 | 159 | Message Property WorkshopRaiderAttack01LoseMessage Auto Const Mandatory 160 | 161 | Message Property WorkshopRaiderAttack01WinMessage Auto Const Mandatory 162 | 163 | Message Property WorkshopSuperMutantAttack01LoseMessage Auto Const Mandatory 164 | -------------------------------------------------------------------------------- /Scripts/Source/User/Fragments/Quests/QF_WorkshopRaiderAttack02NEW_001125E3.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopRaiderAttack02NEW_001125E3 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack02Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack02Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 47 | else 48 | ; now quest should shutdown when everything unloads 49 | kmyQuest.StopQuestWhenAliasesUnloaded = true 50 | endif 51 | ;END CODE 52 | EndFunction 53 | ;END FRAGMENT 54 | 55 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 56 | Function Fragment_Stage_0020_Item_01() 57 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 58 | Quest __temp = self as Quest 59 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 60 | ;END AUTOCAST 61 | ;BEGIN CODE 62 | kmyQuest.StartAttack() 63 | ;END CODE 64 | EndFunction 65 | ;END FRAGMENT 66 | 67 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 68 | Function Fragment_Stage_0050_Item_00() 69 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 70 | Quest __temp = self as Quest 71 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 72 | ;END AUTOCAST 73 | ;BEGIN CODE 74 | ; put everyone in "grateful" faction 75 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs) 76 | ;END CODE 77 | EndFunction 78 | ;END FRAGMENT 79 | 80 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 81 | Function Fragment_Stage_0100_Item_00() 82 | ;BEGIN AUTOCAST TYPE REScript 83 | Quest __temp = self as Quest 84 | REScript kmyQuest = __temp as REScript 85 | ;END AUTOCAST 86 | ;BEGIN CODE 87 | ; failsafe - make sure registered for cleanup 88 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 89 | SetObjectiveCompleted(10) 90 | ; clear alert value 91 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 92 | ;END CODE 93 | EndFunction 94 | ;END FRAGMENT 95 | 96 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 97 | Function Fragment_Stage_0200_Item_00() 98 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 99 | Quest __temp = self as Quest 100 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 101 | ;END AUTOCAST 102 | ;BEGIN CODE 103 | ; remove everyone from the "grateful" faction 104 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 105 | ;END CODE 106 | EndFunction 107 | ;END FRAGMENT 108 | 109 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 110 | Function Fragment_Stage_0400_Item_00() 111 | ;BEGIN CODE 112 | ; Make this workshop player owned 113 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 114 | ;END CODE 115 | EndFunction 116 | ;END FRAGMENT 117 | 118 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 119 | Function Fragment_Stage_1000_Item_00() 120 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 121 | Quest __temp = self as Quest 122 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 123 | ;END AUTOCAST 124 | ;BEGIN CODE 125 | ; check to see if attack needs to be resolved by script 126 | ; WSFW - 1.0.8 127 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 128 | 129 | if kmyQuest.CheckResolveAttack() 130 | if IsObjectiveDisplayed(10) 131 | MessageManager.ShowMessage(WorkshopRaiderAttack02LoseMessage) 132 | ;WorkshopRaiderAttack02LoseMessage.Show() 133 | endif 134 | FailAllObjectives() 135 | else 136 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 137 | MessageManager.ShowMessage(WorkshopRaiderAttack02WinMessage) 138 | ;WorkshopRaiderAttack02WinMessage.Show() 139 | endif 140 | CompleteAllObjectives() 141 | endif 142 | ; remove everyone from the "grateful" faction 143 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 144 | ; clear alert value 145 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 146 | ;END CODE 147 | EndFunction 148 | ;END FRAGMENT 149 | 150 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 151 | 152 | ReferenceAlias Property Alias_Workshop Auto Const 153 | 154 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 155 | 156 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 157 | 158 | Message Property WorkshopRaiderAttack02Message Auto Const 159 | 160 | Message Property WorkshopRaiderAttack02LoseMessage Auto Const Mandatory 161 | 162 | Message Property WorkshopRaiderAttack02WinMessage Auto Const Mandatory 163 | -------------------------------------------------------------------------------- /Scripts/Source/User/Fragments/Quests/QF_WorkshopRaiderAttack03_001125A6.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopRaiderAttack03_001125A6 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack03Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 47 | else 48 | ; now quest should shutdown when everything unloads 49 | kmyQuest.StopQuestWhenAliasesUnloaded = true 50 | endif 51 | ;END CODE 52 | EndFunction 53 | ;END FRAGMENT 54 | 55 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 56 | Function Fragment_Stage_0020_Item_01() 57 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 58 | Quest __temp = self as Quest 59 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 60 | ;END AUTOCAST 61 | ;BEGIN CODE 62 | kmyQuest.StartAttack() 63 | ;END CODE 64 | EndFunction 65 | ;END FRAGMENT 66 | 67 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 68 | Function Fragment_Stage_0050_Item_00() 69 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 70 | Quest __temp = self as Quest 71 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 72 | ;END AUTOCAST 73 | ;BEGIN CODE 74 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs) 75 | ;END CODE 76 | EndFunction 77 | ;END FRAGMENT 78 | 79 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 80 | Function Fragment_Stage_0100_Item_00() 81 | ;BEGIN AUTOCAST TYPE REScript 82 | Quest __temp = self as Quest 83 | REScript kmyQuest = __temp as REScript 84 | ;END AUTOCAST 85 | ;BEGIN CODE 86 | ; failsafe - make sure registered for cleanup 87 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 88 | SetObjectiveCompleted(10) 89 | ; clear alert value 90 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 91 | ;END CODE 92 | EndFunction 93 | ;END FRAGMENT 94 | 95 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 96 | Function Fragment_Stage_0200_Item_00() 97 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 98 | Quest __temp = self as Quest 99 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 100 | ;END AUTOCAST 101 | ;BEGIN CODE 102 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 103 | ;END CODE 104 | EndFunction 105 | ;END FRAGMENT 106 | 107 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 108 | Function Fragment_Stage_0400_Item_00() 109 | ;BEGIN CODE 110 | ; Make this workshop player owned 111 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 112 | ;END CODE 113 | EndFunction 114 | ;END FRAGMENT 115 | 116 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 117 | Function Fragment_Stage_1000_Item_00() 118 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 119 | Quest __temp = self as Quest 120 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 121 | ;END AUTOCAST 122 | ;BEGIN CODE 123 | ; check to see if attack needs to be resolved by script 124 | ; WSFW - 1.0.8 125 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 126 | 127 | if kmyQuest.CheckResolveAttack() 128 | if IsObjectiveDisplayed(10) 129 | MessageManager.ShowMessage(WorkshopRaiderAttack03LoseMessage) 130 | 131 | ;WorkshopRaiderAttack03LoseMessage.Show() 132 | endif 133 | FailAllObjectives() 134 | else 135 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 136 | MessageManager.ShowMessage(WorkshopRaiderAttack03WinMessage) 137 | 138 | ;WorkshopRaiderAttack03WinMessage.Show() 139 | endif 140 | CompleteAllObjectives() 141 | endif 142 | ; remove everyone from the "grateful" faction 143 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 144 | ; clear alert value 145 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 146 | ;END CODE 147 | EndFunction 148 | ;END FRAGMENT 149 | 150 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 151 | 152 | ReferenceAlias Property Alias_Workshop Auto Const 153 | 154 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 155 | 156 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 157 | 158 | Message Property WorkshopRaiderAttack03Message Auto Const 159 | 160 | Message Property WorkshopRaiderAttack03LoseMessage Auto Const Mandatory 161 | 162 | Message Property WorkshopRaiderAttack03WinMessage Auto Const Mandatory 163 | -------------------------------------------------------------------------------- /Scripts/Source/User/Fragments/Quests/QF_WorkshopRaiderAttack04_000C97A8.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopRaiderAttack04_000C97A8 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack03Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | ; set workshop alert value 47 | Alias_Workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 48 | else 49 | ; now quest should shutdown when everything unloads 50 | kmyQuest.StopQuestWhenAliasesUnloaded = true 51 | endif 52 | ;END CODE 53 | EndFunction 54 | ;END FRAGMENT 55 | 56 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 57 | Function Fragment_Stage_0020_Item_01() 58 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 59 | Quest __temp = self as Quest 60 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 61 | ;END AUTOCAST 62 | ;BEGIN CODE 63 | kmyQuest.StartAttack() 64 | ;END CODE 65 | EndFunction 66 | ;END FRAGMENT 67 | 68 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 69 | Function Fragment_Stage_0050_Item_00() 70 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 71 | Quest __temp = self as Quest 72 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 73 | ;END AUTOCAST 74 | ;BEGIN CODE 75 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, attackFactionValue = 5) 76 | ;END CODE 77 | EndFunction 78 | ;END FRAGMENT 79 | 80 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 81 | Function Fragment_Stage_0100_Item_00() 82 | ;BEGIN AUTOCAST TYPE REScript 83 | Quest __temp = self as Quest 84 | REScript kmyQuest = __temp as REScript 85 | ;END AUTOCAST 86 | ;BEGIN CODE 87 | ; failsafe - make sure registered for cleanup 88 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 89 | SetObjectiveCompleted(10) 90 | ; clear workshop alert value 91 | Alias_Workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 92 | ;END CODE 93 | EndFunction 94 | ;END FRAGMENT 95 | 96 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 97 | Function Fragment_Stage_0200_Item_00() 98 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 99 | Quest __temp = self as Quest 100 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 101 | ;END AUTOCAST 102 | ;BEGIN CODE 103 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 104 | ;END CODE 105 | EndFunction 106 | ;END FRAGMENT 107 | 108 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 109 | Function Fragment_Stage_0400_Item_00() 110 | ;BEGIN CODE 111 | ; Make this workshop player owned 112 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 113 | ;END CODE 114 | EndFunction 115 | ;END FRAGMENT 116 | 117 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 118 | Function Fragment_Stage_1000_Item_00() 119 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 120 | Quest __temp = self as Quest 121 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 122 | ;END AUTOCAST 123 | ;BEGIN CODE 124 | ; check to see if attack needs to be resolved by script 125 | ; WSFW - 1.0.8 126 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 127 | if kmyQuest.CheckResolveAttack() 128 | if IsObjectiveDisplayed(10) 129 | ; WSFW - 1.0.8 130 | MessageManager.ShowMessage(WorkshopGunnerAttack01LoseMessage) 131 | ;WorkshopGunnerAttack01LoseMessage.Show() 132 | endif 133 | FailAllObjectives() 134 | else 135 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 136 | ; WSFW - 1.0.8 137 | MessageManager.ShowMessage(WorkshopGunnerAttack01WinMessage) 138 | ;WorkshopGunnerAttack01WinMessage.Show() 139 | endif 140 | CompleteAllObjectives() 141 | endif 142 | ; remove everyone from the "grateful" faction 143 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 144 | ; clear workshop alert value 145 | Alias_Workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 146 | ;END CODE 147 | EndFunction 148 | ;END FRAGMENT 149 | 150 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 151 | 152 | ReferenceAlias Property Alias_Workshop Auto Const 153 | 154 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 155 | 156 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 157 | 158 | Message Property WorkshopRaiderAttack03Message Auto Const 159 | 160 | Message Property WorkshopGunnerAttack01LoseMessage Auto Const Mandatory 161 | 162 | Message Property WorkshopGunnerAttack01WinMessage Auto Const Mandatory 163 | -------------------------------------------------------------------------------- /Scripts/Source/User/Fragments/Quests/QF_WorkshopSuperMutantAttack_00097CC6.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopSuperMutantAttack_00097CC6 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | ; put hounds into main attacker collection 12 | Alias_Attackers.AddRefCollection(Alias_Hounds) 13 | Alias_Hounds.RemoveAll() 14 | ; 1.3: 87236 - update group size for added hounds 15 | kmyQuest.UpdateDeadCountGroupSize(0, Alias_Attackers.GetCount()) 16 | kmyquest.Startup() 17 | ;END CODE 18 | EndFunction 19 | ;END FRAGMENT 20 | 21 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 22 | Function Fragment_Stage_0010_Item_01() 23 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 24 | Quest __temp = self as Quest 25 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 26 | ;END AUTOCAST 27 | ;BEGIN CODE 28 | ; run timer to expire attack if player doesn't go to location 29 | kmyQuest.StartTimerGameTime(24.0) 30 | ;END CODE 31 | EndFunction 32 | ;END FRAGMENT 33 | 34 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 35 | Function Fragment_Stage_0020_Item_00() 36 | ;BEGIN AUTOCAST TYPE REScript 37 | Quest __temp = self as Quest 38 | REScript kmyQuest = __temp as REScript 39 | ;END AUTOCAST 40 | ;BEGIN CODE 41 | ; reset timer to shorter 42 | CancelTimerGameTime() 43 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 44 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 45 | ; WSFW - 1.0.8 46 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 47 | 48 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 49 | ;WorkshopRaiderAttack03Message.Show() 50 | ;SetObjectiveDisplayed(10) 51 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 52 | else 53 | ; now quest should shutdown when everything unloads 54 | kmyQuest.StopQuestWhenAliasesUnloaded = true 55 | endif 56 | ;END CODE 57 | EndFunction 58 | ;END FRAGMENT 59 | 60 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 61 | Function Fragment_Stage_0020_Item_01() 62 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 63 | Quest __temp = self as Quest 64 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 65 | ;END AUTOCAST 66 | ;BEGIN CODE 67 | kmyQuest.StartAttack() 68 | ;END CODE 69 | EndFunction 70 | ;END FRAGMENT 71 | 72 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 73 | Function Fragment_Stage_0050_Item_00() 74 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 75 | Quest __temp = self as Quest 76 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 77 | ;END AUTOCAST 78 | ;BEGIN CODE 79 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, attackFactionValue = 9) 80 | ;END CODE 81 | EndFunction 82 | ;END FRAGMENT 83 | 84 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 85 | Function Fragment_Stage_0100_Item_00() 86 | ;BEGIN AUTOCAST TYPE REScript 87 | Quest __temp = self as Quest 88 | REScript kmyQuest = __temp as REScript 89 | ;END AUTOCAST 90 | ;BEGIN CODE 91 | ; failsafe - make sure registered for cleanup 92 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 93 | SetObjectiveCompleted(10) 94 | ; clear alert value 95 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 96 | ;END CODE 97 | EndFunction 98 | ;END FRAGMENT 99 | 100 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 101 | Function Fragment_Stage_0200_Item_00() 102 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 103 | Quest __temp = self as Quest 104 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 105 | ;END AUTOCAST 106 | ;BEGIN CODE 107 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 108 | ;END CODE 109 | EndFunction 110 | ;END FRAGMENT 111 | 112 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 113 | Function Fragment_Stage_0400_Item_00() 114 | ;BEGIN CODE 115 | ; Make this workshop player owned 116 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 117 | ;END CODE 118 | EndFunction 119 | ;END FRAGMENT 120 | 121 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 122 | Function Fragment_Stage_1000_Item_00() 123 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 124 | Quest __temp = self as Quest 125 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 126 | ;END AUTOCAST 127 | ;BEGIN CODE 128 | ; check to see if attack needs to be resolved by script 129 | ; WSFW - 1.0.8 130 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 131 | 132 | if kmyQuest.CheckResolveAttack() 133 | if IsObjectiveDisplayed(10) 134 | MessageManager.ShowMessage(WorkshopSuperMutantAttack01LoseMessage) 135 | ; WorkshopSuperMutantAttack01LoseMessage.Show() 136 | endif 137 | FailAllObjectives() 138 | else 139 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 140 | MessageManager.ShowMessage(WorkshopSuperMutantAttack01WinMessage) 141 | ; WorkshopSuperMutantAttack01WinMessage.Show() 142 | endif 143 | CompleteAllObjectives() 144 | endif 145 | ; remove everyone from the "grateful" faction 146 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 147 | ; clear alert value 148 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 149 | ;END CODE 150 | EndFunction 151 | ;END FRAGMENT 152 | 153 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 154 | 155 | ReferenceAlias Property Alias_Workshop Auto Const 156 | 157 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 158 | 159 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 160 | 161 | Message Property WorkshopRaiderAttack03Message Auto Const 162 | 163 | RefCollectionAlias Property Alias_Hounds Auto Const Mandatory 164 | 165 | RefCollectionAlias Property Alias_Attackers Auto Const Mandatory 166 | 167 | Message Property WorkshopSuperMutantAttack01LoseMessage Auto Const Mandatory 168 | 169 | Message Property WorkshopSuperMutantAttack01WinMessage Auto Const Mandatory 170 | -------------------------------------------------------------------------------- /Scripts/Source/User/Fragments/Quests/QF_WorkshopSuperMutantAttack_0024918C.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopSuperMutantAttack_0024918C Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | ; put hounds into main attacker collection 12 | Alias_Attackers.AddRefCollection(Alias_Hounds) 13 | Alias_Hounds.RemoveAll() 14 | ; 1.3: 87236 - update group size for added hounds 15 | kmyQuest.UpdateDeadCountGroupSize(0, Alias_Attackers.GetCount()) 16 | kmyquest.Startup() 17 | ;END CODE 18 | EndFunction 19 | ;END FRAGMENT 20 | 21 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 22 | Function Fragment_Stage_0010_Item_01() 23 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 24 | Quest __temp = self as Quest 25 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 26 | ;END AUTOCAST 27 | ;BEGIN CODE 28 | ; run timer to expire attack if player doesn't go to location 29 | kmyQuest.StartTimerGameTime(24.0) 30 | ;END CODE 31 | EndFunction 32 | ;END FRAGMENT 33 | 34 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 35 | Function Fragment_Stage_0020_Item_00() 36 | ;BEGIN AUTOCAST TYPE REScript 37 | Quest __temp = self as Quest 38 | REScript kmyQuest = __temp as REScript 39 | ;END AUTOCAST 40 | ;BEGIN CODE 41 | ; reset timer to shorter 42 | CancelTimerGameTime() 43 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 44 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 45 | ; WSFW - 1.0.8 46 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 47 | 48 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 49 | ;WorkshopRaiderAttack03Message.Show() 50 | ;SetObjectiveDisplayed(10) 51 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 52 | else 53 | ; now quest should shutdown when everything unloads 54 | kmyQuest.StopQuestWhenAliasesUnloaded = true 55 | endif 56 | ;END CODE 57 | EndFunction 58 | ;END FRAGMENT 59 | 60 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 61 | Function Fragment_Stage_0020_Item_01() 62 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 63 | Quest __temp = self as Quest 64 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 65 | ;END AUTOCAST 66 | ;BEGIN CODE 67 | kmyQuest.StartAttack() 68 | ;END CODE 69 | EndFunction 70 | ;END FRAGMENT 71 | 72 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 73 | Function Fragment_Stage_0050_Item_00() 74 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 75 | Quest __temp = self as Quest 76 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 77 | ;END AUTOCAST 78 | ;BEGIN CODE 79 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, attackFactionValue = 9) 80 | ;END CODE 81 | EndFunction 82 | ;END FRAGMENT 83 | 84 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 85 | Function Fragment_Stage_0100_Item_00() 86 | ;BEGIN AUTOCAST TYPE REScript 87 | Quest __temp = self as Quest 88 | REScript kmyQuest = __temp as REScript 89 | ;END AUTOCAST 90 | ;BEGIN CODE 91 | ; failsafe - make sure registered for cleanup 92 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 93 | SetObjectiveCompleted(10) 94 | ; clear alert value 95 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 96 | ;END CODE 97 | EndFunction 98 | ;END FRAGMENT 99 | 100 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 101 | Function Fragment_Stage_0200_Item_00() 102 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 103 | Quest __temp = self as Quest 104 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 105 | ;END AUTOCAST 106 | ;BEGIN CODE 107 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 108 | ;END CODE 109 | EndFunction 110 | ;END FRAGMENT 111 | 112 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 113 | Function Fragment_Stage_0400_Item_00() 114 | ;BEGIN CODE 115 | ; Make this workshop player owned 116 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 117 | ;END CODE 118 | EndFunction 119 | ;END FRAGMENT 120 | 121 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 122 | Function Fragment_Stage_1000_Item_00() 123 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 124 | Quest __temp = self as Quest 125 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 126 | ;END AUTOCAST 127 | ;BEGIN CODE 128 | ; check to see if attack needs to be resolved by script 129 | ; WSFW - 1.0.8 130 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 131 | 132 | if kmyQuest.CheckResolveAttack() 133 | if IsObjectiveDisplayed(10) 134 | MessageManager.ShowMessage(WorkshopSuperMutantAttack02LoseMessage) 135 | ; WorkshopSuperMutantAttack02LoseMessage.Show() 136 | endif 137 | FailAllObjectives() 138 | else 139 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 140 | MessageManager.ShowMessage(WorkshopSuperMutantAttack02WinMessage) 141 | ; WorkshopSuperMutantAttack02WinMessage.Show() 142 | endif 143 | CompleteAllObjectives() 144 | endif 145 | ; remove everyone from the "grateful" faction 146 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 147 | ; clear alert value 148 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 149 | ;END CODE 150 | EndFunction 151 | ;END FRAGMENT 152 | 153 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 154 | 155 | ReferenceAlias Property Alias_Workshop Auto Const 156 | 157 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 158 | 159 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 160 | 161 | Message Property WorkshopRaiderAttack03Message Auto Const 162 | 163 | RefCollectionAlias Property Alias_Hounds Auto Const Mandatory 164 | 165 | RefCollectionAlias Property Alias_Attackers Auto Const Mandatory 166 | 167 | Message Property WorkshopSuperMutantAttack02LoseMessage Auto Const Mandatory 168 | 169 | Message Property WorkshopSuperMutantAttack02WinMessage Auto Const Mandatory 170 | -------------------------------------------------------------------------------- /Scripts/Source/User/PowerGridTools.psc: -------------------------------------------------------------------------------- 1 | ScriptName PowerGridTools Native Hidden 2 | 3 | ; Checks whether the given workshop reference has power grids with invalid nodes. 4 | bool Function HasBadPowerGrids(ObjectReference akWorkshopRef) native global 5 | 6 | ; Removes power grids with invalid entries from the specified workshop reference. 7 | ; Returns whether any fixes were performed. Returns false if there was nothing to fix. 8 | bool Function FixPowerGrids(ObjectReference akWorkshopRef) native global 9 | 10 | ; Scraps the specified workshop object. 11 | ; If akWorkshopRef is None, the workshop for the settlement that the player is currently in will be used. If Workshop mode is currently active, the currently opened workshop is always used, regardless of the setting. 12 | bool Function Scrap(ObjectReference akRef, ObjectReference akWorkshopRef = None) native global 13 | 14 | ; Stores the specified workshop object in the given workshop. 15 | ; If akWorkshopRef is None, the workshop for the settlement that the player is currently in will be used. If Workshop mode is currently active, the currently opened workshop is always used, regardless of the setting. 16 | bool Function Store(ObjectReference akRef, ObjectReference akWorkshopRef = None) native global 17 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Aliases/ConfigureSpawnedAssaultNPCs.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:Aliases:ConfigureSpawnedAssaultNPCs extends RefCollectionAlias 2 | 3 | Spell Property NeutralAggression Auto Const 4 | Faction Property SettlementFriendlyFaction Auto Const 5 | 6 | Event OnLoad(ObjectReference akSender) 7 | Actor thisActor = akSender as Actor 8 | if(SettlementFriendlyFaction) 9 | thisActor.AddToFaction(SettlementFriendlyFaction) 10 | endif 11 | 12 | if(NeutralAggression) 13 | thisActor.AddSpell(NeutralAggression, abVerbose = false) 14 | endif 15 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Aliases/MonitorAssaultAlias.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:Aliases:MonitorAssaultAlias extends RefCollectionAlias 2 | 3 | Struct PercentStages 4 | Int iPercent 5 | Int iStageToSet 6 | Int iStageRequired = -1 7 | EndStruct 8 | 9 | 10 | Bool Property bOnBleedout = true Auto Const 11 | { Monitor for bleedout as well as death } 12 | Bool Property bDisableBleedoutRecovery = true Auto Const 13 | 14 | PercentStages[] Property StageTriggers Auto Const 15 | { Trigger stages based on percentage, in whole numbers, of the NPCs that are dead or in bleedout (depending on bOnBleedout setting) } 16 | Keyword Property BleedoutRecoveryStopped Auto Const Mandatory 17 | 18 | Event OnDeath(ObjectReference akSenderRef, Actor akKiller) 19 | CheckForStageUpdate() 20 | EndEvent 21 | 22 | 23 | Event OnEnterBleedout(ObjectReference akSenderRef) 24 | CheckForStageUpdate() 25 | 26 | if(bDisableBleedoutRecovery) 27 | (akSenderRef as Actor).SetNoBleedoutRecovery(true) 28 | akSenderRef.AddKeyword(BleedoutRecoveryStopped) 29 | endif 30 | EndEvent 31 | 32 | 33 | Function CheckForStageUpdate() 34 | int i = 0 35 | int iTriggeredCount = 0 36 | int iTotalCount = GetCount() 37 | while(i < iTotalCount) 38 | Actor thisActor = GetAt(i) as Actor 39 | if(thisActor.IsDead() || (bOnBleedout && thisActor.IsBleedingOut())) 40 | iTriggeredCount += 1 41 | endif 42 | 43 | i += 1 44 | endWhile 45 | 46 | Quest thisQuest = GetOwningQuest() 47 | i = 0 48 | 49 | int iTriggeredPercent = ((iTriggeredCount as Float/iTotalCount as Float) as Float * 100) as Int 50 | 51 | while(i < StageTriggers.Length) 52 | ; if((StageTriggers[i].iStageRequired == -1 || thisQuest.GetStageDone(StageTriggers[i].iStageRequired)) && ! thisQuest.GetStageDone(StageTriggers[i].iStageToSet) && iTriggeredPercent >= StageTriggers[i].iPercent) 53 | if((StageTriggers[i].iStageRequired == -1 || thisQuest.GetStageDone(StageTriggers[i].iStageRequired)) && iTriggeredPercent >= StageTriggers[i].iPercent) 54 | thisQuest.SetStage(StageTriggers[i].iStageToSet) 55 | endif 56 | 57 | i += 1 58 | endWhile 59 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Aliases/RemoveFromAliasOnDeath.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:Aliases:RemoveFromAliasOnDeath extends RefCollectionAlias Const 2 | 3 | Event OnDeath(ObjectReference akSenderRef, Actor akKillerRef) 4 | RemoveRef(akSenderRef) 5 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Aliases/RemoveOnDeath.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:Aliases:RemoveOnDeath extends ReferenceAlias 2 | 3 | Keyword Property IdentifierKeyword Auto Const Mandatory 4 | { Make sure this keyword is applied as part of the alias. } 5 | 6 | Event OnDeath(Actor akKiller) 7 | if( ! akKiller) 8 | akKiller = Game.GetPlayer() 9 | endif 10 | 11 | ObjectReference[] IdentifiedRefs = akKiller.FindAllReferencesWithKeyword(IdentifierKeyword, 20000.0) 12 | 13 | int i = 0 14 | while(i < IdentifiedRefs.Length) 15 | if((IdentifiedRefs[i] as Actor).IsDead()) 16 | RemoveFromRef(IdentifiedRefs[i]) 17 | endif 18 | 19 | i += 1 20 | endWhile 21 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Aliases/RemoveSubdueTargetFromAlias.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:Aliases:RemoveSubdueTargetFromAlias extends RefCollectionAlias Const 2 | 3 | RefCollectionAlias Property ForcedSubdueAlias Auto Const Mandatory 4 | { 1.1.1 - When used with Subdue assaults, this will prevent them being stuck in the alias } 5 | 6 | Event OnEnterBleedout(ObjectReference akSenderRef) 7 | if(ForcedSubdueAlias.Find(akSenderRef) >= 0) ; NPC is set to subdue 8 | ; We don't want them left in this 9 | RemoveRef(akSenderRef) 10 | endif 11 | EndEvent 12 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Forms/FormInformation.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; Scriptname WorkshopFramework:Forms:FormInformation.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Forms:FormInformation extends Form Const 15 | 16 | Message Property InformationMessage Auto Const 17 | { Most use cases will expect this to be a message with the Message Box option checked. } -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Forms/RealInventoryProxyItem.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; Scriptname WorkshopFramework:Forms:RealInventoryProxyItem.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Forms:RealInventoryProxyItem extends Form Const 15 | 16 | import WorkshopFramework:Library:DataStructures 17 | 18 | UniversalForm Property DisplayVersion Auto Const 19 | { If set, the form set here will be placed by the Real Inventory Display system instead of the item this script is attached to when found for sale. } -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Perks/PRKF_WSFW_ActivationsPerk_01015131.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname WorkshopFramework:Fragments:Perks:PRKF_WSFW_ActivationsPerk_01015131 Extends Perk Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Entry_00 5 | Function Fragment_Entry_00(ObjectReference akTargetRef, Actor akActor) 6 | ;BEGIN CODE 7 | WSFW_Main.PresentManageSettlementMenu(akTargetRef as WorkshopScript) 8 | ;END CODE 9 | EndFunction 10 | ;END FRAGMENT 11 | 12 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 13 | 14 | WorkshopFramework:MainQuest Property WSFW_Main Auto Const Mandatory 15 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Quests/QF_WorkshopGunnerAttack02_000CFF72.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopGunnerAttack02_000CFF72 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack03Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | ; set workshop alert value 47 | Alias_Workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 48 | else 49 | ; now quest should shutdown when everything unloads 50 | kmyQuest.StopQuestWhenAliasesUnloaded = true 51 | endif 52 | ;END CODE 53 | EndFunction 54 | ;END FRAGMENT 55 | 56 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 57 | Function Fragment_Stage_0020_Item_01() 58 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 59 | Quest __temp = self as Quest 60 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 61 | ;END AUTOCAST 62 | ;BEGIN CODE 63 | kmyQuest.StartAttack() 64 | ;END CODE 65 | EndFunction 66 | ;END FRAGMENT 67 | 68 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 69 | Function Fragment_Stage_0050_Item_00() 70 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 71 | Quest __temp = self as Quest 72 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 73 | ;END AUTOCAST 74 | ;BEGIN CODE 75 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, attackFactionValue = 5) 76 | ;END CODE 77 | EndFunction 78 | ;END FRAGMENT 79 | 80 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 81 | Function Fragment_Stage_0100_Item_00() 82 | ;BEGIN AUTOCAST TYPE REScript 83 | Quest __temp = self as Quest 84 | REScript kmyQuest = __temp as REScript 85 | ;END AUTOCAST 86 | ;BEGIN CODE 87 | ; failsafe - make sure registered for cleanup 88 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 89 | SetObjectiveCompleted(10) 90 | ; clear workshop alert value 91 | Alias_Workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 92 | ;END CODE 93 | EndFunction 94 | ;END FRAGMENT 95 | 96 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 97 | Function Fragment_Stage_0200_Item_00() 98 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 99 | Quest __temp = self as Quest 100 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 101 | ;END AUTOCAST 102 | ;BEGIN CODE 103 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 104 | ;END CODE 105 | EndFunction 106 | ;END FRAGMENT 107 | 108 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 109 | Function Fragment_Stage_0400_Item_00() 110 | ;BEGIN CODE 111 | ; Make this workshop player owned 112 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 113 | ;END CODE 114 | EndFunction 115 | ;END FRAGMENT 116 | 117 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 118 | Function Fragment_Stage_1000_Item_00() 119 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 120 | Quest __temp = self as Quest 121 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 122 | ;END AUTOCAST 123 | ;BEGIN CODE 124 | ; check to see if attack needs to be resolved by script 125 | 126 | ; WSFW - 1.0.8 127 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 128 | 129 | 130 | if kmyQuest.CheckResolveAttack() 131 | if IsObjectiveDisplayed(10) 132 | MessageManager.ShowMessage(WorkshopGunnerAttack02LoseMessage) 133 | 134 | ;WorkshopGunnerAttack02LoseMessage.Show() 135 | endif 136 | FailAllObjectives() 137 | else 138 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 139 | MessageManager.ShowMessage(WorkshopGunnerAttack02WinMessage) 140 | 141 | ;WorkshopGunnerAttack02WinMessage.Show() 142 | endif 143 | CompleteAllObjectives() 144 | endif 145 | ; remove everyone from the "grateful" faction 146 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 147 | ; clear alert value 148 | Alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 149 | ;END CODE 150 | EndFunction 151 | ;END FRAGMENT 152 | 153 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 154 | 155 | ReferenceAlias Property Alias_Workshop Auto Const 156 | 157 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 158 | 159 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 160 | 161 | Message Property WorkshopRaiderAttack03Message Auto Const 162 | 163 | Message Property WorkshopGunnerAttack02LoseMessage Auto Const Mandatory 164 | 165 | Message Property WorkshopGunnerAttack02WinMessage Auto Const Mandatory 166 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Quests/QF_WorkshopMirelurkAttack_SI_002407D0.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopMirelurkAttack_SI_002407D0 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack03Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 47 | else 48 | ; now quest should shutdown when everything unloads 49 | kmyQuest.StopQuestWhenAliasesUnloaded = true 50 | endif 51 | ;END CODE 52 | EndFunction 53 | ;END FRAGMENT 54 | 55 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 56 | Function Fragment_Stage_0020_Item_01() 57 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 58 | Quest __temp = self as Quest 59 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 60 | ;END AUTOCAST 61 | ;BEGIN CODE 62 | kmyQuest.StartAttack() 63 | ;END CODE 64 | EndFunction 65 | ;END FRAGMENT 66 | 67 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 68 | Function Fragment_Stage_0050_Item_00() 69 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 70 | Quest __temp = self as Quest 71 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 72 | ;END AUTOCAST 73 | ;BEGIN CODE 74 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, attackFactionValue = 5) 75 | ;END CODE 76 | EndFunction 77 | ;END FRAGMENT 78 | 79 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 80 | Function Fragment_Stage_0100_Item_00() 81 | ;BEGIN AUTOCAST TYPE REScript 82 | Quest __temp = self as Quest 83 | REScript kmyQuest = __temp as REScript 84 | ;END AUTOCAST 85 | ;BEGIN CODE 86 | ; failsafe - make sure registered for cleanup 87 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 88 | SetObjectiveCompleted(10) 89 | ; clear alert value 90 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 91 | ;END CODE 92 | EndFunction 93 | ;END FRAGMENT 94 | 95 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 96 | Function Fragment_Stage_0200_Item_00() 97 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 98 | Quest __temp = self as Quest 99 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 100 | ;END AUTOCAST 101 | ;BEGIN CODE 102 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 103 | ;END CODE 104 | EndFunction 105 | ;END FRAGMENT 106 | 107 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 108 | Function Fragment_Stage_0400_Item_00() 109 | ;BEGIN CODE 110 | ; Make this workshop player owned 111 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 112 | ;END CODE 113 | EndFunction 114 | ;END FRAGMENT 115 | 116 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 117 | Function Fragment_Stage_1000_Item_00() 118 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 119 | Quest __temp = self as Quest 120 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 121 | ;END AUTOCAST 122 | ;BEGIN CODE 123 | ; check to see if attack needs to be resolved by script 124 | ; WSFW - 1.0.8 125 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 126 | 127 | 128 | if kmyQuest.CheckResolveAttack() 129 | if IsObjectiveDisplayed(10) 130 | MessageManager.ShowMessage(WorkshopMirelurkAttack_SI_LoseMessage) 131 | ;WorkshopMirelurkAttack_SI_LoseMessage.Show() 132 | endif 133 | FailAllObjectives() 134 | else 135 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 136 | MessageManager.ShowMessage(WorkshopMirelurkAttack_SI_WinMessage) 137 | ;WorkshopMirelurkAttack_SI_WinMessage.Show() 138 | endif 139 | CompleteAllObjectives() 140 | endif 141 | ; remove everyone from the "grateful" faction 142 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 143 | ; clear alert value 144 | Alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 145 | ;END CODE 146 | EndFunction 147 | ;END FRAGMENT 148 | 149 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 150 | 151 | ReferenceAlias Property Alias_Workshop Auto Const 152 | 153 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 154 | 155 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 156 | 157 | Message Property WorkshopRaiderAttack03Message Auto Const 158 | 159 | Message Property WorkshopMirelurkAttack_SI_LoseMessage Auto Const Mandatory 160 | 161 | Message Property WorkshopMirelurkAttack_SI_WinMessage Auto Const Mandatory 162 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Quests/QF_WorkshopRaiderAttack01NEW_001125E2.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopRaiderAttack01NEW_001125E2 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack01Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack01Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 47 | else 48 | ; now quest should shutdown when everything unloads 49 | kmyQuest.StopQuestWhenAliasesUnloaded = true 50 | endif 51 | ;END CODE 52 | EndFunction 53 | ;END FRAGMENT 54 | 55 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 56 | Function Fragment_Stage_0020_Item_01() 57 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 58 | Quest __temp = self as Quest 59 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 60 | ;END AUTOCAST 61 | ;BEGIN CODE 62 | kmyQuest.StartAttack() 63 | ;END CODE 64 | EndFunction 65 | ;END FRAGMENT 66 | 67 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 68 | Function Fragment_Stage_0050_Item_00() 69 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 70 | Quest __temp = self as Quest 71 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 72 | ;END AUTOCAST 73 | ;BEGIN CODE 74 | ; put everyone in "grateful" faction 75 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs) 76 | ;END CODE 77 | EndFunction 78 | ;END FRAGMENT 79 | 80 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 81 | Function Fragment_Stage_0100_Item_00() 82 | ;BEGIN AUTOCAST TYPE REScript 83 | Quest __temp = self as Quest 84 | REScript kmyQuest = __temp as REScript 85 | ;END AUTOCAST 86 | ;BEGIN CODE 87 | ; failsafe - make sure registered for cleanup 88 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 89 | SetObjectiveCompleted(10) 90 | ; clear alert value 91 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 92 | ;END CODE 93 | EndFunction 94 | ;END FRAGMENT 95 | 96 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 97 | Function Fragment_Stage_0200_Item_00() 98 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 99 | Quest __temp = self as Quest 100 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 101 | ;END AUTOCAST 102 | ;BEGIN CODE 103 | ; remove everyone from the "grateful" faction 104 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 105 | ;END CODE 106 | EndFunction 107 | ;END FRAGMENT 108 | 109 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 110 | Function Fragment_Stage_0400_Item_00() 111 | ;BEGIN CODE 112 | ; Make this workshop player owned 113 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 114 | ;END CODE 115 | EndFunction 116 | ;END FRAGMENT 117 | 118 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 119 | Function Fragment_Stage_1000_Item_00() 120 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 121 | Quest __temp = self as Quest 122 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 123 | ;END AUTOCAST 124 | ;BEGIN CODE 125 | ; check to see if attack needs to be resolved by script 126 | ; WSFW - 1.0.8 127 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 128 | 129 | if kmyQuest.CheckResolveAttack() 130 | if IsObjectiveDisplayed(10) 131 | MessageManager.ShowMessage(WorkshopRaiderAttack01LoseMessage) 132 | ;WorkshopRaiderAttack01LoseMessage.Show() 133 | endif 134 | FailAllObjectives() 135 | else 136 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 137 | MessageManager.ShowMessage(WorkshopRaiderAttack01WinMessage) 138 | ;WorkshopRaiderAttack01WinMessage.Show() 139 | endif 140 | CompleteAllObjectives() 141 | endif 142 | ; remove everyone from the "grateful" faction 143 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 144 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 145 | ;END CODE 146 | EndFunction 147 | ;END FRAGMENT 148 | 149 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 150 | 151 | ReferenceAlias Property Alias_Workshop Auto Const 152 | 153 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 154 | 155 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 156 | 157 | Message Property WorkshopRaiderAttack01Message Auto Const 158 | 159 | Message Property WorkshopRaiderAttack01LoseMessage Auto Const Mandatory 160 | 161 | Message Property WorkshopRaiderAttack01WinMessage Auto Const Mandatory 162 | 163 | Message Property WorkshopSuperMutantAttack01LoseMessage Auto Const Mandatory 164 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Quests/QF_WorkshopRaiderAttack02NEW_001125E3.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopRaiderAttack02NEW_001125E3 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack02Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack02Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 47 | else 48 | ; now quest should shutdown when everything unloads 49 | kmyQuest.StopQuestWhenAliasesUnloaded = true 50 | endif 51 | ;END CODE 52 | EndFunction 53 | ;END FRAGMENT 54 | 55 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 56 | Function Fragment_Stage_0020_Item_01() 57 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 58 | Quest __temp = self as Quest 59 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 60 | ;END AUTOCAST 61 | ;BEGIN CODE 62 | kmyQuest.StartAttack() 63 | ;END CODE 64 | EndFunction 65 | ;END FRAGMENT 66 | 67 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 68 | Function Fragment_Stage_0050_Item_00() 69 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 70 | Quest __temp = self as Quest 71 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 72 | ;END AUTOCAST 73 | ;BEGIN CODE 74 | ; put everyone in "grateful" faction 75 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs) 76 | ;END CODE 77 | EndFunction 78 | ;END FRAGMENT 79 | 80 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 81 | Function Fragment_Stage_0100_Item_00() 82 | ;BEGIN AUTOCAST TYPE REScript 83 | Quest __temp = self as Quest 84 | REScript kmyQuest = __temp as REScript 85 | ;END AUTOCAST 86 | ;BEGIN CODE 87 | ; failsafe - make sure registered for cleanup 88 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 89 | SetObjectiveCompleted(10) 90 | ; clear alert value 91 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 92 | ;END CODE 93 | EndFunction 94 | ;END FRAGMENT 95 | 96 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 97 | Function Fragment_Stage_0200_Item_00() 98 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 99 | Quest __temp = self as Quest 100 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 101 | ;END AUTOCAST 102 | ;BEGIN CODE 103 | ; remove everyone from the "grateful" faction 104 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 105 | ;END CODE 106 | EndFunction 107 | ;END FRAGMENT 108 | 109 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 110 | Function Fragment_Stage_0400_Item_00() 111 | ;BEGIN CODE 112 | ; Make this workshop player owned 113 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 114 | ;END CODE 115 | EndFunction 116 | ;END FRAGMENT 117 | 118 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 119 | Function Fragment_Stage_1000_Item_00() 120 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 121 | Quest __temp = self as Quest 122 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 123 | ;END AUTOCAST 124 | ;BEGIN CODE 125 | ; check to see if attack needs to be resolved by script 126 | ; WSFW - 1.0.8 127 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 128 | 129 | if kmyQuest.CheckResolveAttack() 130 | if IsObjectiveDisplayed(10) 131 | MessageManager.ShowMessage(WorkshopRaiderAttack02LoseMessage) 132 | ;WorkshopRaiderAttack02LoseMessage.Show() 133 | endif 134 | FailAllObjectives() 135 | else 136 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 137 | MessageManager.ShowMessage(WorkshopRaiderAttack02WinMessage) 138 | ;WorkshopRaiderAttack02WinMessage.Show() 139 | endif 140 | CompleteAllObjectives() 141 | endif 142 | ; remove everyone from the "grateful" faction 143 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 144 | ; clear alert value 145 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 146 | ;END CODE 147 | EndFunction 148 | ;END FRAGMENT 149 | 150 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 151 | 152 | ReferenceAlias Property Alias_Workshop Auto Const 153 | 154 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 155 | 156 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 157 | 158 | Message Property WorkshopRaiderAttack02Message Auto Const 159 | 160 | Message Property WorkshopRaiderAttack02LoseMessage Auto Const Mandatory 161 | 162 | Message Property WorkshopRaiderAttack02WinMessage Auto Const Mandatory 163 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Quests/QF_WorkshopRaiderAttack03_001125A6.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopRaiderAttack03_001125A6 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack03Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 47 | else 48 | ; now quest should shutdown when everything unloads 49 | kmyQuest.StopQuestWhenAliasesUnloaded = true 50 | endif 51 | ;END CODE 52 | EndFunction 53 | ;END FRAGMENT 54 | 55 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 56 | Function Fragment_Stage_0020_Item_01() 57 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 58 | Quest __temp = self as Quest 59 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 60 | ;END AUTOCAST 61 | ;BEGIN CODE 62 | kmyQuest.StartAttack() 63 | ;END CODE 64 | EndFunction 65 | ;END FRAGMENT 66 | 67 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 68 | Function Fragment_Stage_0050_Item_00() 69 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 70 | Quest __temp = self as Quest 71 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 72 | ;END AUTOCAST 73 | ;BEGIN CODE 74 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs) 75 | ;END CODE 76 | EndFunction 77 | ;END FRAGMENT 78 | 79 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 80 | Function Fragment_Stage_0100_Item_00() 81 | ;BEGIN AUTOCAST TYPE REScript 82 | Quest __temp = self as Quest 83 | REScript kmyQuest = __temp as REScript 84 | ;END AUTOCAST 85 | ;BEGIN CODE 86 | ; failsafe - make sure registered for cleanup 87 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 88 | SetObjectiveCompleted(10) 89 | ; clear alert value 90 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 91 | ;END CODE 92 | EndFunction 93 | ;END FRAGMENT 94 | 95 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 96 | Function Fragment_Stage_0200_Item_00() 97 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 98 | Quest __temp = self as Quest 99 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 100 | ;END AUTOCAST 101 | ;BEGIN CODE 102 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 103 | ;END CODE 104 | EndFunction 105 | ;END FRAGMENT 106 | 107 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 108 | Function Fragment_Stage_0400_Item_00() 109 | ;BEGIN CODE 110 | ; Make this workshop player owned 111 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 112 | ;END CODE 113 | EndFunction 114 | ;END FRAGMENT 115 | 116 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 117 | Function Fragment_Stage_1000_Item_00() 118 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 119 | Quest __temp = self as Quest 120 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 121 | ;END AUTOCAST 122 | ;BEGIN CODE 123 | ; check to see if attack needs to be resolved by script 124 | ; WSFW - 1.0.8 125 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 126 | 127 | if kmyQuest.CheckResolveAttack() 128 | if IsObjectiveDisplayed(10) 129 | MessageManager.ShowMessage(WorkshopRaiderAttack03LoseMessage) 130 | 131 | ;WorkshopRaiderAttack03LoseMessage.Show() 132 | endif 133 | FailAllObjectives() 134 | else 135 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 136 | MessageManager.ShowMessage(WorkshopRaiderAttack03WinMessage) 137 | 138 | ;WorkshopRaiderAttack03WinMessage.Show() 139 | endif 140 | CompleteAllObjectives() 141 | endif 142 | ; remove everyone from the "grateful" faction 143 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 144 | ; clear alert value 145 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 146 | ;END CODE 147 | EndFunction 148 | ;END FRAGMENT 149 | 150 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 151 | 152 | ReferenceAlias Property Alias_Workshop Auto Const 153 | 154 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 155 | 156 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 157 | 158 | Message Property WorkshopRaiderAttack03Message Auto Const 159 | 160 | Message Property WorkshopRaiderAttack03LoseMessage Auto Const Mandatory 161 | 162 | Message Property WorkshopRaiderAttack03WinMessage Auto Const Mandatory 163 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Quests/QF_WorkshopRaiderAttack04_000C97A8.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopRaiderAttack04_000C97A8 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | kmyquest.Startup() 12 | ;END CODE 13 | EndFunction 14 | ;END FRAGMENT 15 | 16 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 17 | Function Fragment_Stage_0010_Item_01() 18 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 19 | Quest __temp = self as Quest 20 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 21 | ;END AUTOCAST 22 | ;BEGIN CODE 23 | ; run timer to expire attack if player doesn't go to location 24 | kmyQuest.StartTimerGameTime(24.0) 25 | ;END CODE 26 | EndFunction 27 | ;END FRAGMENT 28 | 29 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 30 | Function Fragment_Stage_0020_Item_00() 31 | ;BEGIN AUTOCAST TYPE REScript 32 | Quest __temp = self as Quest 33 | REScript kmyQuest = __temp as REScript 34 | ;END AUTOCAST 35 | ;BEGIN CODE 36 | ; reset timer to shorter 37 | CancelTimerGameTime() 38 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 39 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 40 | ; WSFW - 1.0.8 41 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 42 | 43 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 44 | ;WorkshopRaiderAttack03Message.Show() 45 | ;SetObjectiveDisplayed(10) 46 | ; set workshop alert value 47 | Alias_Workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 48 | else 49 | ; now quest should shutdown when everything unloads 50 | kmyQuest.StopQuestWhenAliasesUnloaded = true 51 | endif 52 | ;END CODE 53 | EndFunction 54 | ;END FRAGMENT 55 | 56 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 57 | Function Fragment_Stage_0020_Item_01() 58 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 59 | Quest __temp = self as Quest 60 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 61 | ;END AUTOCAST 62 | ;BEGIN CODE 63 | kmyQuest.StartAttack() 64 | ;END CODE 65 | EndFunction 66 | ;END FRAGMENT 67 | 68 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 69 | Function Fragment_Stage_0050_Item_00() 70 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 71 | Quest __temp = self as Quest 72 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 73 | ;END AUTOCAST 74 | ;BEGIN CODE 75 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, attackFactionValue = 5) 76 | ;END CODE 77 | EndFunction 78 | ;END FRAGMENT 79 | 80 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 81 | Function Fragment_Stage_0100_Item_00() 82 | ;BEGIN AUTOCAST TYPE REScript 83 | Quest __temp = self as Quest 84 | REScript kmyQuest = __temp as REScript 85 | ;END AUTOCAST 86 | ;BEGIN CODE 87 | ; failsafe - make sure registered for cleanup 88 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 89 | SetObjectiveCompleted(10) 90 | ; clear workshop alert value 91 | Alias_Workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 92 | ;END CODE 93 | EndFunction 94 | ;END FRAGMENT 95 | 96 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 97 | Function Fragment_Stage_0200_Item_00() 98 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 99 | Quest __temp = self as Quest 100 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 101 | ;END AUTOCAST 102 | ;BEGIN CODE 103 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 104 | ;END CODE 105 | EndFunction 106 | ;END FRAGMENT 107 | 108 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 109 | Function Fragment_Stage_0400_Item_00() 110 | ;BEGIN CODE 111 | ; Make this workshop player owned 112 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 113 | ;END CODE 114 | EndFunction 115 | ;END FRAGMENT 116 | 117 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 118 | Function Fragment_Stage_1000_Item_00() 119 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 120 | Quest __temp = self as Quest 121 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 122 | ;END AUTOCAST 123 | ;BEGIN CODE 124 | ; check to see if attack needs to be resolved by script 125 | ; WSFW - 1.0.8 126 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 127 | if kmyQuest.CheckResolveAttack() 128 | if IsObjectiveDisplayed(10) 129 | ; WSFW - 1.0.8 130 | MessageManager.ShowMessage(WorkshopGunnerAttack01LoseMessage) 131 | ;WorkshopGunnerAttack01LoseMessage.Show() 132 | endif 133 | FailAllObjectives() 134 | else 135 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 136 | ; WSFW - 1.0.8 137 | MessageManager.ShowMessage(WorkshopGunnerAttack01WinMessage) 138 | ;WorkshopGunnerAttack01WinMessage.Show() 139 | endif 140 | CompleteAllObjectives() 141 | endif 142 | ; remove everyone from the "grateful" faction 143 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 144 | ; clear workshop alert value 145 | Alias_Workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 146 | ;END CODE 147 | EndFunction 148 | ;END FRAGMENT 149 | 150 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 151 | 152 | ReferenceAlias Property Alias_Workshop Auto Const 153 | 154 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 155 | 156 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 157 | 158 | Message Property WorkshopRaiderAttack03Message Auto Const 159 | 160 | Message Property WorkshopGunnerAttack01LoseMessage Auto Const Mandatory 161 | 162 | Message Property WorkshopGunnerAttack01WinMessage Auto Const Mandatory 163 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Quests/QF_WorkshopSuperMutantAttack_00097CC6.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname Fragments:Quests:QF_WorkshopSuperMutantAttack_00097CC6 Extends Quest Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00 5 | Function Fragment_Stage_0010_Item_00() 6 | ;BEGIN AUTOCAST TYPE REScript 7 | Quest __temp = self as Quest 8 | REScript kmyQuest = __temp as REScript 9 | ;END AUTOCAST 10 | ;BEGIN CODE 11 | ; put hounds into main attacker collection 12 | Alias_Attackers.AddRefCollection(Alias_Hounds) 13 | Alias_Hounds.RemoveAll() 14 | ; 1.3: 87236 - update group size for added hounds 15 | kmyQuest.UpdateDeadCountGroupSize(0, Alias_Attackers.GetCount()) 16 | kmyquest.Startup() 17 | ;END CODE 18 | EndFunction 19 | ;END FRAGMENT 20 | 21 | ;BEGIN FRAGMENT Fragment_Stage_0010_Item_01 22 | Function Fragment_Stage_0010_Item_01() 23 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 24 | Quest __temp = self as Quest 25 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 26 | ;END AUTOCAST 27 | ;BEGIN CODE 28 | ; run timer to expire attack if player doesn't go to location 29 | kmyQuest.StartTimerGameTime(24.0) 30 | ;END CODE 31 | EndFunction 32 | ;END FRAGMENT 33 | 34 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_00 35 | Function Fragment_Stage_0020_Item_00() 36 | ;BEGIN AUTOCAST TYPE REScript 37 | Quest __temp = self as Quest 38 | REScript kmyQuest = __temp as REScript 39 | ;END AUTOCAST 40 | ;BEGIN CODE 41 | ; reset timer to shorter 42 | CancelTimerGameTime() 43 | workshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 44 | if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer 45 | ; WSFW - 1.0.8 46 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 47 | 48 | MessageManager.ShowMessage(WorkshopRaiderAttack03Message, akQuestRef = kmyQuest, aiObjectiveID = 10, aiStageCheck = 100) 49 | ;WorkshopRaiderAttack03Message.Show() 50 | ;SetObjectiveDisplayed(10) 51 | workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1) 52 | else 53 | ; now quest should shutdown when everything unloads 54 | kmyQuest.StopQuestWhenAliasesUnloaded = true 55 | endif 56 | ;END CODE 57 | EndFunction 58 | ;END FRAGMENT 59 | 60 | ;BEGIN FRAGMENT Fragment_Stage_0020_Item_01 61 | Function Fragment_Stage_0020_Item_01() 62 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 63 | Quest __temp = self as Quest 64 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 65 | ;END AUTOCAST 66 | ;BEGIN CODE 67 | kmyQuest.StartAttack() 68 | ;END CODE 69 | EndFunction 70 | ;END FRAGMENT 71 | 72 | ;BEGIN FRAGMENT Fragment_Stage_0050_Item_00 73 | Function Fragment_Stage_0050_Item_00() 74 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 75 | Quest __temp = self as Quest 76 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 77 | ;END AUTOCAST 78 | ;BEGIN CODE 79 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, attackFactionValue = 9) 80 | ;END CODE 81 | EndFunction 82 | ;END FRAGMENT 83 | 84 | ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00 85 | Function Fragment_Stage_0100_Item_00() 86 | ;BEGIN AUTOCAST TYPE REScript 87 | Quest __temp = self as Quest 88 | REScript kmyQuest = __temp as REScript 89 | ;END AUTOCAST 90 | ;BEGIN CODE 91 | ; failsafe - make sure registered for cleanup 92 | kmyQuest.RegisterForCustomEvent(kmyQuest.REParent, "RECheckForCleanup") 93 | SetObjectiveCompleted(10) 94 | ; clear alert value 95 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 96 | ;END CODE 97 | EndFunction 98 | ;END FRAGMENT 99 | 100 | ;BEGIN FRAGMENT Fragment_Stage_0200_Item_00 101 | Function Fragment_Stage_0200_Item_00() 102 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 103 | Quest __temp = self as Quest 104 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 105 | ;END AUTOCAST 106 | ;BEGIN CODE 107 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 108 | ;END CODE 109 | EndFunction 110 | ;END FRAGMENT 111 | 112 | ;BEGIN FRAGMENT Fragment_Stage_0400_Item_00 113 | Function Fragment_Stage_0400_Item_00() 114 | ;BEGIN CODE 115 | ; Make this workshop player owned 116 | (Alias_Workshop.GetRef() as WorkshopScript).SetOwnedByPlayer(true) 117 | ;END CODE 118 | EndFunction 119 | ;END FRAGMENT 120 | 121 | ;BEGIN FRAGMENT Fragment_Stage_1000_Item_00 122 | Function Fragment_Stage_1000_Item_00() 123 | ;BEGIN AUTOCAST TYPE WorkshopAttackScript 124 | Quest __temp = self as Quest 125 | WorkshopAttackScript kmyQuest = __temp as WorkshopAttackScript 126 | ;END AUTOCAST 127 | ;BEGIN CODE 128 | ; check to see if attack needs to be resolved by script 129 | ; WSFW - 1.0.8 130 | WorkshopFramework:MessageManager MessageManager = Game.GetFormFromFile(0x000092C5, "WorkshopFramework.esm") as WorkshopFramework:MessageManager 131 | 132 | if kmyQuest.CheckResolveAttack() 133 | if IsObjectiveDisplayed(10) 134 | MessageManager.ShowMessage(WorkshopSuperMutantAttack01LoseMessage) 135 | ; WorkshopSuperMutantAttack01LoseMessage.Show() 136 | endif 137 | FailAllObjectives() 138 | else 139 | if IsObjectiveDisplayed(10) && IsObjectiveCompleted(10) == false 140 | MessageManager.ShowMessage(WorkshopSuperMutantAttack01WinMessage) 141 | ; WorkshopSuperMutantAttack01WinMessage.Show() 142 | endif 143 | CompleteAllObjectives() 144 | endif 145 | ; remove everyone from the "grateful" faction 146 | kmyQuest.AddToGratefulFaction(Alias_SettlementSpokesman, Alias_SettlementNPCs, false) 147 | ; clear alert value 148 | alias_workshop.TryToSetValue(kmyQuest.REParent.WorkshopActorAlert, 0) 149 | ;END CODE 150 | EndFunction 151 | ;END FRAGMENT 152 | 153 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 154 | 155 | ReferenceAlias Property Alias_Workshop Auto Const 156 | 157 | ReferenceAlias Property Alias_SettlementSpokesman Auto Const 158 | 159 | RefCollectionAlias Property Alias_SettlementNPCs Auto Const 160 | 161 | Message Property WorkshopRaiderAttack03Message Auto Const 162 | 163 | RefCollectionAlias Property Alias_Hounds Auto Const Mandatory 164 | 165 | RefCollectionAlias Property Alias_Attackers Auto Const Mandatory 166 | 167 | Message Property WorkshopSuperMutantAttack01LoseMessage Auto Const Mandatory 168 | 169 | Message Property WorkshopSuperMutantAttack01WinMessage Auto Const Mandatory 170 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Terminals/TERM_WSFW_Messages_Menu.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname WorkshopFramework:Fragments:Terminals:TERM_WSFW_Messages_Menu Extends Terminal Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Terminal_01 5 | Function Fragment_Terminal_01(ObjectReference akTerminalRef) 6 | ;BEGIN CODE 7 | MessageManager.DisplayNextQueuedMessage() 8 | ;END CODE 9 | EndFunction 10 | ;END FRAGMENT 11 | 12 | ;BEGIN FRAGMENT Fragment_Terminal_02 13 | Function Fragment_Terminal_02(ObjectReference akTerminalRef) 14 | ;BEGIN CODE 15 | MessageManager.DisplayAllQueuedMessages() 16 | ;END CODE 17 | EndFunction 18 | ;END FRAGMENT 19 | 20 | ;BEGIN FRAGMENT Fragment_Terminal_03 21 | Function Fragment_Terminal_03(ObjectReference akTerminalRef) 22 | ;BEGIN CODE 23 | MessageManager.ClearAllQueuedMessages() 24 | ;END CODE 25 | EndFunction 26 | ;END FRAGMENT 27 | 28 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 29 | 30 | WorkshopFramework:MessageManager Property MessageManager Auto Const Mandatory 31 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Terminals/TERM_WSFW_Options_Menu_Activ_010158CE.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname WorkshopFramework:Fragments:Terminals:TERM_WSFW_Options_Menu_Activ_010158CE Extends Terminal Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Terminal_01 5 | Function Fragment_Terminal_01(ObjectReference akTerminalRef) 6 | ;BEGIN CODE 7 | WSFW_AlternateActivation_Workshop.SetValueInt(0) 8 | ;END CODE 9 | EndFunction 10 | ;END FRAGMENT 11 | 12 | ;BEGIN FRAGMENT Fragment_Terminal_02 13 | Function Fragment_Terminal_02(ObjectReference akTerminalRef) 14 | ;BEGIN CODE 15 | WSFW_AlternateActivation_Workshop.SetValueInt(1) 16 | ;END CODE 17 | EndFunction 18 | ;END FRAGMENT 19 | 20 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 21 | 22 | GlobalVariable Property WSFW_AlternateActivation_Workshop Auto Const Mandatory 23 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Terminals/TERM_WSFW_Options_Menu_Advan_0101BBB0.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname WorkshopFramework:Fragments:Terminals:TERM_WSFW_Options_Menu_Advan_0101BBB0 Extends Terminal Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Terminal_01 5 | Function Fragment_Terminal_01(ObjectReference akTerminalRef) 6 | ;BEGIN CODE 7 | ThreadManager.MCM_ChangeMaxThreads(10) 8 | ;END CODE 9 | EndFunction 10 | ;END FRAGMENT 11 | 12 | ;BEGIN FRAGMENT Fragment_Terminal_02 13 | Function Fragment_Terminal_02(ObjectReference akTerminalRef) 14 | ;BEGIN CODE 15 | ThreadManager.MCM_ChangeMaxThreads(15) 16 | ;END CODE 17 | EndFunction 18 | ;END FRAGMENT 19 | 20 | ;BEGIN FRAGMENT Fragment_Terminal_03 21 | Function Fragment_Terminal_03(ObjectReference akTerminalRef) 22 | ;BEGIN CODE 23 | ThreadManager.MCM_ChangeMaxThreads(20) 24 | ;END CODE 25 | EndFunction 26 | ;END FRAGMENT 27 | 28 | ;BEGIN FRAGMENT Fragment_Terminal_04 29 | Function Fragment_Terminal_04(ObjectReference akTerminalRef) 30 | ;BEGIN CODE 31 | ThreadManager.MCM_ChangeMaxThreads(25) 32 | ;END CODE 33 | EndFunction 34 | ;END FRAGMENT 35 | 36 | ;BEGIN FRAGMENT Fragment_Terminal_05 37 | Function Fragment_Terminal_05(ObjectReference akTerminalRef) 38 | ;BEGIN CODE 39 | ThreadManager.MCM_ChangeMaxThreads(30) 40 | ;END CODE 41 | EndFunction 42 | ;END FRAGMENT 43 | 44 | ;BEGIN FRAGMENT Fragment_Terminal_06 45 | Function Fragment_Terminal_06(ObjectReference akTerminalRef) 46 | ;BEGIN CODE 47 | ThreadManager.MCM_ChangeMaxThreads(35) 48 | ;END CODE 49 | EndFunction 50 | ;END FRAGMENT 51 | 52 | ;BEGIN FRAGMENT Fragment_Terminal_07 53 | Function Fragment_Terminal_07(ObjectReference akTerminalRef) 54 | ;BEGIN CODE 55 | ThreadManager.MCM_ChangeMaxThreads(40) 56 | ;END CODE 57 | EndFunction 58 | ;END FRAGMENT 59 | 60 | ;BEGIN FRAGMENT Fragment_Terminal_08 61 | Function Fragment_Terminal_08(ObjectReference akTerminalRef) 62 | ;BEGIN CODE 63 | ThreadManager.MCM_ChangeMaxThreads(45) 64 | ;END CODE 65 | EndFunction 66 | ;END FRAGMENT 67 | 68 | ;BEGIN FRAGMENT Fragment_Terminal_09 69 | Function Fragment_Terminal_09(ObjectReference akTerminalRef) 70 | ;BEGIN CODE 71 | ThreadManager.MCM_ChangeMaxThreads(50) 72 | ;END CODE 73 | EndFunction 74 | ;END FRAGMENT 75 | 76 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 77 | WorkshopFramework:MainThreadManager Property ThreadManager Auto Const Mandatory 78 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Terminals/TERM_WSFW_Options_Menu_DoorM_0101E2D8.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname WorkshopFramework:Fragments:Terminals:TERM_WSFW_Options_Menu_DoorM_0101E2D8 Extends Terminal Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Terminal_01 5 | Function Fragment_Terminal_01(ObjectReference akTerminalRef) 6 | ;BEGIN CODE 7 | WSFW_Setting_DoorManagement.SetValueInt(0) 8 | DoorManager.SettingsUpdated() 9 | ;END CODE 10 | EndFunction 11 | ;END FRAGMENT 12 | 13 | ;BEGIN FRAGMENT Fragment_Terminal_02 14 | Function Fragment_Terminal_02(ObjectReference akTerminalRef) 15 | ;BEGIN CODE 16 | WSFW_Setting_DoorManagement.SetValueInt(1) 17 | DoorManager.SettingsUpdated() 18 | ;END CODE 19 | EndFunction 20 | ;END FRAGMENT 21 | 22 | ;BEGIN FRAGMENT Fragment_Terminal_03 23 | Function Fragment_Terminal_03(ObjectReference akTerminalRef) 24 | ;BEGIN CODE 25 | WSFW_Setting_DoorManagement_AutoCloseOpenedByPlayer.SetValueInt(0) 26 | DoorManager.SettingsUpdated() 27 | ;END CODE 28 | EndFunction 29 | ;END FRAGMENT 30 | 31 | ;BEGIN FRAGMENT Fragment_Terminal_04 32 | Function Fragment_Terminal_04(ObjectReference akTerminalRef) 33 | ;BEGIN CODE 34 | WSFW_Setting_DoorManagement_AutoCloseOpenedByPlayer.SetValueInt(1) 35 | DoorManager.SettingsUpdated() 36 | ;END CODE 37 | EndFunction 38 | ;END FRAGMENT 39 | 40 | ;BEGIN FRAGMENT Fragment_Terminal_05 41 | Function Fragment_Terminal_05(ObjectReference akTerminalRef) 42 | ;BEGIN CODE 43 | WSFW_Setting_DoorManagement_AutoCloseOpenedByNPCs.SetValueInt(0) 44 | DoorManager.SettingsUpdated() 45 | ;END CODE 46 | EndFunction 47 | ;END FRAGMENT 48 | 49 | ;BEGIN FRAGMENT Fragment_Terminal_06 50 | Function Fragment_Terminal_06(ObjectReference akTerminalRef) 51 | ;BEGIN CODE 52 | WSFW_Setting_DoorManagement_AutoCloseOpenedByNPCs.SetValueInt(1) 53 | DoorManager.SettingsUpdated() 54 | ;END CODE 55 | EndFunction 56 | ;END FRAGMENT 57 | 58 | ;BEGIN FRAGMENT Fragment_Terminal_07 59 | Function Fragment_Terminal_07(ObjectReference akTerminalRef) 60 | ;BEGIN CODE 61 | WSFW_Setting_DoorManagement_AutoOpenOnWSEnter.SetValueInt(0) 62 | DoorManager.SettingsUpdated() 63 | ;END CODE 64 | EndFunction 65 | ;END FRAGMENT 66 | 67 | ;BEGIN FRAGMENT Fragment_Terminal_08 68 | Function Fragment_Terminal_08(ObjectReference akTerminalRef) 69 | ;BEGIN CODE 70 | WSFW_Setting_DoorManagement_AutoOpenOnWSEnter.SetValueInt(1) 71 | DoorManager.SettingsUpdated() 72 | ;END CODE 73 | EndFunction 74 | ;END FRAGMENT 75 | 76 | ;BEGIN FRAGMENT Fragment_Terminal_09 77 | Function Fragment_Terminal_09(ObjectReference akTerminalRef) 78 | ;BEGIN CODE 79 | WSFW_Setting_DoorManagement_AutoCloseOnWSExit.SetValueInt(0) 80 | DoorManager.SettingsUpdated() 81 | ;END CODE 82 | EndFunction 83 | ;END FRAGMENT 84 | 85 | ;BEGIN FRAGMENT Fragment_Terminal_10 86 | Function Fragment_Terminal_10(ObjectReference akTerminalRef) 87 | ;BEGIN CODE 88 | WSFW_Setting_DoorManagement_AutoCloseOnWSExit.SetValueInt(1) 89 | DoorManager.SettingsUpdated() 90 | ;END CODE 91 | EndFunction 92 | ;END FRAGMENT 93 | 94 | ;BEGIN FRAGMENT Fragment_Terminal_11 95 | Function Fragment_Terminal_11(ObjectReference akTerminalRef) 96 | ;BEGIN CODE 97 | WSFW_Setting_DoorManagement_AutoCloseTime.SetValueInt(10) 98 | DoorManager.SettingsUpdated() 99 | ;END CODE 100 | EndFunction 101 | ;END FRAGMENT 102 | 103 | ;BEGIN FRAGMENT Fragment_Terminal_12 104 | Function Fragment_Terminal_12(ObjectReference akTerminalRef) 105 | ;BEGIN CODE 106 | WSFW_Setting_DoorManagement_AutoCloseTime.SetValueInt(15) 107 | DoorManager.SettingsUpdated() 108 | ;END CODE 109 | EndFunction 110 | ;END FRAGMENT 111 | 112 | ;BEGIN FRAGMENT Fragment_Terminal_13 113 | Function Fragment_Terminal_13(ObjectReference akTerminalRef) 114 | ;BEGIN CODE 115 | WSFW_Setting_DoorManagement_AutoCloseTime.SetValueInt(5) 116 | DoorManager.SettingsUpdated() 117 | ;END CODE 118 | EndFunction 119 | ;END FRAGMENT 120 | 121 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 122 | 123 | 124 | WorkshopFramework:Quests:DoorManager Property DoorManager Auto Const Mandatory 125 | 126 | GlobalVariable Property WSFW_Setting_DoorManagement Auto Const Mandatory 127 | 128 | GlobalVariable Property WSFW_Setting_DoorManagement_AutoCloseOnWSExit Auto Const Mandatory 129 | 130 | GlobalVariable Property WSFW_Setting_DoorManagement_AutoCloseOpenedByNPCs Auto Const Mandatory 131 | 132 | GlobalVariable Property WSFW_Setting_DoorManagement_AutoCloseOpenedByPlayer Auto Const Mandatory 133 | 134 | GlobalVariable Property WSFW_Setting_DoorManagement_AutoCloseTime Auto Const Mandatory 135 | 136 | GlobalVariable Property WSFW_Setting_DoorManagement_AutoOpenOnWSEnter Auto Const Mandatory 137 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Terminals/TERM_WSFW_Options_Menu_Messa_010082CB.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname WorkshopFramework:Fragments:Terminals:TERM_WSFW_Options_Menu_Messa_010082CB Extends Terminal Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Terminal_01 5 | Function Fragment_Terminal_01(ObjectReference akTerminalRef) 6 | ;BEGIN CODE 7 | Setting_AutoPlayMessages.SetValue(0) 8 | ;END CODE 9 | EndFunction 10 | ;END FRAGMENT 11 | 12 | ;BEGIN FRAGMENT Fragment_Terminal_02 13 | Function Fragment_Terminal_02(ObjectReference akTerminalRef) 14 | ;BEGIN CODE 15 | Setting_AutoPlayMessages.SetValue(1.0) 16 | ;END CODE 17 | EndFunction 18 | ;END FRAGMENT 19 | 20 | ;BEGIN FRAGMENT Fragment_Terminal_03 21 | Function Fragment_Terminal_03(ObjectReference akTerminalRef) 22 | ;BEGIN CODE 23 | Setting_SuppressMessages_DuringCombat.SetValue(1.0) 24 | ;END CODE 25 | EndFunction 26 | ;END FRAGMENT 27 | 28 | ;BEGIN FRAGMENT Fragment_Terminal_04 29 | Function Fragment_Terminal_04(ObjectReference akTerminalRef) 30 | ;BEGIN CODE 31 | Setting_SuppressMessages_DuringCombat.SetValue(0.0) 32 | ;END CODE 33 | EndFunction 34 | ;END FRAGMENT 35 | 36 | ;BEGIN FRAGMENT Fragment_Terminal_07 37 | Function Fragment_Terminal_07(ObjectReference akTerminalRef) 38 | ;BEGIN CODE 39 | Setting_SuppressMessages_DuringDialogue.SetValue(1.0) 40 | ;END CODE 41 | EndFunction 42 | ;END FRAGMENT 43 | 44 | ;BEGIN FRAGMENT Fragment_Terminal_08 45 | Function Fragment_Terminal_08(ObjectReference akTerminalRef) 46 | ;BEGIN CODE 47 | Setting_SuppressMessages_DuringDialogue.SetValue(0.0) 48 | ;END CODE 49 | EndFunction 50 | ;END FRAGMENT 51 | 52 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 53 | 54 | GlobalVariable Property Setting_AutoPlayMessages Auto Const Mandatory 55 | GlobalVariable Property Setting_SuppressAllMessages Auto Const Mandatory 56 | GlobalVariable Property Setting_SuppressMessages_DuringCombat Auto Const Mandatory 57 | GlobalVariable Property Setting_SuppressMessages_DuringDialogue Auto Const Mandatory 58 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Terminals/TERM_WSFW_Tools_Power_menu_0102CE8C.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname WorkshopFramework:Fragments:Terminals:TERM_WSFW_Tools_Power_menu_0102CE8C Extends Terminal Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Terminal_01 5 | Function Fragment_Terminal_01(ObjectReference akTerminalRef) 6 | ;BEGIN CODE 7 | int iConfirm = WSFW_PowerGridDestroyConfirm.Show() 8 | 9 | if(iConfirm == 1) 10 | Bool bSuccess = F4SEManager.WSFWID_ResetPowerGrid(None) 11 | 12 | WSFW_PowerGridFixDestroyComplete.Show() 13 | endif 14 | ;END CODE 15 | EndFunction 16 | ;END FRAGMENT 17 | 18 | ;BEGIN FRAGMENT Fragment_Terminal_02 19 | Function Fragment_Terminal_02(ObjectReference akTerminalRef) 20 | ;BEGIN CODE 21 | WSFW_PowerGridScanStarted.Show() 22 | 23 | Bool bSuccess = F4SEManager.WSFWID_ScanPowerGrid(akWorkshopRef = None) 24 | ;END CODE 25 | EndFunction 26 | ;END FRAGMENT 27 | 28 | ;BEGIN FRAGMENT Fragment_Terminal_03 29 | Function Fragment_Terminal_03(ObjectReference akTerminalRef) 30 | ;BEGIN CODE 31 | WorkshopObjectManager.ForcePowerTransmission(None) 32 | ;END CODE 33 | EndFunction 34 | ;END FRAGMENT 35 | 36 | ;BEGIN FRAGMENT Fragment_Terminal_04 37 | Function Fragment_Terminal_04(ObjectReference akTerminalRef) 38 | ;BEGIN CODE 39 | Bool bSuccess = F4SEManager.WSFWID_CheckAndFixPowerGrid(akWorkshopRef = None, abFixAndScan = true, abResetIfFixFails = false) 40 | 41 | if(bSuccess) 42 | RepairResultsMessage.Show() 43 | else 44 | RepairFailMessage.Show() 45 | endif 46 | ;END CODE 47 | EndFunction 48 | ;END FRAGMENT 49 | 50 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 51 | 52 | WorkshopFramework:WorkshopObjectManager Property WorkshopObjectManager Auto Const Mandatory 53 | WorkshopFramework:F4SEManager Property F4SEManager Auto Const Mandatory 54 | Message Property RepairResultsMessage Auto Const Mandatory 55 | 56 | Message Property RepairFailMessage Auto Const Mandatory 57 | 58 | Message Property WSFW_PowerGridDestroyConfirm Auto Const Mandatory 59 | 60 | Message Property WSFW_PowerGridFixDestroyComplete Auto Const Mandatory 61 | 62 | Message Property WSFW_PowerGridScanStarted Auto Const Mandatory 63 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Fragments/Terminals/TERM_WSFW_Tools_menu.psc: -------------------------------------------------------------------------------- 1 | ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment 2 | Scriptname WorkshopFramework:Fragments:Terminals:TERM_WSFW_Tools_menu Extends Terminal Hidden Const 3 | 4 | ;BEGIN FRAGMENT Fragment_Terminal_01 5 | Function Fragment_Terminal_01(ObjectReference akTerminalRef) 6 | ;BEGIN CODE 7 | MainQuest.ClaimSettlement(None) 8 | ;END CODE 9 | EndFunction 10 | ;END FRAGMENT 11 | 12 | ;BEGIN FRAGMENT Fragment_Terminal_02 13 | Function Fragment_Terminal_02(ObjectReference akTerminalRef) 14 | ;BEGIN CODE 15 | WorkshopScript thisWorkshop = WorkshopFramework:WSFW_API.GetNearestWorkshop(Game.GetPlayer()) 16 | if(thisWorkshop) 17 | MainQuest.PresentManageSettlementMenu(thisWorkshop) 18 | endif 19 | ;END CODE 20 | EndFunction 21 | ;END FRAGMENT 22 | 23 | ;BEGIN FRAGMENT Fragment_Terminal_03 24 | Function Fragment_Terminal_03(ObjectReference akTerminalRef) 25 | ;BEGIN CODE 26 | HUDFrameworkManager.ForceCloseAllProgressBars() 27 | ;END CODE 28 | EndFunction 29 | ;END FRAGMENT 30 | 31 | ;BEGIN FRAGMENT Fragment_Terminal_04 32 | Function Fragment_Terminal_04(ObjectReference akTerminalRef) 33 | ;BEGIN CODE 34 | MainQuest.ClaimAllSettlements() 35 | ;END CODE 36 | EndFunction 37 | ;END FRAGMENT 38 | 39 | ;BEGIN FRAGMENT Fragment_Terminal_05 40 | Function Fragment_Terminal_05(ObjectReference akTerminalRef) 41 | ;BEGIN CODE 42 | HUDFrameworkManager.ResetAllWidgets() 43 | ;END CODE 44 | EndFunction 45 | ;END FRAGMENT 46 | 47 | ;BEGIN FRAGMENT Fragment_Terminal_07 48 | Function Fragment_Terminal_07(ObjectReference akTerminalRef) 49 | ;BEGIN CODE 50 | Utility.Wait(0.1) 51 | F4SEManager.ShowRemoteLocationManagementMenu() 52 | ;END CODE 53 | EndFunction 54 | ;END FRAGMENT 55 | 56 | ;BEGIN FRAGMENT Fragment_Terminal_08 57 | Function Fragment_Terminal_08(ObjectReference akTerminalRef) 58 | ;BEGIN CODE 59 | SettlementLayoutManager.FindAndRemoveMisplacedItems() 60 | ;END CODE 61 | EndFunction 62 | ;END FRAGMENT 63 | 64 | ;BEGIN FRAGMENT Fragment_Terminal_09 65 | Function Fragment_Terminal_09(ObjectReference akTerminalRef) 66 | ;BEGIN CODE 67 | MainQuest.RelinkLocalSettlers() 68 | ;END CODE 69 | EndFunction 70 | ;END FRAGMENT 71 | 72 | ;END FRAGMENT CODE - Do not edit anything between this and the begin comment 73 | 74 | WorkshopFramework:MainQuest Property MainQuest Auto Const Mandatory 75 | WorkshopFramework:HUDFrameworkManager Property HUDFrameworkManager Auto Const Mandatory 76 | WorkshopFramework:F4SEManager Property F4SEManager Auto Const Mandatory 77 | WorkshopFramework:SettlementLayoutManager Property SettlementLayoutManager Auto Const Mandatory 78 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/GoE_Reflection.psc: -------------------------------------------------------------------------------- 1 | ScriptName WorkshopFramework:GoE_Reflection Const Hidden 2 | { 3 | Script to access Garden of Eden debugging functions without causing other scripts to crash if it's not present 4 | } 5 | 6 | 7 | ;; Note, GoE encodes version X.Y as XY; eg: v8.1 = 81; v14.7 = 147; etc 8 | Int Function GoE_Version() Global 9 | Return Utility.CallGlobalFunction( "GardenOfEden", "GetVersionRelease", None ) As Int 10 | EndFunction 11 | Bool Function GoE_VersionTest( Int aiVersion ) Global 12 | Return GoE_Version() >= aiVersion 13 | EndFunction 14 | 15 | 16 | String[] Function GoE_GetPersistentPromoters( ObjectReference akReference, Bool abAddZeroXPrefix = false, Bool abRemove28a = True ) Global 17 | If( GoE_Version() < 184 ) 18 | Debug.Trace( "WorkshopFramework:GoE_Reflection.GoE_GetPersistentPromoters() :: Garden of Eden v18.4 or later required" ) 19 | Return None 20 | EndIf 21 | If( akReference == None ) 22 | Return None 23 | EndIf 24 | Return __GoE_GetPersistentPromoters( akReference, abAddZeroXPrefix, abRemove28a) 25 | EndFunction 26 | 27 | 28 | String[] Function __GoE_GetPersistentPromoters( ObjectReference akReference, Bool abAddZeroXPrefix = false, Bool abRemove28a = True ) Global 29 | String[] lsReasons = GardenOfEden2.GetPersistentPromoters( akReference, abAddZeroXPrefix ) 30 | 31 | Int liIndex = lsReasons.Length 32 | If( liIndex > 0 ) 33 | While( liIndex > 0 ) 34 | liIndex -= 1 35 | If( abRemove28a ) ;; Remove the hardcoded master object that is holding a reference to everything 36 | If( lsReasons[ liIndex ] == "28a" )\ 37 | ||( lsReasons[ liIndex ] == "0x28a" ) 38 | lsReasons.Remove( liIndex, 1 ) 39 | EndIf 40 | EndIf 41 | EndWhile 42 | EndIf 43 | 44 | If( lsReasons.Length == 0 ) 45 | Return None 46 | EndIf 47 | Return lsReasons 48 | EndFunction 49 | 50 | 51 | ;; cgf "WorkshopFramework:GoE_Reflection.GoE_LogPersistentRefs" 52 | function GoE_LogPersistentRefs() Global 53 | If( GoE_Version() < 184 ) 54 | Debug.Trace( "WorkshopFramework:GoE_Reflection.GoE_LogPersistentRefs() :: Garden of Eden v18.4 or later required" ) 55 | Return 56 | EndIf 57 | __GoE_LogPersistentRefs() 58 | EndFunction 59 | 60 | function __GoE_LogPersistentRefs() Global 61 | GardenOfEden2.LogPersistentRefs( -1, -1, False, \ 62 | None, None, None, \ 63 | False, False, None, \ 64 | -1, -1, -1.0, None, \ 65 | False, 0 ) 66 | EndFunction 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ControllerQuest.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ControllerQuest.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ControllerQuest extends Quest 15 | { Quest designed to manage certain aspects of the gameplay loop } 16 | 17 | ; ----------------------------------------- 18 | ; Consts 19 | ; ----------------------------------------- 20 | 21 | 22 | ; ----------------------------------------- 23 | ; Editor Properties 24 | ; ----------------------------------------- 25 | 26 | Group Controllers 27 | Actor Property PlayerRef Auto Const Mandatory 28 | EndGroup 29 | 30 | ; ----------------------------------------- 31 | ; Vars 32 | ; ----------------------------------------- 33 | 34 | 35 | ; ----------------------------------------- 36 | ; Events 37 | ; ----------------------------------------- 38 | 39 | Event OnQuestInit() 40 | ; Run one-time initialization tasks 41 | while(PlayerRef == None) 42 | Utility.Wait(0.1) ; 1.1.7 - If a large number of quests are looking for this ref, it can fail to populate, causing OnPlayerLoadGame to never fire and we lose control of our updates 43 | endWhile 44 | 45 | RegisterForRemoteEvent(PlayerRef, "OnPlayerLoadGame") 46 | 47 | HandleQuestInit() 48 | 49 | ; Run GameLoaded code 50 | GameLoaded() 51 | EndEvent 52 | 53 | 54 | Event Actor.OnPlayerLoadGame(Actor akActorRef) 55 | ;Debug.Trace(Self + " OnPlayerLoadGame called.") 56 | ; Run GameLoaded code 57 | GameLoaded() 58 | EndEvent 59 | 60 | ; ----------------------------------------- 61 | ; Functions 62 | ; ----------------------------------------- 63 | 64 | Function GameLoaded() 65 | HandleGameLoaded() 66 | EndFunction 67 | 68 | ; ----------------------------------------- 69 | ; Handler Functions - These should be written by the extended scripts that use them 70 | ; ----------------------------------------- 71 | 72 | Function HandleQuestInit() 73 | ; Extend Me 74 | EndFunction 75 | 76 | Function HandleGameLoaded() 77 | ; Extend Me 78 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/ExportExtraData.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:ExportExtraData.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:ExportExtraData extends ObjectReference 15 | { Ensure this object gets tagged with an identifying string when exported as part of a layout } 16 | 17 | import WorkshopFramework:Library:DataStructures 18 | import WorkshopFramework:Library:UtilityFunctions 19 | 20 | int iMaxNumbers = 3 Const 21 | int iMaxStrings = 3 Const 22 | int iMaxBools = 3 Const 23 | int iMaxForms = 3 Const 24 | 25 | Float[] Property ExtraNumbers Auto Const 26 | { Up to 3 numbers can be appended to the export data } 27 | String[] Property ExtraStrings Auto Const 28 | { Up to 3 strings can be appended to the export data } 29 | Bool[] Property ExtraBools Auto Const 30 | { Up to 3 bools can be appended to the export data } 31 | UniversalForm[] Property ExtraForms Auto Const 32 | { Up to 3 forms can be appended to the export data } 33 | 34 | ; OnTriggerLeave used by WorkshopFramework to tell an object it is being exported 35 | Event OnTriggerLeave(ObjectReference akActionRef) 36 | if(akActionRef as WorkshopFramework:ObjectRefs:Thread_ExportObjectData) 37 | WorkshopFramework:ObjectRefs:Thread_ExportObjectData kThreadRef = akActionRef as WorkshopFramework:ObjectRefs:Thread_ExportObjectData 38 | 39 | if(ExtraNumbers != None) 40 | int i = 0 41 | while(i < ExtraNumbers.Length && i < iMaxNumbers) 42 | kThreadRef.AddExtraData(ExtraNumbers[i]) 43 | 44 | i += 1 45 | endWhile 46 | endif 47 | 48 | if(ExtraStrings != None) 49 | int i = 0 50 | while(i < ExtraStrings.Length && i < iMaxStrings) 51 | kThreadRef.AddExtraData(ExtraStrings[i]) 52 | 53 | i += 1 54 | endWhile 55 | endif 56 | 57 | if(ExtraBools != None) 58 | int i = 0 59 | while(i < ExtraBools.Length && i < iMaxBools) 60 | kThreadRef.AddExtraData(ExtraBools[i]) 61 | 62 | i += 1 63 | endWhile 64 | endif 65 | 66 | if(ExtraForms != None) 67 | int i = 0 68 | while(i < ExtraForms.Length && i < iMaxForms) 69 | Form thisForm = GetUniversalForm(ExtraForms[i]) 70 | if(thisForm) 71 | kThreadRef.AddExtraData(thisForm) 72 | endif 73 | 74 | i += 1 75 | endWhile 76 | endif 77 | endif 78 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/Mutex.psc: -------------------------------------------------------------------------------- 1 | ScriptName WorkshopFramework:Library:ObjectRefs:Mutex Extends ObjectReference 2 | { 3 | A simple spin lock. 4 | 5 | How is this different from a "built-in" spin lock? This keeps the spinning 6 | off the locked object so it is not constantly interrupted while it works. 7 | 8 | The benefits of this become greater and greater the more threads that are 9 | spinning, waiting for the lock to release. That is, the thread holding the 10 | lock is interrupted less and can process faster. 11 | } 12 | Activator Function GetMutexBaseObject() Global 13 | Return Game.GetFormFromFile( 0x00000FA3, "WorkshopFramework.esm" ) As Activator 14 | EndFunction 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ;/ 24 | =========================================================== 25 | 26 | Lock Properties 27 | 28 | =========================================================== 29 | /; 30 | 31 | Bool __bDeleted = False 32 | 33 | Bool __bHeld = False 34 | Int __iLockCount = 0 ;; How many threads are spinning 35 | 36 | Int Property iMaxLockCountBeforeFlush = 100 Auto 37 | { Thread limit before forcing the lock free } 38 | 39 | Int Property iMaxSpinCount = 100 Auto 40 | { Max spin attempts before failing to get the lock } 41 | 42 | Float Property fMinSpinInterval = 0.125 Auto 43 | { 1/8s - Minimum spin time } 44 | 45 | Float Property fMaxSpinInterval = 0.875 Auto 46 | { 7/8s - Maximum spin time } 47 | 48 | Bool Property bMenuMode = True Auto 49 | { Spin while menus are displayed } 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | ;/ 59 | =========================================================== 60 | 61 | Dynamic Lock API 62 | 63 | =========================================================== 64 | /; 65 | 66 | 67 | Mutex Function Create() Global 68 | 69 | ObjectReference lkSpawnMarker = Game.GetFormFromFile( 0x00004CEA, "WorkshopFramework.esm" ) As ObjectReference 70 | If( lkSpawnMarker == None ) 71 | Debug.TraceStack( "WorkshopFramework:Library:ObjectRefs:Mutex :: Create() :: Could not get the spawn marker for the Mutex!" ) 72 | Return None 73 | EndIf 74 | 75 | ;; Persistent, Disabled, Do not delete when able 76 | ObjectReference lkLockRef = lkSpawnMarker.PlaceAtMe( GetMutexBaseObject(), 1, True, True, False ) 77 | If( lkLockRef == None ) 78 | Debug.TraceStack( "WorkshopFramework:Library:ObjectRefs:Mutex :: Create() :: Could not spawn a Mutex Activator!" ) 79 | Return None 80 | EndIf 81 | 82 | Mutex lkLock = lkLockRef As Mutex 83 | 84 | If( lkLock == None ) 85 | ;; This should never happen, but just in case... 86 | Debug.TraceStack( "WorkshopFramework:Library:ObjectRefs:Mutex :: Create() :: Spawned object did not cast as WorkshopFramework:Library:ObjectRefs:Mutex!" ) 87 | lkLockRef.Delete() 88 | Return None 89 | EndIf 90 | 91 | Return lkLock 92 | EndFunction 93 | 94 | 95 | Function Delete() 96 | __bDeleted = True 97 | __bHeld = False 98 | __iLockCount = 0 99 | Parent.Delete() 100 | EndFunction 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | ;/ 110 | =========================================================== 111 | 112 | Public API 113 | 114 | =========================================================== 115 | /; 116 | 117 | 118 | Bool Function IsHeld() 119 | Return __bHeld 120 | EndFunction 121 | 122 | 123 | Bool Function GetLock() 124 | If( __bDeleted ) 125 | Debug.TraceStack( "WorkshopFramework:Library:ObjectRefs:Mutex :: GetLock() :: Cannot get lock! Mutex has been deleted!" ) 126 | Return False 127 | EndIf 128 | 129 | __iLockCount += 1 130 | If( __iLockCount < iMaxLockCountBeforeFlush ) 131 | ;; Allow more threads to queue, there should never be that many! 132 | 133 | Int liSpinCount = 0 134 | While( !__bDeleted )&&( __bHeld )&&( liSpinCount < iMaxSpinCount ) 135 | liSpinCount += 1 136 | Float lfInterval = Utility.RandomFloat( fMinSpinInterval, fMaxSpinInterval ) 137 | If( bMenuMode ) 138 | Utility.WaitMenuMode( lfInterval ) 139 | Else 140 | Utility.Wait( lfInterval ) 141 | EndIf 142 | EndWhile 143 | 144 | If( __bDeleted ) 145 | Debug.TraceStack( "WorkshopFramework:Library:ObjectRefs:Mutex :: GetLock() :: Cannot get lock! Mutex has been deleted!" ) 146 | Return False 147 | EndIf 148 | 149 | ;; Lock is still held, that means we spun out 150 | If( __bHeld ) 151 | __iLockCount -= 1 152 | Debug.TraceStack( "WorkshopFramework:Library:ObjectRefs:Mutex :: GetLock() :: Cannot get lock! Mutex has been spinning for too long!" ) 153 | Return False 154 | EndIf 155 | 156 | EndIf 157 | 158 | ;; Aquire lock and return true 159 | __bHeld = True 160 | Return True 161 | EndFunction 162 | 163 | 164 | Function ReleaseLock() 165 | If( __bDeleted )\ 166 | ||( !__bHeld ) 167 | Return 168 | EndIf 169 | 170 | __iLockCount -= 1 171 | __bHeld = False 172 | EndFunction 173 | 174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/PreventDroppingOnGround.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:PreventDroppingOnGround.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:PreventDroppingOnGround extends ObjectReference 15 | { Put this on items that you don't want the player to drop on the ground } 16 | 17 | Bool Property bReturnToInventory = false Auto Const 18 | { If true, this will be put back in the player's inventory - otherwise it will just be destroyed } 19 | 20 | Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) 21 | ObjectReference PlayerRef = Game.GetPlayer() 22 | 23 | if(akOldContainer == PlayerRef && ! akNewContainer) 24 | if(bReturnToInventory) 25 | PlayerRef.AddItem(Self) 26 | else 27 | Disable(false) 28 | Delete() 29 | endif 30 | endif 31 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/PreventLooting.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:PreventLooting.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:PreventLooting extends ObjectReference 15 | { If the player loots this, remove it from their inventory } 16 | 17 | Bool Property bReturnToPreviousLocation = true Auto Const 18 | { If true, the object will be returned to its previous location or container when looted, otherwise it will just be deleted. } 19 | 20 | 21 | Float[] Property KeepAtCoords Auto Hidden 22 | 23 | Event OnInit() 24 | if(KeepAtCoords.Length == 0) 25 | KeepAtCoords = new Float[0] 26 | 27 | ; Store starting position 28 | KeepAtCoords.Add(GetPositionX()) 29 | KeepAtCoords.Add(GetPositionY()) 30 | KeepAtCoords.Add(GetPositionZ()) 31 | endif 32 | EndEvent 33 | 34 | Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) 35 | ObjectReference PlayerRef = Game.GetPlayer() 36 | 37 | if(akNewContainer == PlayerRef) 38 | if( ! bReturnToPreviousLocation) 39 | PlayerRef.RemoveItem(Self) 40 | else 41 | if(akOldContainer != None) 42 | PlayerRef.RemoveItem(Self, akOtherContainer = akOldContainer) 43 | else 44 | Self.Drop(true) 45 | 46 | if(KeepAtCoords.Length > 2) 47 | Self.SetPosition(KeepAtCoords[0], KeepAtCoords[1], KeepAtCoords[2]) 48 | endif 49 | endif 50 | endif 51 | endif 52 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/ProductionRecord.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:ProductionRecord.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:ProductionRecord extends ObjectReference 15 | 16 | ObjectReference Property TemporaryContainer Auto Hidden 17 | Int Property iWorkshopID = -1 Auto Hidden 18 | Keyword Property ContainerKeyword Auto Hidden -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/ProtectedObjectRef.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:ProtectedObjectRef.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:ProtectedObjectRef extends WorkshopFramework:Library:ObjectRefs:LockableObjectRef 15 | 16 | Bool bAllowDisable = false 17 | Bool bAllowDelete = false 18 | 19 | Function AllowDisable() 20 | bAllowDisable = true 21 | EndFunction 22 | 23 | Function AllowDelete() 24 | bAllowDelete = true 25 | EndFunction 26 | 27 | Function Disable(Bool abFade = false) 28 | if( ! bAllowDisable) 29 | ; Do nothing - overriding vanilla behaviort to avoid these being destroyed 30 | 31 | return 32 | endif 33 | 34 | Parent.Disable(abFade) 35 | EndFunction 36 | 37 | Function Delete() 38 | if( ! bAllowDelete) 39 | ; Do nothing - overriding vanilla behaviort to avoid these being destroyed 40 | 41 | return 42 | endif 43 | 44 | Parent.Delete() 45 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/ProtectedWorkshopObjectScript.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:ProtectedWorkshopObjectScript.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:ProtectedWorkshopObjectScript extends WorkshopFramework:Library:ObjectRefs:LockableWorkshopObjectScript 15 | 16 | Bool bAllowDisable = false 17 | Bool bAllowDelete = false 18 | 19 | Function AllowDisable() 20 | bAllowDisable = true 21 | EndFunction 22 | 23 | Function AllowDelete() 24 | bAllowDelete = true 25 | EndFunction 26 | 27 | Function Disable(Bool abFade = false) 28 | if( ! bAllowDisable) 29 | ; Do nothing - overriding vanilla behaviort to avoid these being destroyed 30 | 31 | return 32 | endif 33 | 34 | Parent.Disable(abFade) 35 | EndFunction 36 | 37 | Function Delete() 38 | if( ! bAllowDelete) 39 | ; Do nothing - overriding vanilla behaviort to avoid these being destroyed 40 | 41 | return 42 | endif 43 | 44 | Parent.Delete() 45 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/ResourceTypeConsumption.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:ResourceTypeConsumption.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:ResourceTypeConsumption extends ObjectReference 15 | 16 | Form Property ConsumeForm Auto Hidden 17 | { Formlist of items, Keyword to match item types, or specific item to be consumed each day } 18 | ActorValue Property ResourceAV Auto Hidden 19 | { The AV to check the workshop for to determine how much of this item to consume } 20 | Keyword Property SearchContainerKeyword Auto Hidden 21 | { [Optional] First targets containers using the WorkshopFramework container routing system with this keyword - see Documentation for default options, or create your own type. If None, it will simply look in the Workshop container. } 22 | Bool Property bIsComponentFormList = false Auto Hidden 23 | { Set this to true if you are setting ConsumeForm to a formlist of components - otherwise this should remain false } -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/ResourceTypeConsumptionMissing.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:ResourceTypeConsumptionMissing.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:ResourceTypeConsumptionMissing extends ObjectReference 15 | 16 | WorkshopFramework:Library:ObjectRefs:ResourceTypeConsumption Property ResourceTypeConsumptionRecord Auto Hidden 17 | WorkshopScript Property kWorkshopRef Auto Hidden 18 | Int Property iMissing = 0 Auto Hidden -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/ResourceTypeProduction.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:ResourceTypeProduction.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:ResourceTypeProduction extends ObjectReference 15 | 16 | LeveledItem Property ProduceForm Auto Hidden 17 | { Item to be produced each day } 18 | ActorValue Property ResourceAV Auto Hidden 19 | { The AV to check the workshop for to determine how much of this item to produce } 20 | Keyword Property TargetContainerKeyword Auto Hidden 21 | { [Optional] Attempts to place in containers using the WorkshopFramework container routing system with this keyword - see Documentation for default options, or create your own type. If None, it will simply place in the Workshop container. } -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/Thread.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:Thread.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:Thread extends ObjectReference 15 | 16 | CustomEvent ThreadRunComplete 17 | 18 | ; - 19 | ; Consts 20 | ; - 21 | int SelfDestructTimerID = 0 22 | 23 | ; - 24 | ; Editor Properties 25 | ; - 26 | 27 | ; - 28 | ; Properties 29 | ; - 30 | Bool Property bAutoDestroy = true Auto Hidden ; Note: When turning off AutoDestroy - you are in charge of calling SelfDestruct on this thread when you are done 31 | Int Property iCallBackID = -1 Auto Hidden 32 | String Property sCustomCallbackID = "" Auto Hidden 33 | 34 | ; - 35 | ; Events 36 | ; - 37 | 38 | Event OnTimer(Int aiTimerID) 39 | if(aiTimerID == SelfDestructTimerID) 40 | if(bAutoDestroy) ; 1.0.5 - without this, we can't have the threads turn off their own self destruct to delay for events 41 | SelfDestruct() 42 | endif 43 | endif 44 | EndEvent 45 | 46 | ; - 47 | ; Functions 48 | ; - 49 | 50 | Function StartThread() 51 | RunCode() 52 | 53 | Var[] kArgs = new Var[2] 54 | 55 | kArgs[0] = sCustomCallbackID 56 | kArgs[1] = iCallBackID 57 | 58 | SendCustomEvent("ThreadRunComplete", kArgs) 59 | 60 | 61 | if(bAutoDestroy) 62 | if(IsBoundGameObjectAvailable()) 63 | StartTimer(3.0) 64 | else 65 | ReleaseObjectReferences() 66 | endif 67 | endif 68 | EndFunction 69 | 70 | Function SelfDestruct() 71 | ReleaseObjectReferences() 72 | 73 | Disable(false) 74 | Delete() 75 | EndFunction 76 | 77 | Function RunCode() 78 | ; Extend me 79 | EndFunction 80 | 81 | Function ReleaseObjectReferences() 82 | ; Implement Me - any global variables that you stored an object reference in need to be set to none or that reference and this thread will be permanently persisted causing a memory leak! 83 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/ThreadStarter.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:ObjectRefs:ThreadStarter.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:ObjectRefs:ThreadStarter extends ObjectReference 15 | 16 | ; - 17 | ; Consts 18 | ; - 19 | 20 | Int MAXWAITCOUNT = 100 21 | 22 | 23 | ; - 24 | ; Editor Properties 25 | ; - 26 | 27 | WorkshopFramework:Library:ThreadRunner[] Property ThreadRunners Auto Const 28 | 29 | 30 | ; - 31 | ; Properties 32 | ; - 33 | 34 | Int Property iThreadRunnerIndex Auto Hidden 35 | String Property sFunction Auto Hidden 36 | Var[] Property kArgs Auto Hidden 37 | Bool Property bReadyToLaunch = false Auto Hidden 38 | 39 | Int iWaitCount = 0 40 | 41 | ; - 42 | ; Events 43 | ; - 44 | 45 | Event OnInit() 46 | StartTimer(0.1) 47 | EndEvent 48 | 49 | 50 | Event OnTimer(Int aiTimerID) 51 | if( ! bReadyToLaunch && iWaitCount < MAXWAITCOUNT) 52 | iWaitCount += 1 53 | StartTimer(0.1) 54 | return 55 | endif 56 | 57 | if(bReadyToLaunch) 58 | StartThread() 59 | else 60 | SelfDestruct() 61 | endif 62 | EndEvent 63 | 64 | ; - 65 | ; Functions 66 | ; - 67 | 68 | Function StartThread() 69 | ThreadRunners[iThreadRunnerIndex].CallFunctionNoWait(sFunction, kArgs) 70 | SelfDestruct() 71 | EndFunction 72 | 73 | Function SelfDestruct() 74 | Self.Disable(false) 75 | Self.Delete() 76 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ObjectRefs/WorkshopAVReacting.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:Library:ObjectRefs:WorkshopAVReacting extends ObjectReference Const 2 | 3 | import WorkshopFramework:Library:DataStructures 4 | import WorkshopFramework:Library:UtilityFunctions 5 | import WorkshopFramework:WorkshopFunctions 6 | 7 | 8 | ActorValueSet[] Property ActiveThresholds Auto Const Mandatory 9 | { If all these evaluate to true, this object will be enabled, otherwise disabled } 10 | 11 | Event OnCellLoad() 12 | Keyword WorkshopItemKeyword = GetWorkshopItemKeyword() 13 | 14 | WorkshopScript thisWorkshop = GetLinkedRef(WorkshopItemKeyword) as WorkshopScript 15 | if(thisWorkshop) 16 | int i = 0 17 | bool bEnable = true 18 | while(i < ActiveThresholds.Length && bEnable) 19 | if( ! CheckActorValueSet(thisWorkshop, ActiveThresholds[i])) 20 | bEnable = false 21 | endif 22 | 23 | i += 1 24 | endWhile 25 | 26 | if(bEnable) 27 | Self.Enable() 28 | else 29 | Self.Disable() 30 | endif 31 | endif 32 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/SettlementLayoutRegistrationQuest.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:SettlementLayoutRegistrationQuest.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:SettlementLayoutRegistrationQuest extends Quest 15 | { Register your Settlement Layouts with WorkshopFramework so players can select them. } 16 | 17 | 18 | import WorkshopFramework:Library:DataStructures 19 | import WorkshopFramework:Library:UtilityFunctions 20 | import WorkshopFramework:WorkshopFunctions 21 | 22 | 23 | ; --------------------------------------------- 24 | ; Consts 25 | ; --------------------------------------------- 26 | 27 | int iSettlementLayoutManagerFormID = 0x00012B0D Const 28 | 29 | ; --------------------------------------------- 30 | ; Editor Properties 31 | ; --------------------------------------------- 32 | 33 | Group MyMod 34 | Formlist Property MySettlementLayoutsList Auto Const Mandatory 35 | GlobalVariable Property gMyModVersion Auto Const 36 | { Create a Global form, start it at 1, and then increase that number each time you update your mod for release so that WorkshopFramework knows to register new layouts for any player who upgrades your mod. (This makes the code run much faster) } 37 | EndGroup 38 | 39 | ; --------------------------------------------- 40 | ; Vars 41 | ; --------------------------------------------- 42 | 43 | Int iMyInstalledVersion = 0 44 | Bool bUpdateRegistrationsInProgress = false 45 | Actor PlayerRef 46 | 47 | 48 | WorkshopFramework:SettlementLayoutManager Property SettlementLayoutManager Auto Hidden 49 | 50 | ; --------------------------------------------- 51 | ; Events 52 | ; --------------------------------------------- 53 | 54 | Event OnQuestInit() 55 | if(Self == Game.GetFormFromFile(0x00014980, "WorkshopFramework.esm") as Quest) 56 | ; The template itself shouldn't be running 57 | Stop() 58 | 59 | return 60 | endif 61 | 62 | PlayerRef = Game.GetPlayer() as Actor 63 | 64 | HandleGameLoaded() 65 | 66 | RegisterForRemoteEvent(PlayerRef, "OnPlayerLoadGame") 67 | EndEvent 68 | 69 | Event Actor.OnPlayerLoadGame(Actor akSender) 70 | HandleGameLoaded() 71 | EndEvent 72 | 73 | ; --------------------------------------------- 74 | ; Event Handlers 75 | ; --------------------------------------------- 76 | 77 | Function HandleGameLoaded() 78 | UpdateVars() 79 | UpdateRegistrations() 80 | EndFunction 81 | 82 | ; --------------------------------------------- 83 | ; Functions 84 | ; --------------------------------------------- 85 | 86 | Function UpdateRegistrations() 87 | if(bUpdateRegistrationsInProgress || (gMyModVersion != None && iMyInstalledVersion >= gMyModVersion.GetValueInt())) 88 | return 89 | endif 90 | 91 | Formlist SettlementLayoutList = SettlementLayoutManager.SettlementLayoutList 92 | 93 | if(MySettlementLayoutsList != None) 94 | int i = 0 95 | int iCount = MySettlementLayoutsList.GetSize() 96 | while(i < iCount) 97 | ; For now we'll inject the layouts directly in the formlist to avoid overwhelming SettlementLayoutManager quest 98 | Form thisForm = MySettlementLayoutsList.GetAt(i) 99 | SettlementLayoutList.AddForm(thisForm) 100 | 101 | i += 1 102 | endWhile 103 | endif 104 | 105 | if(gMyModVersion != None) 106 | iMyInstalledVersion = gMyModVersion.GetValueInt() 107 | endif 108 | EndFunction 109 | 110 | 111 | Function UpdateVars() 112 | if( ! SettlementLayoutManager) 113 | SettlementLayoutManager = Game.GetFormFromFile(iSettlementLayoutManagerFormID, "WorkshopFramework.esm") as WorkshopFramework:SettlementLayoutManager 114 | endif 115 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/SimpleInjectionManager.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:SimpleInjectionManager.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:SimpleInjectionManager extends WorkshopFramework:Library:SlaveQuest Conditional 15 | 16 | import WorkshopFramework:Library:DataStructures 17 | 18 | InjectionMap[] Property InjectData Auto Const 19 | 20 | int iLastInjectedIndex = -1 21 | 22 | Function HandleGameLoaded() 23 | Parent.HandleGameLoaded() 24 | 25 | HandleInjections() 26 | EndFunction 27 | 28 | Function HandleInjections() 29 | int i = iLastInjectedIndex + 1 30 | while(i < InjectData.Length) 31 | iLastInjectedIndex = i 32 | 33 | int j = 0 34 | while(j < InjectData[i].NewEntries.GetSize()) 35 | InjectData[i].TargetLeveledItem.AddForm(InjectData[i].NewEntries.GetAt(j), InjectData[i].iLevel, InjectData[i].iCount) 36 | 37 | j += 1 38 | endWhile 39 | 40 | i += 1 41 | endWhile 42 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/SlaveQuest.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:SlaveQuest.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | 15 | Scriptname WorkshopFramework:Library:SlaveQuest extends WorkshopFramework:Library:VersionedLockableQuest 16 | { This quest will have certain events fed to it from MasterQuest, to allow for threading of common event processing code - such as PlayerLoadGame, or PlayerChangedLocation } 17 | 18 | import WorkshopFramework:Library:UtilityFunctions 19 | 20 | ; ------------------------------------------ 21 | ; Consts 22 | ; ------------------------------------------ 23 | 24 | ; Duplicates from MasterQuest, to avoid having to make calls to it 25 | int Property EVENTSTAGE_FromMasterQuest = -1 autoReadOnly 26 | int Property EVENTSTAGEITEM_PlayerLoadedGame = -1 autoReadOnly 27 | int Property EVENTSTAGEITEM_PlayerChangedLocation = -2 autoReadOnly 28 | 29 | int Property MANAGEDEVENT_OnPlayerLoadGame = 0 autoReadOnly 30 | int Property MANAGEDEVENT_OnPlayerLocationChange = 1 autoReadOnly 31 | 32 | ; ------------------------------------------ 33 | ; Editor Properties 34 | ; ------------------------------------------ 35 | 36 | Group Controllers 37 | WorkshopFramework:Library:MasterQuest Property MasterQuest Auto Const Mandatory 38 | EndGroup 39 | 40 | Group Aliases 41 | LocationAlias Property CurrentLocation Auto Const Mandatory 42 | { Point to LatestLocation alias on MasterQuest, this will avoid papyrus needing to touch the MasterQuest } 43 | EndGroup 44 | 45 | 46 | 47 | ; ------------------------------------------ 48 | ; Vars 49 | ; ------------------------------------------ 50 | 51 | 52 | ; ------------------------------------------ 53 | ; Events 54 | ; ------------------------------------------ 55 | 56 | Event OnStageSet(Int auiStageID, Int auiItemID) 57 | ; Kinggath - Note to Self: If you are finding that one of your quests is not getting this triggered - it is likely because you defined OnStageSet without adding a call to Parent.OnStageSet in it. 58 | 59 | ; Would probably be wise to refactor and add a HandleStageSet function that can be overridden 60 | 61 | 62 | if(auiStageID == EVENTSTAGE_FromMasterQuest) 63 | ;ModTrace("[SlaveQuest] " + Self + " Received event from master quest " + auiItemID) 64 | if(auiItemID == EVENTSTAGEITEM_PlayerLoadedGame) ; Player Loaded Game 65 | HandleGameLoaded() 66 | elseif(auiItemID == EVENTSTAGEITEM_PlayerChangedLocation) ; Player Changed Location 67 | HandleLocationChange(CurrentLocation.GetLocation()) 68 | endif 69 | endif 70 | EndEvent 71 | 72 | 73 | ; ------------------------------------------ 74 | ; Handler Functions - These should be extended/written by the extended scripts that use them 75 | ; ------------------------------------------ 76 | 77 | Function HandleQuestInit() 78 | Parent.HandleQuestInit() 79 | ModTrace("[SlaveQuest] " + Self + " HandleQuestInit called, registering for managed events.") 80 | ; Unregister for this, as we want our GameLoaded code to run in response to the MasterQuest 81 | UnRegisterForRemoteEvent(PlayerRef, "OnPlayerLoadGame") 82 | 83 | MasterQuest.RegisterForManagedEvent(Self, MANAGEDEVENT_OnPlayerLoadGame) 84 | MasterQuest.RegisterForManagedEvent(Self, MANAGEDEVENT_OnPlayerLocationChange) 85 | 86 | ; Extend me 87 | EndFunction 88 | 89 | Function HandleLocationChange(Location akLocationRef) 90 | ; Extend me 91 | EndFunction 92 | 93 | Function HandleGameLoaded() 94 | Parent.HandleGameLoaded() 95 | 96 | ; Extend me 97 | EndFunction 98 | 99 | 100 | Function GameLoaded() 101 | ; Do Nothing - HandleGameLoaded will be triggered by the MasterQuest 102 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/ThirdParty/Cobb/CobbLibraryVectors.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:Library:ThirdParty:Cobb:CobbLibraryVectors 2 | {Library by David J Cobb for handling vectors} 3 | 4 | Float[] Function VectorAdd(Float[] avA, Float[] avB) Global 5 | {Adds two vectors together and returns the sum as a new vector.} 6 | Float[] vOut = new Float[3] 7 | vOut[0] = avA[0] + avB[0] 8 | vOut[1] = avA[1] + avB[1] 9 | vOut[2] = avA[2] + avB[2] 10 | return vOut 11 | EndFunction 12 | 13 | Float[] Function VectorSubtract(Float[] avA, Float[] avB) Global 14 | {Subtracts one vector from another and returns the difference as a new vector.} 15 | Float[] vOut = new Float[3] 16 | vOut[0] = avA[0] - avB[0] 17 | vOut[1] = avA[1] - avB[1] 18 | vOut[2] = avA[2] - avB[2] 19 | return vOut 20 | EndFunction 21 | 22 | Float[] Function VectorMultiply(Float[] avA, Float afB) Global 23 | {Multiplies a vector by a scalar and returns the result as a new vector.} 24 | Float[] vOut = new Float[3] 25 | vOut[0] = avA[0] * afB 26 | vOut[1] = avA[1] * afB 27 | vOut[2] = avA[2] * afB 28 | return vOut 29 | EndFunction 30 | 31 | Float[] Function VectorDivide(Float[] avA, Float afB) Global 32 | {Divides a vector by a scalar and returns the result as a new vector.} 33 | Float[] vOut = new Float[3] 34 | If afB == 0 35 | Debug.TraceStack("VectorDivide: A script asked me to divide a vector by zero. I just returned a null vector instead.", 1) 36 | return vOut 37 | EndIf 38 | vOut[0] = avA[0] / afB 39 | vOut[1] = avA[1] / afB 40 | vOut[2] = avA[2] / afB 41 | return vOut 42 | EndFunction 43 | 44 | Float[] Function VectorProject(Float[] avA, Float[] avB) Global 45 | {Projects one vector onto another, returning the result as a new vector.} 46 | Float[] vOut = new Float[3] 47 | vOut[0] = avB[0] 48 | vOut[1] = avB[1] 49 | vOut[2] = avB[2] 50 | Float scalar = VectorDotProduct(avA, avB) / VectorDotProduct(avB, avB) 51 | return VectorMultiply(vOut, scalar) 52 | EndFunction 53 | 54 | Float[] Function VectorCrossProduct(Float[] avA, Float[] avB) Global 55 | {Takes the cross product of two vectors and returns the result as a new vector.} 56 | Float[] vOut = new Float[3] 57 | vOut[0] = avA[1] * avB[2] - avA[2] * avB[1] 58 | vOut[1] = avA[2] * avB[0] - avA[0] * avB[2] 59 | vOut[2] = avA[0] * avB[1] - avA[1] * avB[0] 60 | return vOut 61 | EndFunction 62 | 63 | Float Function VectorDotProduct(Float[] avA, Float[] avB) Global 64 | {Returns the dot product of two vectors.} 65 | Float fOut = 0 66 | fOut += avA[0] * avB[0] 67 | fOut += avA[1] * avB[1] 68 | fOut += avA[2] * avB[2] 69 | return fOut 70 | EndFunction 71 | 72 | Float[] Function VectorNegate(Float[] av) Global 73 | {Multiplies a vector by -1 and returns the result as a new vector.} 74 | Return VectorMultiply(av, -1) 75 | EndFunction 76 | 77 | Float Function VectorLength(Float[] av) Global 78 | {Returns the length of a vector.} 79 | return Math.sqrt(av[0]*av[0] + av[1]*av[1] + av[2]*av[2]) 80 | EndFunction 81 | 82 | Float[] Function VectorNormalize(Float[] av) Global 83 | {Normalizes a vector and returns the result as a new vector.} 84 | Return VectorDivide(av, VectorLength(av)) 85 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/VersionedLockableQuest.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:VersionedLockableQuest.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | 15 | Scriptname WorkshopFramework:Library:VersionedLockableQuest extends WorkshopFramework:Library:LockableQuest 16 | { This quest has version control } 17 | 18 | ; ------------------------------------------ 19 | ; Consts 20 | ; ------------------------------------------ 21 | 22 | 23 | ; ------------------------------------------ 24 | ; Editor Properties 25 | ; ------------------------------------------ 26 | 27 | Group Globals 28 | GlobalVariable Property gCurrentVersion Auto Const Mandatory 29 | { Point to mod's version control global } 30 | EndGroup 31 | 32 | 33 | ; ------------------------------------------ 34 | ; Vars 35 | ; ------------------------------------------ 36 | 37 | int Property iInstalledVersion = 0 Auto Hidden 38 | 39 | 40 | ; ------------------------------------------ 41 | ; Events 42 | ; ------------------------------------------ 43 | 44 | 45 | ; ------------------------------------------ 46 | ; Maintenance Functions 47 | ; ------------------------------------------ 48 | 49 | Function InstallModChanges() 50 | HandleInstallModChanges() 51 | 52 | iInstalledVersion = gCurrentVersion.GetValueInt() 53 | EndFunction 54 | 55 | 56 | ; ------------------------------------------ 57 | ; Handler Functions - These should be written by the extended scripts that use them 58 | ; ------------------------------------------ 59 | 60 | Function HandleGameLoaded() 61 | Parent.HandleGameLoaded() 62 | if(iInstalledVersion < gCurrentVersion.GetValueInt()) 63 | if(iInstalledVersion > 0) 64 | InstallModChanges() 65 | else 66 | iInstalledVersion = gCurrentVersion.GetValueInt() 67 | endif 68 | endif 69 | EndFunction 70 | 71 | 72 | Function HandleInstallModChanges() 73 | ; Use format: 74 | ; if(iInstalledVersion < X) 75 | ; ; Make changes 76 | ; endif 77 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Library/WorkshopMenuInjectionQuest.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Library:WorkshopMenuInjectionQuest.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Library:WorkshopMenuInjectionQuest extends WorkshopFramework:Library:SlaveQuest 15 | { Inject additional menus into the workshop menu system safely } 16 | 17 | 18 | import WorkshopFramework:Library:DataStructures 19 | import WorkshopFramework:Library:UtilityFunctions 20 | import WorkshopFramework:WorkshopFunctions 21 | 22 | 23 | ; --------------------------------------------- 24 | ; Consts 25 | ; --------------------------------------------- 26 | 27 | int iWorkshopMenuManagerFormID = 0x0001143E Const 28 | 29 | ; --------------------------------------------- 30 | ; Editor Properties 31 | ; --------------------------------------------- 32 | 33 | 34 | Group MyMod 35 | WorkshopMenuInjection[] Property MyMenuInjections Auto Const 36 | { Add an entry for each vanilla workshop menu you'd like to inject to. You do not need to enter sub-menus of your own menus here, since you can configure those custom formlists however you like. } 37 | GlobalVariable Property gMyModVersion Auto Const 38 | { Create a Global form, start it at 1, and then increase that number each time you update your mod for release so that WorkshopFramework knows to re-inject your menus for any player who upgrades your mod. (This makes the code run much faster) } 39 | EndGroup 40 | 41 | ; --------------------------------------------- 42 | ; Vars 43 | ; --------------------------------------------- 44 | 45 | Int iMyInstalledVersion = 0 46 | Bool bUpdateRegistrationsInProgress = false 47 | 48 | WorkshopFramework:WorkshopMenuManager Property WorkshopMenuManager Auto Hidden 49 | 50 | ; --------------------------------------------- 51 | ; Events 52 | ; --------------------------------------------- 53 | 54 | 55 | ; --------------------------------------------- 56 | ; Event Handlers 57 | ; --------------------------------------------- 58 | 59 | Function HandleQuestInit() 60 | if(Self == Game.GetFormFromFile(0x0001143F, "WorkshopFramework.esm") as Quest) 61 | ; The template itself shouldn't be running 62 | Stop() 63 | 64 | return 65 | endif 66 | 67 | 68 | while( ! WorkshopMenuManager.IsRunning()) 69 | Utility.Wait(1.0) 70 | endwhile 71 | 72 | Parent.HandleQuestInit() 73 | 74 | UpdateRegistrations() 75 | EndFunction 76 | 77 | Function HandleGameLoaded() 78 | UpdateVars() 79 | 80 | Parent.HandleGameLoaded() 81 | 82 | UpdateRegistrations() 83 | EndFunction 84 | 85 | ; --------------------------------------------- 86 | ; Functions 87 | ; --------------------------------------------- 88 | 89 | Function UpdateRegistrations() 90 | if((gMyModVersion != None && iMyInstalledVersion >= gMyModVersion.GetValueInt()) || ! WorkshopMenuManager.IsRunning()) 91 | ;/ 92 | if(bUpdateRegistrationsInProgress) 93 | Debug.MessageBox("Skipping registrations - in progress already.") 94 | elseif(gMyModVersion == None) 95 | Debug.MessageBox("Skipping registrations - gMyModVersion not set.") 96 | elseif(iMyInstalledVersion >= gMyModVersion.GetValueInt()) 97 | Debug.MessageBox("Skipping registrations - iMyInstalledVersion " + iMyInstalledVersion + " already installed.") 98 | elseif( ! WorkshopMenuManager.IsRunning()) 99 | Debug.MessageBox("Skipping registrations - WorkshopMenuManager isn't running.") 100 | endif 101 | /; 102 | 103 | return 104 | endif 105 | 106 | _HandleRegistrations() 107 | 108 | if(gMyModVersion != None) 109 | iMyInstalledVersion = gMyModVersion.GetValueInt() 110 | endif 111 | EndFunction 112 | 113 | Function _HandleRegistrations() 114 | if(bUpdateRegistrationsInProgress) 115 | return 116 | endif 117 | 118 | bUpdateRegistrationsInProgress = true 119 | 120 | int i = 0 121 | while(i < MyMenuInjections.Length) 122 | WorkshopMenuManager.RegisterMenu(MyMenuInjections[i]) 123 | 124 | i += 1 125 | endWhile 126 | 127 | bUpdateRegistrationsInProgress = false 128 | EndFunction 129 | 130 | 131 | Function UpdateVars() 132 | if( ! WorkshopMenuManager) 133 | WorkshopMenuManager = Game.GetFormFromFile(iWorkshopMenuManagerFormID, "WorkshopFramework.esm") as WorkshopFramework:WorkshopMenuManager 134 | endif 135 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/MainThreadManager.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:MainThreadManager.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:MainThreadManager extends WorkshopFramework:Library:ThreadManager 15 | 16 | ; ----------------------------------- 17 | ; Consts 18 | ; ----------------------------------- 19 | 20 | 21 | 22 | ; ----------------------------------- 23 | ; Editor Properties 24 | ; ----------------------------------- 25 | GlobalVariable Property gMCMVisualSetting_MaxThreadCount Auto Const Mandatory 26 | 27 | ; --------------------------------------------- 28 | ; Consts 29 | ; --------------------------------------------- 30 | 31 | int iUpdateThreadRunnersTimerID = 0 32 | 33 | ; --------------------------------------------- 34 | ; Events 35 | ; --------------------------------------------- 36 | 37 | Event OnTimer(Int aiTimerID) 38 | if(aiTimerID == iUpdateThreadRunnersTimerID) 39 | UpdateThreadRunnerVars() 40 | 41 | ; Call init function 42 | Parent.HandleQuestInit() 43 | endif 44 | EndEvent 45 | 46 | ; ----------------------------------- 47 | ; Overrides 48 | ; ----------------------------------- 49 | 50 | Function HandleQuestInit() 51 | ; First setup thread runners before initializing - as part of the initializing is to switch the state so the thread queues are available 52 | StartTimer(1.0, iUpdateThreadRunnersTimerID) 53 | EndFunction 54 | 55 | Function HandleInstallModChanges() 56 | Parent.HandleInstallModChanges() 57 | 58 | ; Copy our properties down to the threadrunners - this ensures they don't all need to have a bunch of properties set, nor do they need to keep touching back to the Threadmanager 59 | UpdateThreadRunnerVars() 60 | 61 | 62 | ; For patch specific updates, Use format: 63 | ; if(iInstalledVersion < X) 64 | ; ; Make changes 65 | ; endif 66 | EndFunction 67 | 68 | Function CalculateAvailableThreads() 69 | ; Determine how many threads this should allow itself 70 | if( ! bOverride) 71 | ; TODO - Look at list of installed plugins and determine how many threads to allow 72 | iMaxThreads = ThreadRunners.Length 73 | endif 74 | EndFunction 75 | 76 | 77 | 78 | ; ----------------------------------- 79 | ; Functions 80 | ; ----------------------------------- 81 | 82 | Function UpdateThreadRunnerVars() 83 | bool bInterrupt = false 84 | int i = 0 85 | while(i < ThreadRunners.Length && bInterrupt) 86 | WorkshopFramework:MainThreadRunner thisRunner = ThreadRunners[i] as WorkshopFramework:MainThreadRunner 87 | 88 | if(thisRunner) 89 | if(thisRunner.IsRunning()) 90 | ; Add any vars that need to be copied from a property on the manager down to each runner 91 | else 92 | bInterrupt = true 93 | endif 94 | endif 95 | 96 | i += 1 97 | endWhile 98 | 99 | if(bInterrupt) 100 | ; Try again shortly 101 | StartTimer(1.0, iUpdateThreadRunnersTimerID) 102 | endif 103 | EndFunction 104 | 105 | 106 | Function MCM_ChangeMaxThreads(Float afNewValue) 107 | gMCMVisualSetting_MaxThreadCount.SetValue(afNewValue) 108 | iMaxThreads = afNewValue as Int 109 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/MainThreadRunner.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:MainThreadRunner.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:MainThreadRunner extends WorkshopFramework:Library:ThreadRunner -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/NPCCreationManager.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:NPCCreationManager.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:NPCCreationManager extends WorkshopFramework:Library:SlaveQuest 15 | { Handles NPC Creation - this will include things like Settlers and Brahmin } 16 | 17 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/Fiber_PersistenceRemoveDeletedObjects.psc: -------------------------------------------------------------------------------- 1 | ScriptName WorkshopFramework:ObjectRefs:Fiber_PersistenceRemoveDeletedObjects Extends WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateBase 2 | { 3 | Clean deleted objects from the Persistence Manager 4 | } 5 | String Function __ScriptName() Global 6 | Return "WorkshopFramework:ObjectRefs:Fiber_PersistenceRemoveDeletedObjects" 7 | EndFunction 8 | Activator Function GetFiberBaseObject() Global 9 | ; Get the base object form this script is on 10 | Return Game.GetFormFromFile( 0x00006416, "WorkshopFramework.esm" ) As Activator 11 | EndFunction 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ;/ 21 | =========================================================== 22 | 23 | Fiber Parameters 24 | 25 | =========================================================== 26 | /; 27 | 28 | 29 | ;; Working parameters 30 | ObjectReference[] Property kObjects = None Auto Hidden 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | ;/ 40 | =========================================================== 41 | 42 | Implemented Overrides and Abstracts 43 | 44 | =========================================================== 45 | /; 46 | 47 | 48 | WorkshopFramework:Library:ObjectRefs:FiberController Function CreateFiberController( \ 49 | Bool abRegisterManagerCallback \ 50 | ) Global 51 | 52 | 53 | WorkshopFramework:PersistenceManager lkManager = WorkshopFramework:PersistenceManager.GetManager() 54 | 55 | 56 | ObjectReference[] lkObjects = lkManager.GetPersistedObjects() 57 | Int liCount = lkObjects.Length 58 | If( liCount == 0 ) 59 | Debug.TraceUser( WorkshopFramework:PersistenceManager.LogFile(), __ScriptName() + " :: CreateFiberController() :: No Work" ) 60 | Return None 61 | EndIf 62 | 63 | 64 | ScriptObject lkCallbackHandler = None 65 | Int liCallbackID = 0 66 | 67 | If( abRegisterManagerCallback ) 68 | lkCallbackHandler = lkManager 69 | liCallbackID = lkManager.iFiberID_CleanDeadPersistentObjects 70 | EndIf 71 | 72 | 73 | ;; Work backwards through the RefCollectionAlias as we may be removing Objects 74 | WorkshopFramework:Library:ObjectRefs:FiberController lkController = WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateBase._CreateFiberController( \ 75 | GetFiberBaseObject(), \ 76 | None, \ 77 | liCount, \ 78 | abWorkBackwards = True, \ 79 | akOnFiberCompleteHandler = lkCallbackHandler, \ 80 | aiCallbackID = liCallbackID ) 81 | 82 | If( lkController == None ) 83 | Debug.TraceUser( WorkshopFramework:PersistenceManager.LogFile(), __ScriptName() + " :: CreateFiberController() :: An error occured in FiberController.Create()" ) 84 | 85 | Else 86 | 87 | WorkshopFramework:ObjectRefs:Fiber_PersistenceRemoveDeletedObjects lkFiber 88 | Int liFiberCount = lkController.iTotalFibers 89 | Int liIndex = 0 90 | While( liIndex < liFiberCount ) 91 | 92 | lkFiber = lkController.GetFiber( liIndex ) As WorkshopFramework:ObjectRefs:Fiber_PersistenceRemoveDeletedObjects 93 | If( lkFiber != None ) 94 | 95 | lkFiber.kObjects = lkObjects 96 | 97 | Else 98 | Debug.TraceUser( WorkshopFramework:PersistenceManager.LogFile(), __ScriptName() + " :: CreateFiberController() :: Fibers created did not cast as the proper Fiber class!" ) 99 | lkController.Delete() ;; <--- This will also delete the Fibers 100 | Return None 101 | EndIf 102 | 103 | liIndex += 1 104 | EndWhile 105 | 106 | EndIf 107 | 108 | 109 | ;; Return the Controller 110 | Return lkController 111 | EndFunction 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | ;/ 121 | =========================================================== 122 | 123 | WSFW Fiber 124 | 125 | =========================================================== 126 | /; 127 | 128 | 129 | Function ReleaseObjectReferences() 130 | 131 | kObjects = None 132 | 133 | Parent.ReleaseObjectReferences() 134 | EndFunction 135 | 136 | 137 | ;; Batch processing 138 | Function ProcessIndex( Int aiIndex ) 139 | 140 | ObjectReference lkREFR = _GetObject( aiIndex ) 141 | 142 | If( lkREFR == None ) 143 | ;; Just exit, no error 144 | Return 145 | EndIf 146 | 147 | If( !_ObjectNeedsPersistence( lkREFR ) ) 148 | 149 | ;; Remove the Object from the Alias 150 | _UnpersistObject( lkREFR ) 151 | 152 | ;; Record the change 153 | Increment() 154 | 155 | EndIf 156 | 157 | EndFunction 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | ;/ 167 | =========================================================== 168 | 169 | Get the next object 170 | 171 | =========================================================== 172 | /; 173 | 174 | 175 | ObjectReference Function _GetObject( Int aiIndex ) 176 | Return kObjects[ aiIndex ] 177 | EndFunction 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/Fiber_PersistenceUpdateObjects.psc: -------------------------------------------------------------------------------- 1 | ScriptName WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateObjects Extends WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateBase 2 | { 3 | Forced persistence scanning Fiber 4 | } 5 | String Function __ScriptName() Global 6 | Return "WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateObjects" 7 | EndFunction 8 | Activator Function GetFiberBaseObject() Global 9 | ; Get the base object form this script is on 10 | Return Game.GetFormFromFile( 0x00006417, "WorkshopFramework.esm" ) As Activator 11 | EndFunction 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ;/ 21 | =========================================================== 22 | 23 | Fiber Parameters 24 | 25 | =========================================================== 26 | /; 27 | 28 | 29 | ;; Working parameters 30 | ObjectReference[] Property kObjects = None Auto Hidden 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | ;/ 40 | =========================================================== 41 | 42 | Implemented Overrides and Abstracts 43 | 44 | =========================================================== 45 | /; 46 | 47 | 48 | WorkshopFramework:Library:ObjectRefs:FiberController Function CreateFiberController( \ 49 | WorkshopScript akWorkshop, \ 50 | ObjectReference[] akObjects, \ 51 | Bool abRegisterManagerCallback \ 52 | ) Global 53 | 54 | 55 | Int liCount = akObjects.Length 56 | If( liCount == 0 ) 57 | Debug.TraceUser( WorkshopFramework:PersistenceManager.LogFile(), __ScriptName() + " :: CreateFiberController() :: akObjects is None or Empty" ) 58 | Return None 59 | EndIf 60 | 61 | 62 | ScriptObject lkOnFiberCompleteHandler = None 63 | Int liCallbackID = 0 64 | If( abRegisterManagerCallback ) 65 | WorkshopFramework:PersistenceManager lkManager = WorkshopFramework:PersistenceManager.GetManager() 66 | lkOnFiberCompleteHandler = lkManager 67 | liCallbackID = lkManager.iFiberID_PersistenceScanObjects 68 | EndIf 69 | 70 | 71 | WorkshopFramework:Library:ObjectRefs:FiberController lkController = WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateBase._CreateFiberController( \ 72 | GetFiberBaseObject(), \ 73 | akWorkshop, \ 74 | liCount, \ 75 | akOnFiberCompleteHandler = lkOnFiberCompleteHandler, \ 76 | aiCallbackID = liCallbackID ) 77 | 78 | If( lkController != None ) 79 | 80 | WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateObjects lkFiber 81 | Int liFiberCount = lkController.iTotalFibers 82 | Int liIndex = 0 83 | While( liIndex < liFiberCount ) 84 | 85 | lkFiber = lkController.GetFiber( liIndex ) As WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateObjects 86 | If( lkFiber != None ) 87 | 88 | lkFiber.kObjects = akObjects 89 | 90 | Else 91 | Debug.TraceUser( WorkshopFramework:PersistenceManager.LogFile(), __ScriptName() + " :: CreateFiberController() :: Fibers created did not cast as the proper Fiber class!" ) 92 | lkController.Delete() ;; <--- This will also delete the Fibers 93 | Return None 94 | EndIf 95 | 96 | liIndex += 1 97 | EndWhile 98 | 99 | EndIf 100 | 101 | Return lkController 102 | EndFunction 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | ;/ 112 | =========================================================== 113 | 114 | WSFW Fiber 115 | 116 | =========================================================== 117 | /; 118 | 119 | 120 | Function ReleaseObjectReferences() 121 | 122 | kObjects = None 123 | 124 | Parent.ReleaseObjectReferences() 125 | EndFunction 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | ;/ 135 | =========================================================== 136 | 137 | Get the next object from the Array 138 | 139 | =========================================================== 140 | /; 141 | 142 | 143 | ObjectReference Function _GetObject( Int aiIndex ) 144 | Return kObjects[ aiIndex ] 145 | EndFunction 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/Fiber_PersistenceUpdateQueue.psc: -------------------------------------------------------------------------------- 1 | ScriptName WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateQueue Extends WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateBase 2 | { 3 | Forced persistence scanning Fiber 4 | } 5 | String Function __ScriptName() Global 6 | Return "WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateQueue" 7 | EndFunction 8 | Activator Function GetFiberBaseObject() Global 9 | ; Get the base object form this script is on 10 | Return Game.GetFormFromFile( 0x00006418, "WorkshopFramework.esm" ) As Activator 11 | EndFunction 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ;/ 21 | =========================================================== 22 | 23 | Fiber Parameters 24 | 25 | =========================================================== 26 | /; 27 | 28 | 29 | ;; Working parameters 30 | RefCollectionAlias Property kQueue = None Auto Hidden 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | ;/ 40 | =========================================================== 41 | 42 | Implemented Overrides and Abstracts 43 | 44 | =========================================================== 45 | /; 46 | 47 | 48 | WorkshopFramework:Library:ObjectRefs:FiberController Function CreateFiberController( \ 49 | WorkshopScript akWorkshop, \ 50 | RefCollectionAlias akQueue, \ 51 | Bool abRegisterManagerCallback \ 52 | ) Global 53 | 54 | 55 | If( akQueue == None ) 56 | Debug.TraceUser( WorkshopFramework:PersistenceManager.LogFile(), __ScriptName() + " :: CreateFiberController() :: akQueue is None" ) 57 | Return None 58 | EndIf 59 | 60 | 61 | Int liCount = akQueue.GetCount() 62 | If( liCount == 0 ) 63 | Debug.TraceUser( WorkshopFramework:PersistenceManager.LogFile(), __ScriptName() + " :: CreateFiberController() :: akQueue is Empty" ) 64 | Return None 65 | EndIf 66 | 67 | 68 | ScriptObject lkOnFiberCompleteHandler = None 69 | Int liCallbackID = 0 70 | If( abRegisterManagerCallback ) 71 | WorkshopFramework:PersistenceManager lkManager = WorkshopFramework:PersistenceManager.GetManager() 72 | lkOnFiberCompleteHandler = lkManager 73 | liCallbackID = lkManager.iFiberID_PersistenceScanQueue 74 | EndIf 75 | 76 | 77 | WorkshopFramework:Library:ObjectRefs:FiberController lkController = WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateBase._CreateFiberController( \ 78 | GetFiberBaseObject(), \ 79 | akWorkshop, \ 80 | liCount, \ 81 | akOnFiberCompleteHandler = lkOnFiberCompleteHandler, \ 82 | aiCallbackID = liCallbackID ) 83 | 84 | If( lkController != None ) 85 | 86 | WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateQueue lkFiber 87 | Int liFiberCount = lkController.iTotalFibers 88 | Int liIndex = 0 89 | While( liIndex < liFiberCount ) 90 | 91 | lkFiber = lkController.GetFiber( liIndex ) As WorkshopFramework:ObjectRefs:Fiber_PersistenceUpdateQueue 92 | If( lkFiber != None ) 93 | 94 | lkFiber.kQueue = akQueue 95 | 96 | Else 97 | Debug.TraceUser( WorkshopFramework:PersistenceManager.LogFile(), __ScriptName() + " :: CreateFiberController() :: Fibers created did not cast as the proper Fiber class!" ) 98 | lkController.Delete() ;; <--- This will also delete the Fibers 99 | Return None 100 | EndIf 101 | 102 | liIndex += 1 103 | EndWhile 104 | 105 | EndIf 106 | 107 | Return lkController 108 | EndFunction 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | ;/ 118 | =========================================================== 119 | 120 | WSFW Fiber 121 | 122 | =========================================================== 123 | /; 124 | 125 | 126 | Function ReleaseObjectReferences() 127 | 128 | kQueue = None 129 | 130 | Parent.ReleaseObjectReferences() 131 | EndFunction 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | ;/ 141 | =========================================================== 142 | 143 | Get the next object from the Queue 144 | 145 | =========================================================== 146 | /; 147 | 148 | 149 | ObjectReference Function _GetObject( Int aiIndex ) 150 | Return kQueue.GetAt( aiIndex ) 151 | EndFunction 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/InteriorWorkshopRoomboundHelper.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:ObjectRefs:InteriorWorkshopRoomboundHelper extends ObjectReference Const 2 | { Add this to the workshop of an interior settlement that uses Roombounds to fix the invisibility problem. } 3 | 4 | Event OnWorkshopObjectPlaced(ObjectReference akItemReference) 5 | akItemReference.Disable(false) 6 | akItemReference.Enable(false) 7 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/InvisibleWorkshopActorSpawner.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:ObjectRefs:InvisibleWorkshopActorSpawner.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:ObjectRefs:InvisibleWorkshopActorSpawner extends WorkshopFramework:ObjectRefs:InvisibleWorkshopObject 15 | { Spawns an NPC of some sort and then applies options to them. Actual built object only displays in workshop mode and scrapping that item also destroys the spawned actor. } 16 | 17 | Group SpawnedActor 18 | ReferenceAlias Property ApplyAlias Auto Const 19 | { Alias for applying AI packages and factions, should have "Can Apply Data to Non-Aliased Refs" checked in } 20 | Bool Property bPersistToLocation = true Auto Const 21 | { This ensures the NPC doesn't reset when the location unloads } 22 | Bool Property bRemoveFromExistingFactions = false Auto Const 23 | { If true, it will have all factions removed before ApplyAlias is called. This is useful for ensuring the NPC does not begin attacking immediately due to faction affiliations when using a default NPC record. } 24 | EndGroup 25 | 26 | 27 | Function UpdateDisplay() ; Override 28 | Parent.UpdateDisplay() ; Still call parent to handle most things 29 | 30 | Actor asActor = kControlledRef as Actor 31 | 32 | if(asActor) 33 | asActor.StopCombat() ; Just in case 34 | asActor.EnableAI(false) 35 | 36 | if(bRemoveFromExistingFactions) 37 | asActor.RemoveFromAllFactions() 38 | endif 39 | 40 | if(bPersistToLocation) 41 | asActor.ClearFromOldLocations() 42 | asActor.SetPersistLoc(asActor.GetCurrentLocation()) 43 | endif 44 | 45 | if(ApplyAlias != None) 46 | ApplyAlias.ApplyToRef(asActor) 47 | endif 48 | 49 | asActor.EnableAI(true) 50 | endif 51 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/MoveContainerItemsOnLoad.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:ObjectRefs:MoveContainerItemsOnLoad extends ObjectReference Const 2 | 3 | import WorkshopFramework:Library:UtilityFunctions 4 | 5 | Keyword Property MoveToLinkedRefOnKeyword = None Auto Const 6 | { Items will be moved to whatever GetLinkedRef(MoveToLinkedRefOnKeyword) returns } 7 | 8 | Event OnInit() 9 | StartTimer(3.0) 10 | EndEvent 11 | 12 | Event OnCellLoad() 13 | StartTimer(3.0) ; Give a moment to ensure this container and the linked have finished respawning 14 | EndEvent 15 | 16 | Event OnTimer(Int aiTimerID) 17 | MoveItems() 18 | EndEvent 19 | 20 | 21 | Function MoveItems() 22 | ObjectReference kTargetRef = GetLinkedRef(MoveToLinkedRefOnKeyword) 23 | 24 | ModTrace(">>>>>>>>>>>>>>> " + Self + " Moving " + Self.GetItemCount() + " items to " + kTargetRef) 25 | 26 | 27 | if(kTargetRef != None) 28 | Self.RemoveAllItems(kTargetRef, false) 29 | endif 30 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/PreventExportingRefHolder.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:ObjectRefs:PreventExportingRefHolder Const 2 | 3 | ObjectReference[] Property ProtectRefs Auto Const Mandatory 4 | 5 | Event OnInit() 6 | ; IgnoreAccuracyBonusInUI 7 | Keyword PreventExportKeyword = Game.GetFormFromFile(0x00247F26, "Fallout4.esm") as Keyword 8 | int i = 0 9 | while(i < ProtectRefs.Length) 10 | ProtectRefs[i].AddKeyword(PreventExportKeyword) 11 | 12 | i += 1 13 | endWhile 14 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/PreventScrappingVanillaRefHolder.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:ObjectRefs:PreventScrappingVanillaRefHolder Const 2 | 3 | ObjectReference[] Property ProtectRefs Auto Const Mandatory 4 | 5 | Event OnInit() 6 | ; WISabotageStart 7 | Keyword PreventScrapKeyword = Game.GetFormFromFile(0x0006D1E5, "Fallout4.esm") as Keyword 8 | int i = 0 9 | while(i < ProtectRefs.Length) 10 | ProtectRefs[i].AddKeyword(PreventScrapKeyword) 11 | 12 | i += 1 13 | endWhile 14 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/RealInventoryDisplayPoint.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; Scriptname WorkshopFramework:ObjectRefs:RealInventoryDisplayPoint.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:ObjectRefs:RealInventoryDisplayPoint extends ObjectReference Const 15 | 16 | import WorkshopFramework:Library:UtilityFunctions 17 | 18 | Formlist Property ValidObjectsToDisplay Auto Const Mandatory 19 | { A formlist of the items that are OK to place at this point. Should be items that will fit within the same space and that have a similar positioned origin point, they should also all be items that the vendor you expect to use these with would have in inventory. The longer this list, the slower this functionality will be. } 20 | 21 | 22 | Function DisplayItem(Form akItem) 23 | WorkshopFramework:Forms:RealInventoryProxyItem asProxyItem = akItem as WorkshopFramework:Forms:RealInventoryProxyItem 24 | 25 | Form DisplayMe 26 | if(asProxyItem && asProxyItem.DisplayVersion != None) 27 | DisplayMe = GetUniversalForm(asProxyItem.DisplayVersion) 28 | else 29 | DisplayMe = akItem 30 | endif 31 | 32 | ObjectReference kItemRef = GetDisplayItem() 33 | if(kItemRef && kItemRef.GetBaseObject() != DisplayMe) 34 | Cleanup() 35 | endif 36 | 37 | kItemRef = PlaceAtMe(DisplayMe, abInitiallyDisabled = true) 38 | kItemRef.BlockActivation(abBlocked = True, abHideActivateText = true) 39 | Self.SetLinkedRef(kItemRef) 40 | kItemRef.AddKeyword(GetBlockWorkshopInteractionKeyword()) 41 | kItemRef.Enable(false) 42 | kItemRef.WaitFor3dLoad() 43 | kItemRef.SetMotionType(Motion_Keyframed) 44 | EndFunction 45 | 46 | Function Cleanup() 47 | ObjectReference kItemRef = GetDisplayItem() 48 | if(kItemRef != None) 49 | kItemRef.Disable(false) 50 | kItemRef.Delete() 51 | 52 | SetLinkedRef(None) 53 | endif 54 | EndFunction 55 | 56 | ObjectReference Function GetDisplayItem() 57 | return GetLinkedRef() 58 | EndFunction 59 | 60 | Function Disable(Bool abFade = false) 61 | Cleanup() 62 | 63 | Parent.Disable(abFade) 64 | EndFunction 65 | 66 | Function Delete() 67 | Cleanup() 68 | 69 | Parent.Delete() 70 | EndFunction 71 | 72 | Keyword Function GetBlockWorkshopInteractionKeyword() 73 | return Game.GetFormFromFile(0x001BDBA6, "Fallout4.esm") as Keyword 74 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/SelfResettingRef.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:ObjectRefs:SelfResettingRef extends ObjectReference 2 | 3 | import WorkshopFramework:Library:UtilityFunctions 4 | 5 | Float Property fResetTime = 0.0 Auto Const 6 | { If set, this container will be set to reset every this many game hours } 7 | 8 | Bool bResetTimerRunning = false 9 | 10 | Event OnInit() 11 | if(fResetTime > 0.0 && ! bResetTimerRunning) 12 | StartResetTimer() 13 | endif 14 | EndEvent 15 | 16 | Event OnCellLoad() 17 | if(fResetTime > 0.0 && ! bResetTimerRunning) 18 | if( ! IsValidForm(Self)) 19 | return 20 | endif 21 | 22 | Reset() ; Immediately reset the first time to ensure in correct state 23 | StartResetTimer() 24 | endif 25 | EndEvent 26 | 27 | 28 | Event OnTimerGameTime(Int aiTimerID) 29 | if( ! IsValidForm(Self)) 30 | return 31 | endif 32 | 33 | Reset() 34 | StartResetTimer() 35 | EndEvent 36 | 37 | Function StartResetTimer() 38 | StartTimerGameTime(fResetTime) 39 | bResetTimerRunning = true 40 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/Thread_AddNPCToWorkshop.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:ObjectRefs:Thread_AddNPCToWorkshop.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:ObjectRefs:Thread_AddNPCToWorkshop extends WorkshopFramework:Library:ObjectRefs:Thread 15 | 16 | import WorkshopFramework:WorkshopFunctions 17 | 18 | Actor Property kActorToAssign Auto Hidden 19 | WorkshopScript Property kWorkshopRef Auto Hidden 20 | 21 | Function RunCode() 22 | AddActorToWorkshop(kActorToAssign, kWorkshopRef) 23 | EndFunction 24 | 25 | function ReleaseObjectReferences() 26 | kActorToAssign = none 27 | kWorkshopRef = none 28 | endfunction 29 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/Thread_FindAndScrapObject.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:ObjectRefs:Thread_FindAndScrapObject.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:ObjectRefs:Thread_FindAndScrapObject extends WorkshopFramework:Library:ObjectRefs:Thread 15 | 16 | import WorkshopFramework:Library:DataStructures 17 | import WorkshopFramework:Library:UtilityFunctions 18 | 19 | ; - 20 | ; Consts 21 | ; - 22 | 23 | 24 | ; - 25 | ; Editor Properties 26 | ; - 27 | WorkshopFramework:PlaceObjectManager Property PlaceObjectManager Auto Const Mandatory 28 | Form Property PositionHelper Auto Const Mandatory 29 | 30 | ; - 31 | ; Properties 32 | ; - 33 | WorkshopScript Property kWorkshopRef Auto Hidden 34 | WorldObject Property ScrapObjectData Auto Hidden 35 | 36 | ; - 37 | ; Events 38 | ; - 39 | 40 | ; - 41 | ; Functions 42 | ; - 43 | 44 | Function ReleaseObjectReferences() 45 | kWorkshopRef = None 46 | EndFunction 47 | 48 | 49 | Function RunCode() 50 | ; Check if object exists 51 | ObjectReference kPositionHelper = kWorkshopRef.PlaceAtMe(PositionHelper) 52 | kPositionHelper.SetPosition(ScrapObjectData.fPosX, ScrapObjectData.fPosY, ScrapObjectData.fPosZ) 53 | 54 | Form BaseForm = GetWorldObjectForm(ScrapObjectData) 55 | 56 | ObjectReference kFoundRef = Game.FindClosestReferenceOfTypeFromRef(BaseForm, kPositionHelper, 5.0) 57 | 58 | ; If found, is it already disabled? 59 | Bool bScrapNeeded = true 60 | if(kFoundRef != None) 61 | ;ModTrace("Thread_FindAndScrapObject search for " + BaseForm + ", found ref " + kFoundRef) 62 | if(kFoundRef.IsDisabled()) 63 | ModTrace(" " + kFoundRef + " already disabled.") 64 | bScrapNeeded = false 65 | endif 66 | else 67 | bScrapNeeded = false 68 | endif 69 | 70 | ; Found, scrap it 71 | if(bScrapNeeded) 72 | PlaceObjectManager.ScrapObject(kFoundRef, abCallbackEventNeeded = false) 73 | endif 74 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/Thread_RestoreObject.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:ObjectRefs:Thread_RestoreObject.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:ObjectRefs:Thread_RestoreObject extends WorkshopFramework:Library:ObjectRefs:Thread 15 | 16 | import WorkshopFramework:Library:DataStructures 17 | import WorkshopFramework:Library:UtilityFunctions 18 | 19 | ; - 20 | ; Consts 21 | ; - 22 | 23 | 24 | ; - 25 | ; Editor Properties 26 | ; - 27 | WorkshopFramework:PlaceObjectManager Property PlaceObjectManager Auto Const Mandatory 28 | Form Property PositionHelper Auto Const Mandatory 29 | 30 | ; - 31 | ; Properties 32 | ; - 33 | WorkshopScript Property kWorkshopRef Auto Hidden 34 | WorldObject Property RestoreObjectData Auto Hidden 35 | 36 | ; - 37 | ; Events 38 | ; - 39 | 40 | ; - 41 | ; Functions 42 | ; - 43 | 44 | Function ReleaseObjectReferences() 45 | kWorkshopRef = None 46 | EndFunction 47 | 48 | 49 | Function RunCode() 50 | ; Check if object already exists 51 | if(RestoreObjectData == None || kWorkshopRef == None) 52 | return 53 | endif 54 | 55 | ObjectReference kPositionHelper = kWorkshopRef.PlaceAtMe(PositionHelper) 56 | kPositionHelper.SetPosition(RestoreObjectData.fPosX, RestoreObjectData.fPosY, RestoreObjectData.fPosZ) 57 | 58 | Form BaseForm = GetWorldObjectForm(RestoreObjectData) 59 | 60 | ObjectReference kFoundRef = Game.FindClosestReferenceOfTypeFromRef(BaseForm, kPositionHelper, 5.0) 61 | 62 | ;ModTrace("Thread_RestoreObject attempting to restore " + BaseForm) 63 | ; If yes, can we restore it? 64 | Bool bCreateNew = true 65 | if(kFoundRef != None) 66 | ModTrace(" Found ref " + kFoundRef) 67 | if(kFoundRef.IsDisabled()) 68 | ;ModTrace(" Ref was disabled, let's re-enable it.") 69 | kFoundRef.Enable(false) 70 | 71 | Utility.Wait(0.01) 72 | 73 | if( ! kFoundRef.IsDisabled()) 74 | bCreateNew = false 75 | endif 76 | else 77 | bCreateNew = false 78 | endif 79 | endif 80 | 81 | ; Can't find or can't restore, build a new one 82 | if(bCreateNew) 83 | ;ModTrace(" No ref found, creating new.") 84 | Int iPlaceObjectCallbackID = PlaceObjectManager.CreateObject(RestoreObjectData, kWorkshopRef, abCallbackEventNeeded = false) 85 | endif 86 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/Thread_ScrapVanillaObject.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:ObjectRefs:Thread_ScrapVanillaObject.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:ObjectRefs:Thread_ScrapVanillaObject extends WorkshopFramework:Library:ObjectRefs:Thread 15 | 16 | import WorkshopFramework:Library:DataStructures 17 | import WorkshopFramework:Library:UtilityFunctions 18 | 19 | ; - 20 | ; Consts 21 | ; - 22 | 23 | 24 | ; - 25 | ; Editor Properties 26 | ; - 27 | WorkshopFramework:PlaceObjectManager Property PlaceObjectManager Auto Const Mandatory 28 | Form Property PositionHelper Auto Const Mandatory 29 | 30 | ; - 31 | ; Properties 32 | ; - 33 | WorkshopScript Property kWorkshopRef Auto Hidden 34 | WorldObject Property ScrapObjectData Auto Hidden 35 | 36 | ; - 37 | ; Events 38 | ; - 39 | 40 | ; - 41 | ; Functions 42 | ; - 43 | 44 | Function ReleaseObjectReferences() 45 | kWorkshopRef = None 46 | EndFunction 47 | 48 | 49 | Function RunCode() 50 | ; Check if object exists 51 | ObjectReference kPositionHelper = kWorkshopRef.PlaceAtMe(PositionHelper) 52 | kPositionHelper.SetPosition(ScrapObjectData.fPosX, ScrapObjectData.fPosY, ScrapObjectData.fPosZ) 53 | 54 | Form BaseForm = GetWorldObjectForm(ScrapObjectData) 55 | 56 | ObjectReference kFoundRef = Game.FindClosestReferenceOfTypeFromRef(BaseForm, kPositionHelper, 5.0) 57 | 58 | ; If found, is it already disabled? 59 | Bool bScrapNeeded = true 60 | if(kFoundRef != None) 61 | if(kFoundRef.IsDisabled()) 62 | bScrapNeeded = false 63 | endif 64 | else 65 | bScrapNeeded = false 66 | endif 67 | 68 | ; Found, scrap it 69 | if(bScrapNeeded) 70 | PlaceObjectManager.ScrapObject(kFoundRef, abCallbackEventNeeded = false) 71 | endif 72 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/Thread_ToggleInvisibleWorkshopObjects.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:ObjectRefs:Thread_ToggleInvisibleWorkshopObjects.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:ObjectRefs:Thread_ToggleInvisibleWorkshopObjects extends WorkshopFramework:Library:ObjectRefs:Thread 15 | 16 | ; - 17 | ; Consts 18 | ; - 19 | 20 | 21 | ; - 22 | ; Editor Properties 23 | ; - 24 | 25 | 26 | ; - 27 | ; Properties 28 | ; - 29 | 30 | Bool Property bInWorkshopMode Auto Hidden 31 | ObjectReference[] Property kObjectRefs Auto Hidden 32 | 33 | ; - 34 | ; Events 35 | ; - 36 | 37 | ; - 38 | ; Functions 39 | ; - 40 | 41 | 42 | Function ReleaseObjectReferences() 43 | kObjectRefs = None 44 | EndFunction 45 | 46 | 47 | Function RunCode() 48 | int i = 0 49 | while(i < kObjectRefs.Length) 50 | WorkshopFramework:ObjectRefs:InvisibleWorkshopObject asInvis = kObjectRefs[i] as WorkshopFramework:ObjectRefs:InvisibleWorkshopObject 51 | if(asInvis) 52 | asInvis.Toggle(bInWorkshopMode) 53 | endif 54 | 55 | i += 1 56 | endWhile 57 | EndFunction 58 | 59 | 60 | Function AddObject(ObjectReference akObjectRef) 61 | if(kObjectRefs == None || kObjectRefs.Length == 0) 62 | kObjectRefs = new ObjectReference[0] 63 | endif 64 | 65 | kObjectRefs.Add(akObjectRef) 66 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ObjectRefs/Thread_UpdateClutteredItems.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:ObjectRefs:Thread_UpdateClutteredItems.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:ObjectRefs:Thread_UpdateClutteredItems extends WorkshopFramework:Library:ObjectRefs:Thread 15 | 16 | ; - 17 | ; Consts 18 | ; - 19 | 20 | 21 | ; - 22 | ; Editor Properties 23 | ; - 24 | 25 | 26 | ; - 27 | ; Properties 28 | ; - 29 | 30 | ObjectReference[] Property kObjectRefs Auto Hidden 31 | 32 | ; - 33 | ; Events 34 | ; - 35 | 36 | ; - 37 | ; Functions 38 | ; - 39 | 40 | 41 | Function ReleaseObjectReferences() 42 | kObjectRefs = None 43 | EndFunction 44 | 45 | 46 | Function RunCode() 47 | int i = 0 48 | while(i < kObjectRefs.Length) 49 | WorkshopFramework:ObjectRefs:ClutteredItem asCluttered = kObjectRefs[i] as WorkshopFramework:ObjectRefs:ClutteredItem 50 | if(asCluttered) 51 | asCluttered.DisplayClutter() 52 | endif 53 | 54 | i += 1 55 | endWhile 56 | EndFunction 57 | 58 | 59 | Function AddObject(ObjectReference akObjectRef) 60 | if(kObjectRefs == None || kObjectRefs.Length == 0) 61 | kObjectRefs = new ObjectReference[0] 62 | endif 63 | 64 | kObjectRefs.Add(akObjectRef) 65 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Quests/CanarySaveFileMonitor.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopFramework:Quests:CanarySaveFileMonitor extends Quest 2 | 3 | String sThisFullScriptName = "WorkshopFramework:Quests:CanarySaveFileMonitor" Const 4 | ; Inside the quotes, type the full script name including the folder you created. So if you put this in Fallout 4\Data\Scripts\Source\User\MyMod\ and you kept the script name the same, your full script name would be MyMod:CanarySaveFileMonitor (this should be the same thing you put in the Scriptname line at the top of this script!) 5 | 6 | 7 | 8 | int Property iSaveFileMonitor Auto Hidden ; Do not mess with ever - this is used by Canary to track data loss 9 | 10 | Event OnQuestInit() 11 | CheckForCanary() 12 | 13 | RegisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame") 14 | EndEvent 15 | 16 | Event Actor.OnPlayerLoadGame(Actor akSender) 17 | CheckForCanary() 18 | endEvent 19 | 20 | Function CheckForCanary() 21 | if(Game.IsPluginInstalled("CanarySaveFileMonitor.esl")) 22 | Var[] kArgs = new Var[2] 23 | kArgs[0] = Self as Quest 24 | kArgs[1] = sThisFullScriptName 25 | 26 | Utility.CallGlobalFunction("Canary:API", "MonitorForDataLoss", kArgs) 27 | endif 28 | EndFunction -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Quests/DoorFinder.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Quests:DoorFinder.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Quests:DoorFinder extends Quest 15 | 16 | Group Aliases 17 | LocationAlias Property RequestedLocation Auto Const Mandatory 18 | ReferenceAlias Property WorkshopAlias Auto Const Mandatory 19 | RefCollectionAlias Property SettlementDoors Auto Const Mandatory 20 | RefCollectionAlias Property DisabledDoors Auto Const Mandatory 21 | EndGroup 22 | 23 | int Property iCallerID = -1 Auto Hidden 24 | 25 | Event OnStoryScript(Keyword akKeyword, Location akLocation, ObjectReference akRef1, ObjectReference akRef2, int aiValue1, int aiValue2) 26 | iCallerID = aiValue1 27 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Quests/FetchLocationData.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Quests:FetchLocationData.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Quests:FetchLocationData extends WorkshopFramework:Library:StoryEventQuest 15 | 16 | Group Aliases 17 | LocationAlias Property RequestedLocation Auto Const Mandatory 18 | ReferenceAlias Property MapMarker Auto Const Mandatory 19 | { IMPORTANT - Intentionally not allowing disabled, as we don't want to fetch markers that are meant to be replaced. For example, Malden Middle School becomes Vault 75 once you discover it. } 20 | ReferenceAlias Property MapMarker02 Auto Const Mandatory 21 | { Some locations can end up with multiple map markers } 22 | ReferenceAlias Property MapMarker03 Auto Const Mandatory 23 | { Some locations can end up with multiple map markers } 24 | ReferenceAlias Property CenterMarker Auto Const Mandatory 25 | ReferenceAlias[] Property EdgeMarkers Auto Const Mandatory 26 | ReferenceAlias[] Property LinkedAttackMarkers Auto Const Mandatory 27 | ReferenceAlias[] Property NearbyMapMarkers Auto Const Mandatory 28 | EndGroup -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Quests/FindLayoutItems.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Quests:FindLayoutItems.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Quests:FindLayoutItems extends Quest 15 | 16 | Group Aliases 17 | LocationAlias Property NearestWorkshopLocation Auto Const Mandatory 18 | LocationAlias Property PlayerLocation Auto Const Mandatory 19 | LocationAlias Property CleaningItemsFromLocation Auto Const Mandatory 20 | ReferenceAlias Property NearestWorkshop Auto Const Mandatory 21 | RefCollectionAlias Property FoundItems Auto Const Mandatory 22 | EndGroup -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/ScrapFinder.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:ScrapFinder.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:ScrapFinder extends Quest 15 | 16 | RefCollectionAlias Property Scrappable Auto Const Mandatory 17 | RefCollectionAlias Property Lootable Auto Const Mandatory 18 | 19 | Int Property iCallerID = -1 Auto Hidden 20 | 21 | Event OnStoryScript(Keyword akKeyword, Location akLocation, ObjectReference akRef1, ObjectReference akRef2, int aiValue1, int aiValue2) 22 | iCallerID = aiValue1 23 | EndEvent -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/WSFW_APIQuest.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:WSFW_APIQuest.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDIT 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:WSFW_APIQuest extends WorkshopFramework:Library:SlaveQuest 15 | { Holds all properties needed by the global API functions } 16 | 17 | 18 | ; - 19 | ; Editor Properties 20 | ; - 21 | 22 | Group Controllers 23 | WorkshopParentScript Property WorkshopParent Auto Const Mandatory 24 | WorkshopFramework:MainQuest Property WSFW_Main Auto Const Mandatory 25 | WorkshopFramework:PlaceObjectManager Property PlaceObjectManager Auto Const Mandatory 26 | WorkshopFramework:WorkshopResourceManager Property WorkshopResourceManager Auto Const Mandatory 27 | WorkshopFramework:WorkshopProductionManager Property WorkshopProductionManager Auto Const Mandatory 28 | WorkshopFramework:NPCManager Property NPCManager Auto Const Mandatory 29 | WorkshopFramework:MessageManager Property MessageManager Auto Const Mandatory 30 | { 1.0.8 } 31 | WorkshopFramework:F4SEManager Property F4SEManager Auto Const Mandatory 32 | WorkshopFramework:HUDFrameworkManager Property HUDFrameworkManager Auto Const Mandatory 33 | 34 | WorkshopFramework:Quests:StoryEventManager Property StoryEventManager Auto Const Mandatory 35 | { 2.0.16 } 36 | EndGroup 37 | 38 | 39 | Group Keywords 40 | Keyword Property WorkshopItemKeyword Auto Const Mandatory 41 | Keyword Property WorkshopKeyword Auto Const Mandatory 42 | Keyword Property EventKeyword_FetchLocationData Auto Const Mandatory 43 | EndGroup -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopFramework/Weapons/SettlementLayoutLayer.psc: -------------------------------------------------------------------------------- 1 | ; --------------------------------------------- 2 | ; WorkshopFramework:Weapons:SettlementLayoutLayer.psc - by kinggath 3 | ; --------------------------------------------- 4 | ; Reusage Rights ------------------------------ 5 | ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below). 6 | ; 7 | ; Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | ; Do not directly recompile this script for redistribution without first renaming it to avoid compatibility issues with the mod this came from. 9 | ; 10 | ; IMPORTED SCRIPT CREDITS 11 | ; N/A 12 | ; --------------------------------------------- 13 | 14 | Scriptname WorkshopFramework:Weapons:SettlementLayoutLayer extends Form Const 15 | 16 | import WorkshopFramework:Library:DataStructures 17 | import WorkshopFramework:Library:UtilityFunctions 18 | -------------------------------------------------------------------------------- /Scripts/Source/User/WorkshopRadioBeaconRecruitScript.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorkshopRadioBeaconRecruitScript extends Quest Conditional 2 | {quickly summon new workshop recruit} 3 | 4 | ReferenceAlias Property Alias_Workshop Auto Const 5 | ReferenceAlias Property Alias_WorkshopAttackMarker Auto Const 6 | 7 | workshopparentscript Property WorkshopParent Auto Const 8 | 9 | ; WSFW 10 | String sWSFW_Plugin = "WorkshopFramework.esm" Const 11 | WorkshopFramework:NPCManager Property NPCManager Auto Hidden ; WSFW 1.0.1 - Switched to hidden, using GetFormFromFile and the new FillWSFWVars function to grab this so we can eliminate all vanilla form edits 12 | int iNPCManagerFormID = 0x000091E2 Const 13 | 14 | Function FillWSFWVars() 15 | if( ! NPCManager) 16 | NPCManager = Game.GetFormFromFile(iNPCManagerFormID, sWSFW_Plugin) as WorkshopFramework:NPCManager 17 | endif 18 | Endfunction 19 | 20 | function Startup() 21 | ; run random timer for new recruits to show up 22 | float gameTime = utility.RandomFloat(0.2, 0.5) 23 | 24 | StartTimerGameTime(gameTime) 25 | endFunction 26 | 27 | ; create new recruits 28 | Event OnTimerGameTime(int aiTimerID) 29 | FillWSFWVars() 30 | 31 | WorkshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 32 | NPCManager.CreateInitialSettlers(workshopRef, Alias_WorkshopAttackMarker.GetRef()) 33 | 34 | ;/ WSFW - Rerouting this code to NPCManager 35 | ; how many new settlers? 36 | int recruitRoll = utility.randomint(1, 100) 37 | int recruitCount = 1 38 | if recruitRoll > 60 39 | recruitCount = 2 40 | elseif recruitRoll > 80 41 | recruitCount = 3 42 | endif 43 | debug.trace(self + " recruitRoll=" + recruitRoll + ", creating " + recruitCount + " settlers") 44 | WorkshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript 45 | ; create new settler for this workshop at nearby marker 46 | int i = 0 47 | while i < recruitCount 48 | WorkshopParent.CreateActorPUBLIC(workshopRef, Alias_WorkshopAttackMarker.GetRef(), i == 0) 49 | 50 | 51 | i += 1 52 | endWhile 53 | /; 54 | 55 | ; flag this workshop - no more free recruits 56 | workshopRef.RadioBeaconFirstRecruit = true 57 | 58 | Stop() 59 | EndEvent 60 | --------------------------------------------------------------------------------