From 40085470bd261c98f1ca9fe0e3f4d6068f10be42 Mon Sep 17 00:00:00 2001 From: overdev Date: Mon, 11 Oct 2021 20:39:58 +0200 Subject: [PATCH] merged Eddoursul and Gavrants changes of the questsystem script, DisableDialogueQutting() now checks if the correct dialoguemenu file is used, new functions SetActorScale() and AdjustTimePeriodByEngineTimeError() by gavrant, moved the playerhousing scripts in the correct source folder --- scripts/_00e_questfunctions.pex | Bin 40665 -> 40665 bytes scripts/source/_00e_gaboff_grammophonesc.psc | 132 -- .../source/_00e_game_playerhouse_boardsc.psc | 186 --- .../source/_00e_placeablegrammophonplay.psc | 161 -- .../source/_00e_playerhousing_furniture.psc | 48 - .../_00e_playerhousing_furnitureitem.psc | 43 - .../_00e_playerhousing_lightfurniture.psc | 23 - .../_00e_playerhousing_mannequincontrol.psc | 231 --- .../_00e_playerhousingcurrentomanipulate.psc | 336 ---- .../_00e_playerhousingcurrentotranslation.psc | 117 -- scripts/source/_00e_playerhousingmaster.psc | 554 ------- scripts/source/_00e_playerhousingtutorial.psc | 14 - scripts/source/_00e_playersetupscript.psc | 663 -------- scripts/source/_00e_questfunctions.psc | 1420 ----------------- source/scripts/_00e_gaboff_grammophonesc.psc | 138 +- .../scripts/_00e_game_playerhouse_boardsc.psc | 5 +- .../scripts/_00e_placeablegrammophonplay.psc | 196 ++- .../scripts/_00e_playerhousing_furniture.psc | 63 +- .../_00e_playerhousing_furnitureitem.psc | 67 +- .../_00e_playerhousing_lightfurniture.psc | 4 +- .../_00e_playerhousing_mannequincontrol.psc | 458 +++--- .../_00e_playerhousingcurrentomanipulate.psc | 363 ++++- .../_00e_playerhousingcurrentotranslation.psc | 121 +- source/scripts/_00e_playerhousingmaster.psc | 664 +++++--- source/scripts/_00e_playerhousingtutorial.psc | 48 +- source/scripts/_00e_playersetupscript.psc | 39 +- source/scripts/_00e_questfunctions.psc | 31 +- 27 files changed, 1530 insertions(+), 4595 deletions(-) delete mode 100644 scripts/source/_00e_gaboff_grammophonesc.psc delete mode 100644 scripts/source/_00e_game_playerhouse_boardsc.psc delete mode 100644 scripts/source/_00e_placeablegrammophonplay.psc delete mode 100644 scripts/source/_00e_playerhousing_furniture.psc delete mode 100644 scripts/source/_00e_playerhousing_furnitureitem.psc delete mode 100644 scripts/source/_00e_playerhousing_lightfurniture.psc delete mode 100644 scripts/source/_00e_playerhousing_mannequincontrol.psc delete mode 100644 scripts/source/_00e_playerhousingcurrentomanipulate.psc delete mode 100644 scripts/source/_00e_playerhousingcurrentotranslation.psc delete mode 100644 scripts/source/_00e_playerhousingmaster.psc delete mode 100644 scripts/source/_00e_playerhousingtutorial.psc delete mode 100644 scripts/source/_00e_playersetupscript.psc delete mode 100644 scripts/source/_00e_questfunctions.psc diff --git a/scripts/_00e_questfunctions.pex b/scripts/_00e_questfunctions.pex index 649f7479b89ff11d09d5c9f24de7fd30aa958ef9..b1b1366de082380d292e3875e0411065b81b93f3 100644 GIT binary patch literal 40665 zcmb_^31Hks_5YjsZqhbK)AXd}Xt=LZnx; zB3>M#qKGK|6g==kF2$dSfC36A;K8AYfE;ppfO07OKkv=VcfOn57UB2L>vrcm$D22A z-n{qb&3yN@%{M<1Xi|i~>Bnv}hU8|^SZMJ{wisW#ZOH$1-nY4eZXw4Q~6|HI$W7brn6f{!wsXULLrseLNnVkW%H{yhJ(2zuD7$@i zm>%g2^ZDeKkgB?qgJCB|+>@nxpYH9-Zce5OG!wlQl9~RnJ()`9ebt#<+Mdk;cbE%N z-jiLMO%70PS2j1COs7r@S7%3aRLlQ&7ntP{N=5a-KxG!1g&W>gV3b|ze);z|90WWLN*6JQWbi^q^=H;uI>rb;Yc=D=vu#mrgevfmUKG1y<;F9t{6%d3So|>GS2R? zOqkm;=8#VA-kKWeNezP$GV)3M%&9z0T$ed!WPrtEvO{fVl&aiwN5*%%ZnQvC+mi#p z)SAW^S~3Hz_@e4q9@WJjq!cZ-hM?b!8zPu1(3GOQw#)!c!hf4md5AhqH{Wf8gJFMx z3D2{v?NTmRq;O`uq$?Y>m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6iR$OIk8T&;qm97kY_kHXSiuY#i$U5Bx)7mfhK1{JJ9eZ+P@hzHJ9_!hqG zjTT+f;yJYFDruoA$F`X5S}4Rg%e4Tfi~E@6S`bbM%e0^u#jkE zX89ISAjMQoh*}_)P>!mL#Ok^ip2YJ!4xihdP+2o&`KH(v;l`#MZyAf{k2* zr(~l|!$Hvda8YDQ%}u?jAizv7PnJxt#d7(Mv0OeD3vLHmEIb`?Ea&bR%eiB*;MSnU z!c!E-^7@Xkygn9-^*1oyr&tJsZeax$?lDNix?r@O4*k3-!u~Z<1yT*M?LwI_6MMQ~ z6QrEW5ZL9iO;H)J<4Ey&OV)eXA02?6L*pGERJF4&s7uRE|OquC<^Ly`kCe)qz zPwb%$pb&N7t^QTvA9f-amSVt+XDmC^BjsCWOIiY>32#cT*w4LzkYVKHsbG-rQ3WaN zyiT$NZvpwdn@lNs3$1VEI>AYn9^6VdX%0pmAVphD5t)~P*`$5e=VO>}$zAKBqbuH? LMeQwWdh7oIR#fSo diff --git a/scripts/source/_00e_gaboff_grammophonesc.psc b/scripts/source/_00e_gaboff_grammophonesc.psc deleted file mode 100644 index beb7f698..00000000 --- a/scripts/source/_00e_gaboff_grammophonesc.psc +++ /dev/null @@ -1,132 +0,0 @@ -Scriptname _00E_Gaboff_GrammophoneSC extends ObjectReference - -Message Property _00E_Gaboff_GrammophoneMSG Auto -Message Property _00E_PlayerhousingKoppophonVolume Auto -Sound Property _00E_MUS_Special_OceansWidowM Auto -MiscObject Property Gold001 Auto -Actor Property PlayerREF Auto - -Int iSoundID = -1 -Float fVolume = 0.5 -Bool bMusicLocked = False - -Float Property MUSIC_LENGTH = 212.3 AutoReadOnly - - -;===================================================================================== -; FUNCTIONS -;===================================================================================== - -Function PlayMusic(Sound musicSound, Float fMusicLength) - If fVolume <= 0.0 || fVolume > 1.0 - fVolume = 0.5 - EndIf - RegisterForModEvent("BardsLoadGame", "OnBardsLoadGame") - iSoundID = musicSound.Play(Self) - Sound.SetInstanceVolume(iSoundID, fVolume) - RegisterForSingleUpdate(_00E_QuestFunctions.AdjustTimePeriodByEngineTimerError(fMusicLength)) - GoToState("") - _00E_PlayerhousingKoppophonVolume.Show(fVolume * 100.0) -EndFunction - -Function ChangeMusicVolume() - If fVolume >= 0.0 && fVolume < 1.0 - fVolume += 0.25 - Else ; fVolume >= 1.0 or something is wrong with fVolume - fVolume = 0.0 - EndIf - Sound.SetInstanceVolume(iSoundID, fVolume) - _00E_PlayerhousingKoppophonVolume.Show(fVolume * 100.0) -EndFunction - -Function StopMusic() - bMusicLocked = True - - GoToState("DoneCleanup") - UnregisterForModEvent("BardsLoadGame") - UnregisterForUpdate() - - If iSoundID != -1 - Sound.StopInstance(iSoundID) - iSoundID = -1 - EndIf - - bMusicLocked = False -EndFunction - -Function TryStopMusic() - If bMusicLocked == False - StopMusic() - Else - RegisterForSingleUpdate(0.5) - EndIf -EndFunction - - -;===================================================================================== -; EVENTS -;===================================================================================== - -Event OnInit() - GoToState("DoneCleanup") -EndEvent - -Event OnActivate(ObjectReference akActionRef) - If akActionRef == PlayerREF && bMusicLocked == False - bMusicLocked = True - - If iSoundID == -1 - If _00E_Gaboff_GrammophoneMSG.Show() == 0 - PlayerREF.RemoveItem(Gold001, 5) - PlayMusic(_00E_MUS_Special_OceansWidowM, MUSIC_LENGTH) - EndIf - Else - ChangeMusicVolume() - EndIf - - bMusicLocked = False - EndIf -EndEvent - -Event OnUpdate() - TryStopMusic() -EndEvent - -Event OnBardsLoadGame(string eventName, string strArg, float numArg, Form sender) - ; Player just loaded a save with the gramophone playing. The sound is dead by now. - TryStopMusic() -EndEvent - -Event OnCellAttach() - TryStopMusic() -EndEvent - -Event OnLoad() - TryStopMusic() -EndEvent - -Event OnCellDetach() - TryStopMusic() -EndEvent - -Event OnUnload() - TryStopMusic() -EndEvent - -State DoneCleanup - Event OnCellAttach() - ; Do nothing - EndEvent - - Event OnLoad() - ; Do nothing - EndEvent - - Event OnCellDetach() - ; Do nothing - EndEvent - - Event OnUnload() - ; Do nothing - EndEvent -EndState diff --git a/scripts/source/_00e_game_playerhouse_boardsc.psc b/scripts/source/_00e_game_playerhouse_boardsc.psc deleted file mode 100644 index 5297a5c8..00000000 --- a/scripts/source/_00e_game_playerhouse_boardsc.psc +++ /dev/null @@ -1,186 +0,0 @@ -scriptName _00E_Game_Playerhouse_BoardSC extends ObjectReference conditional - -;===================================================================================== -; FUNCTIONS -;===================================================================================== - -function EnableFurniture(Int iLevel) - - FadeToBlackIMOD.Apply(1.00000) - utility.Wait(2 as Float) - FadeToBlackHoldIMOD.ApplyCrossFade(1 as Float) - if iLevel == 1 - _00E_Game_Playerhouse_ArkMarket_Level01Linker.Enable() - elseIf iLevel == 2 - _00E_Game_Playerhouse_ArkMarket_Level02Linker.Enable() - elseIf iLevel == 3 - _00E_Game_Playerhouse_ArkMarket_Level03Linker.Enable() - endIf - FadeToBlackBackIMOD.ApplyCrossFade(1 as Float) - -endFunction - -function DisableFurniture() - - FadeToBlackIMOD.Apply(1.00000) - utility.Wait(2 as Float) - FadeToBlackHoldIMOD.ApplyCrossFade(1 as Float) - _00E_Game_Playerhouse_ArkMarket_Level01Linker.Disable(false) - _00E_Game_Playerhouse_ArkMarket_Level02Linker.Disable(false) - _00E_Game_Playerhouse_ArkMarket_Level03Linker.Disable(false) - FadeToBlackBackIMOD.ApplyCrossFade(1 as Float) - -endFunction - - -function OnActivate(ObjectReference akActionRef) - - ;backwards compatibility for saves prior patch 1.2.3.0 - If (_00E_Game_Playerhouse_ArkMarket_Level01Linker.IsEnabled()) - _00E_FurniturePurchased.SetValue(1) - EndIf - ;backwards compatibility for saves prior patch 1.2.3.0 - - Int iButton = _00E_Game_PlayerHouse_ArkMarket_Board.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000) - if iButton == 7 - return - elseIf iButton == 0 - - If PlayerREF.GetParentCell() == CapitalCityPlayerhouse - PlayerREF.RemoveItem(Gold001, 300) - Else - PlayerREF.RemoveItem(Gold001, 1250) - EndIf - - _00E_FurniturePurchased.SetValue(1) - self.EnableFurniture(1) - - elseIf iButton == 1 - - If PlayerREF.GetParentCell() == CapitalCityPlayerhouse - PlayerREF.RemoveItem(Gold001, 500) - Else - PlayerREF.RemoveItem(Gold001, 1500) - EndIf - - _00E_FurniturePurchased.SetValue(2) - self.EnableFurniture(2) - - elseIf iButton == 2 - - If PlayerREF.GetParentCell() == CapitalCityPlayerhouse - PlayerREF.RemoveItem(Gold001, 700) - Else - PlayerREF.RemoveItem(Gold001, 1750) - EndIf - - _00E_FurniturePurchased.SetValue(3) - self.EnableFurniture(3) - - elseif iButton == 4 - - int iButton02 = _00E_Game_PlayerHouse_RemoveFurniture.Show() - - if iButton02 == 0 - - ReturnAndRefund() - - Else - - Activate(PlayerREF) - - EndIf - - elseif iButton == 5 - - Cell cCurrentCell = Self.GetParentCell() - String sHouseName = NQ24.ChooseHouseName() - cCurrentCell.SetName(sHouseName) - - If cCurrentCell == CapitalCityPlayerhouse - Player.sHouseMarketQuarterName = sHouseName - ElseIf cCurrentCell == CapitalCityPlayerHouseUpper - Player.sHouseNobleQuarterName = sHouseName - EndIf - - elseif iButton == 6 - - _00E_PlayerhousingMaster.GetMaster().ShowExpansionBoardTutorial() - - endIf - -endFunction - -;===================================================================================== -; FUNCTIONS -;===================================================================================== - -Function ReturnAndRefund() - - DisableFurniture() - - If PlayerREF.GetParentCell() == CapitalCityPlayerhouse - - If _00E_FurniturePurchased.GetValue() == 1 - PlayerREF.AddItem(Gold001, 150) - _00E_FurniturePurchased.SetValue(0) - ElseIf _00E_FurniturePurchased.GetValue() == 2 - PlayerREF.AddItem(Gold001, 250) - _00E_FurniturePurchased.SetValue(0) - ElseIf _00E_FurniturePurchased.GetValue() == 3 - PlayerREF.AddItem(Gold001, 350) - _00E_FurniturePurchased.SetValue(0) - EndIf - - ElseIf PlayerREF.GetParentCell() == CapitalCityPlayerhouseUpper - - If _00E_FurniturePurchased.GetValue() == 1 - PlayerREF.AddItem(Gold001, 625) - _00E_FurniturePurchased.SetValue(0) - ElseIf _00E_FurniturePurchased.GetValue() == 2 - PlayerREF.AddItem(Gold001, 750) - _00E_FurniturePurchased.SetValue(0) - ElseIf _00E_FurniturePurchased.GetValue() == 3 - PlayerREF.AddItem(Gold001, 875) - _00E_FurniturePurchased.SetValue(0) - EndIf - - EndIf - -EndFunction - -;===================================================================================== -; PROPERTIES -;===================================================================================== - -Actor Property PlayerREF Auto - -Cell Property CapitalCityPlayerhouse Auto -Cell Property CapitalCityPlayerHouseUpper Auto - -GlobalVariable Property _00E_FurniturePurchased Auto - -bool Property bLevel01FurniturePurchased Auto Conditional Hidden -bool Property bLevel02FurniturePurchased Auto Conditional Hidden -bool Property bLevel03FurniturePurchased Auto Conditional Hidden - -imagespacemodifier property FadeToBlackBackIMOD auto -ObjectReference property _00E_Game_Playerhouse_ArkMarket_Level01Linker auto -message property _00E_Game_PlayerHouse_ArkMarket_Board auto -imagespacemodifier property FadeToBlackIMOD auto -Bool property __Config_bHouseHasLevel02 auto conditional -{Check this if this house has level 02 furniture designed.} -ObjectReference property _00E_Game_Playerhouse_ArkMarket_Level02Linker auto -imagespacemodifier property FadeToBlackHoldIMOD auto -Bool property __Config_bHouseHasLevel01 auto conditional -{Check this if this house has level 01 furniture designed.} -ObjectReference property _00E_Game_Playerhouse_ArkMarket_Level03Linker auto -Bool property __Config_bHouseHasLevel03 auto conditional -{Check this if this house has level 03 furniture designed.} - -MiscObject Property Gold001 Auto - -Message Property _00E_Game_PlayerHouse_RemoveFurniture Auto - -_00E_NQ24_Playerhousing_Functions Property NQ24 Auto -_00E_PlayerHousing_CellNameSC Property Player Auto diff --git a/scripts/source/_00e_placeablegrammophonplay.psc b/scripts/source/_00e_placeablegrammophonplay.psc deleted file mode 100644 index 4a428c87..00000000 --- a/scripts/source/_00e_placeablegrammophonplay.psc +++ /dev/null @@ -1,161 +0,0 @@ -Scriptname _00E_PlaceableGrammophonPlay extends ObjectReference - -Sound Property _00E_MUS_Placeable_Koppophon Auto -MusicType Property _00E_SilenceTransitionHighPriority Auto ; OBSOLETE. Left for version update on older saves. -MusicType Property _00E_SilenceKoppophon Auto -GlobalVariable Property _00E_AchievementsEnabled Auto -Message Property _00E_PlayerhousingKoppophonVolume Auto -Actor Property PlayerREF Auto - -Int playbackId = -1 -Float volume = 0.5 -Bool bDone ; Unlocked END_KOPPOPHON_01 achievement -Bool bMusicLocked = False -Bool bOldSilenceUpdated = False - -Float Property MUSIC_LENGTH = 87.2 AutoReadOnly - - -;===================================================================================== -; FUNCTIONS -;===================================================================================== - -Function StopMusic() - bMusicLocked = True - - UnregisterForModEvent("BardsLoadGame") - UnregisterForUpdate() - - If bOldSilenceUpdated == False - bOldSilenceUpdated = True - If playbackId != -1 - _00E_SilenceTransitionHighPriority.Remove() - EndIf - EndIf - - If playbackId != -1 - Sound.StopInstance(playbackId) - playbackId = -1 - EndIf - - _00E_SilenceKoppophon.Remove() - - bMusicLocked = False -EndFunction - -Function TryStopMusic() - If bMusicLocked == False - StopMusic() - Else - RegisterForSingleUpdate(0.5) - EndIf -EndFunction - -Function Cleanup() - GoToState("DoneCleanup") - TryStopMusic() -EndFunction - - -;===================================================================================== -; EVENTS -;===================================================================================== - -Event OnInit() - GoToState("DoneCleanup") -EndEvent - -Event OnActivate(ObjectReference triggerRef) - If triggerRef == PlayerREF && _00E_PlayerhousingMaster.ReferenceCanBeActivated(Self) && bMusicLocked == False - bMusicLocked = True - - If playbackId == -1 ; Start playing - bOldSilenceUpdated = True - RegisterForModEvent("BardsLoadGame", "OnBardsLoadGame") - - _00E_SilenceKoppophon.Add() - - playbackId = _00E_MUS_Placeable_Koppophon.Play(Self) - If volume <= 0.0 || volume > 1.0 - volume = 0.5 - EndIf - Sound.SetInstanceVolume(playbackId, volume) - RegisterForSingleUpdate(_00E_QuestFunctions.AdjustTimePeriodByEngineTimerError(MUSIC_LENGTH)) - - GoToState("") - - _00E_PlayerhousingKoppophonVolume.Show(volume * 100.0) - - If _00E_AchievementsEnabled.GetValueInt() == 1 && (bDone == False) - bDone = True - Game.UnlockAchievement("END_KOPPOPHON_01") - EndIf - - ElseIf bOldSilenceUpdated == False - ; Player just loaded an older save with the Koppophon playing. The sound is dead by now. - StopMusic() - - Else ; Volume control - Float fNewVolume = volume + 0.25 - If fNewVolume > 1.0 - fNewVolume = 0.0 - EndIf - - Sound.SetInstanceVolume(playbackId, fNewVolume) - If fNewVolume == 0.0 ; On mute - _00E_SilenceKoppophon.Remove() - ElseIf volume == 0.0 ; On unmute - _00E_SilenceKoppophon.Add() - EndIf - volume = fNewVolume - - _00E_PlayerhousingKoppophonVolume.Show(volume * 100.0) - - EndIf - - bMusicLocked = False - EndIf -EndEvent - -Event OnUpdate() - TryStopMusic() -EndEvent - -Event OnBardsLoadGame(string eventName, string strArg, float numArg, Form sender) - ; Player just loaded a save with the Koppophon playing. The sound is dead by now. - TryStopMusic() -EndEvent - -Event OnCellAttach() - Cleanup() -EndEvent - -Event OnLoad() - Cleanup() -EndEvent - -Event OnCellDetach() - Cleanup() -EndEvent - -Event OnUnload() - Cleanup() -EndEvent - -State DoneCleanup - Event OnCellAttach() - ; Do nothing - EndEvent - - Event OnLoad() - ; Do nothing - EndEvent - - Event OnCellDetach() - ; Do nothing - EndEvent - - Event OnUnload() - ; Do nothing - EndEvent -EndState diff --git a/scripts/source/_00e_playerhousing_furniture.psc b/scripts/source/_00e_playerhousing_furniture.psc deleted file mode 100644 index f5717f8f..00000000 --- a/scripts/source/_00e_playerhousing_furniture.psc +++ /dev/null @@ -1,48 +0,0 @@ -scriptname _00E_Playerhousing_Furniture extends ObjectReference -{A manipulatable housing object while being in the world} - -Float Property CustomDistance Auto -{ Custom distance from the player in the placemenet Move Mode } -Float Property OffsetAngleZ Auto -{ Custom offset Z rotation in the placemenet Move Mode } -Float Property OffsetPositionZ Auto -{ Custom offset Z position in the placemenet Move Mode } -Bool Property IsSetPositionIncompatible Auto -{ If the .nif of the object has a bhkCollisionObject with SET_LOCAL flag, SetPosition() or MoveTo() can easily mess this object up in the placement mode. } - -Form Property InventoryItem Auto Hidden - -_00E_Playerhousing_FurnitureItem Property furnitureItem Auto Hidden -{ OBSOLETE. Left for compatibility with older saves. } - -Form Function GetInventoryItem() - If furnitureItem ; Update from the old way of storing the base inventory item - If InventoryItem == None - InventoryItem = furnitureItem.GetBaseObject() - EndIf - furnitureItem = None - EndIf - - Return InventoryItem -EndFunction - -Function finishPlacement() - ; This function is called when the furniture object is at the right position and being placed. - - SetMotionType(Motion_Dynamic, True) - - ; in case we place a mannequin, we need to store its position - ObjectReference myObjRef = self as ObjectReference - If myObjRef as _00E_Playerhousing_MannequinControl - (myObjRef as _00E_Playerhousing_MannequinControl).FinishPlacement() - Else - BlockActivation(true) - Disable() - Utility.Wait(0.1) - Enable() - - If myObjRef as _00E_Phasmalist_Workbench - (myObjRef as _00E_Phasmalist_Workbench).FinishPlacement() - EndIf - EndIf -EndFunction diff --git a/scripts/source/_00e_playerhousing_furnitureitem.psc b/scripts/source/_00e_playerhousing_furnitureitem.psc deleted file mode 100644 index 30ea0540..00000000 --- a/scripts/source/_00e_playerhousing_furnitureitem.psc +++ /dev/null @@ -1,43 +0,0 @@ -scriptname _00E_Playerhousing_FurnitureItem extends ObjectReference -{A manipulatable housing object while being in the players inventory} - -ActorBase Property _MANNEQUIN_toCreate auto -Furniture Property _FURNITURE_toCreate auto -Container Property _CONTAINER_toCreate auto -Light Property _LIGHT_toCreate auto -MiscObject Property _MISC_toCreate Auto -Activator Property _ACTIVATOR_toCreate Auto - -_00E_PlayerhousingMaster Property master Auto - -Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) - If akNewContainer == None - If master == None - master = _00E_PlayerhousingMaster.GetMaster() - EndIf - master.playerItemDropped(Self) - EndIf -EndEvent - -_00E_Playerhousing_Furniture Function placeFurnitureAtMe() - _00E_Playerhousing_Furniture result = None - If _MANNEQUIN_toCreate - result = PlaceAtMe(_MANNEQUIN_toCreate, abForcePersist = True, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture - ElseIf _FURNITURE_toCreate - result = PlaceAtMe(_FURNITURE_toCreate, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture - ElseIf _CONTAINER_toCreate - result = PlaceAtMe(_CONTAINER_toCreate, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture - ElseIf _LIGHT_toCreate - result = PlaceAtMe(_LIGHT_toCreate, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture - ElseIf _ACTIVATOR_toCreate - result = PlaceAtMe(_ACTIVATOR_toCreate, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture - ElseIf _MISC_toCreate - result = PlaceAtMe(_MISC_toCreate, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture - EndIf - - If result == None - Debug.MessageBox("ERROR: *_toCreate property in playerhousingfurnitureitem is no furnitureitem, please write a bugticket") - EndIf - - Return result -EndFunction \ No newline at end of file diff --git a/scripts/source/_00e_playerhousing_lightfurniture.psc b/scripts/source/_00e_playerhousing_lightfurniture.psc deleted file mode 100644 index e61375f6..00000000 --- a/scripts/source/_00e_playerhousing_lightfurniture.psc +++ /dev/null @@ -1,23 +0,0 @@ -Scriptname _00E_Playerhousing_LightFurniture extends _00E_Playerhousing_Furniture - -Light Property LIGHT_toCreate auto -{not used due to graphic bugs} -; ObjectReference createdLight - -function finishPlacement() -{this function is called when the furniture object is at the right position and being placed; use e.g. for light} - parent.finishPlacement() - ;real light cannot be placed since it causes graphic bugs - - ;createdLight = placeAtMe(LIGHT_toCreate) - ;createdLight.setScale(0.99) -Endfunction - -;/ -Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) - if akOldContainer== None - createdLight.disable() - createdLight.delete() - Endif -Endevent -/; \ No newline at end of file diff --git a/scripts/source/_00e_playerhousing_mannequincontrol.psc b/scripts/source/_00e_playerhousing_mannequincontrol.psc deleted file mode 100644 index 8b70a7b1..00000000 --- a/scripts/source/_00e_playerhousing_mannequincontrol.psc +++ /dev/null @@ -1,231 +0,0 @@ -Scriptname _00E_Playerhousing_MannequinControl extends Actor - -import utility - -Actor Property PlayerREF Auto - -Bool bIsInPlacementMode = False -Bool bActivationBlocked = False - - -;===================================================================================== -; EVENTS -;===================================================================================== - -Event OnCellLoad() - If bIsInPlacementMode == False - ResetOnLoad() - EndIf -EndEvent - -Event OnLoad() - If bIsInPlacementMode - ResetOnLoad() - EndIf -EndEvent - -Event OnActivate(ObjectReference TriggerRef) - If TriggerRef == PlayerREF && _00E_PlayerhousingMaster.ReferenceCanBeActivated(self) && bActivationBlocked == False - bActivationBlocked = True - - ConvertArmorSlots() ; Version update - - OpenInventory(True) - ResetPosition() - Wait(0.1) - EnableAI(False) - - bActivationBlocked = False - EndIf -EndEvent - -Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) - If (akBaseItem as Armor) - If TryRegisterAddedArmor(akBaseItem) - EquipItem(akBaseItem) - Else - ;Turn it back if the mannequin has one of these already, or if all the slots are full. - RemoveItem(akBaseItem, aiItemCount, True, PlayerREF) - EndIf - Else - RemoveItem(akBaseItem, aiItemCount, True, PlayerREF) - EndIf -EndEvent - -Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference) - If (akBaseObject as Armor) - UnregisterRemovedArmor(akBaseObject) - EndIf -EndEvent - - -;===================================================================================== -; ARMOR SLOTS TRACKING -;===================================================================================== - -Form Property ArmorSlot01 Auto Hidden ; Obsolete. Left for version updates on older saves. -Form Property ArmorSlot02 Auto Hidden ; Obsolete. Left for version updates on older saves. -Form Property ArmorSlot03 Auto Hidden ; Obsolete. Left for version updates on older saves. -Form Property ArmorSlot04 Auto Hidden ; Obsolete. Left for version updates on older saves. -Form Property ArmorSlot05 Auto Hidden ; Obsolete. Left for version updates on older saves. -Form Property ArmorSlot06 Auto Hidden ; Obsolete. Left for version updates on older saves. -Form Property ArmorSlot07 Auto Hidden ; Obsolete. Left for version updates on older saves. -Form Property ArmorSlot08 Auto Hidden ; Obsolete. Left for version updates on older saves. -Form Property ArmorSlot09 Auto Hidden ; Obsolete. Left for version updates on older saves. -Form Property ArmorSlot10 Auto Hidden ; Obsolete. Left for version updates on older saves. - -Form[] ArmorSlots -Bool bConvertedArmorSlots = False - -Function ConvertArmorSlots() - If bConvertedArmorSlots - Return - EndIf - bConvertedArmorSlots = True - - ArmorSlots = New Form[10] - - Int index = _ConvertArmorSlot(0, ArmorSlot01) - index = _ConvertArmorSlot(index, ArmorSlot02) - index = _ConvertArmorSlot(index, ArmorSlot03) - index = _ConvertArmorSlot(index, ArmorSlot04) - index = _ConvertArmorSlot(index, ArmorSlot05) - index = _ConvertArmorSlot(index, ArmorSlot06) - index = _ConvertArmorSlot(index, ArmorSlot07) - index = _ConvertArmorSlot(index, ArmorSlot08) - index = _ConvertArmorSlot(index, ArmorSlot09) - index = _ConvertArmorSlot(index, ArmorSlot10) - - ArmorSlot01 = None - ArmorSlot02 = None - ArmorSlot03 = None - ArmorSlot04 = None - ArmorSlot05 = None - ArmorSlot06 = None - ArmorSlot07 = None - ArmorSlot08 = None - ArmorSlot09 = None - ArmorSlot10 = None -EndFunction - -Int Function _ConvertArmorSlot(Int index, Form armorItem) - If armorItem && ArmorSlots.Find(armorItem) < 0 - ArmorSlots[index] = armorItem - index += 1 - EndIf - - Return index -EndFunction - -Bool Function TryRegisterAddedArmor(Form armorItem) - ; First check to see if this is already in a slot - If ArmorSlots.Find(armorItem) >= 0 - Return False - EndIf - - ; Now find an emtpy slot to put it in, if there is one. - Int i = 0 - While i < ArmorSlots.Length - If ArmorSlots[i] == None - ArmorSlots[i] = armorItem - Return True - EndIf - - i += 1 - EndWhile - - ; Nope. No room left. - Return False -EndFunction - -Function UnregisterRemovedArmor(Form armorItem) - ;This loop will also clear duplicates that might have been generated. - Int i = 0 - While i < ArmorSlots.Length - If ArmorSlots[i] == armorItem - ArmorSlots[i] = None - EndIf - i += 1 - EndWhile -EndFunction - -Function ReequipAllArmor() - UnequipAll() - - Int i = 0 - While i < ArmorSlots.Length - If ArmorSlots[i] - EquipItem(ArmorSlots[i]) - EndIf - i += 1 - EndWhile -EndFunction - - -;===================================================================================== -; FUNCTIONS -;===================================================================================== - -Float forceX -Float forceY -Float forceZ -Float forceAngleX -Float forceAngleY -Float forceAngleZ - -Bool bPosisionValidated = False - -Function ResetPosition() - If bPosisionValidated == False - bPosisionValidated = True - - If forceX == 0 && forceY == 0 && forceZ == 0 - Float fAngleZ = PlayerREF.GetAngleZ() - Float fDistanceFromPlayer = 100.0 - - forceX = PlayerREF.GetPositionX() + fDistanceFromPlayer * Math.sin(fAngleZ) - forceY = PlayerREF.GetPositionY() + fDistanceFromPlayer * Math.cos(fAngleZ) - forceZ = PlayerREF.GetPositionZ() - EndIf - EndIf - - SetPosition(forceX, forceY, forceZ) - SetAngle(forceAngleX, forceAngleY, forceAngleZ) -EndFunction - -Function ResetOnLoad() - ConvertArmorSlots() ; Version update - - BlockActivation() - - EnableAI(True) - If bIsInPlacementMode == False - ResetPosition() - EndIf - ReequipAllArmor() - EnableAI(False) -EndFunction - -Function StartPlacement() - bIsInPlacementMode = True -EndFunction - -Function FinishPlacement() - bIsInPlacementMode = False - - Disable() - - forceX = GetPositionX() - forceY = GetPositionY() - forceZ = GetPositionZ() - forceAngleX = GetAngleX() - forceAngleY = GetAngleY() - forceAngleZ = GetAngleZ() - - bPosisionValidated = True - - Enable() - - _00E_QuestFunctions.WaitForReferenceToLoad(self) - ResetOnLoad() -EndFunction diff --git a/scripts/source/_00e_playerhousingcurrentomanipulate.psc b/scripts/source/_00e_playerhousingcurrentomanipulate.psc deleted file mode 100644 index ff095ced..00000000 --- a/scripts/source/_00e_playerhousingcurrentomanipulate.psc +++ /dev/null @@ -1,336 +0,0 @@ -Scriptname _00E_PlayerhousingCurrentOManipulate extends ReferenceAlias - -EffectShader Property _00E_PlayerHousingManipulationShader Auto -Sound Property UIMenuPrevNext Auto -Actor Property PlayerRef Auto - -String Property CONTROL_TURN_LEFT = "Strafe Left" AutoReadOnly -String Property CONTROL_TURN_RIGHT = "Strafe Right" AutoReadOnly -String Property CONTROL_MOVE_UP = "Forward" AutoReadOnly -String Property CONTROL_MOVE_DOWN = "Back" AutoReadOnly - -Int Property TRANSLATION_TURN_LEFT = 0 AutoReadOnly -Int Property TRANSLATION_TURN_RIGHT = 1 AutoReadOnly -Int Property TRANSLATION_MOVE_UP = 2 AutoReadOnly -Int Property TRANSLATION_MOVE_DOWN = 3 AutoReadOnly - -Int Property STATE_IDLE = 0 AutoReadOnly -Int Property STATE_UPDATING = 1 AutoReadOnly -Int Property STATE_WORKING = 2 AutoReadOnly - -Float Property ROTATION_SPEED_START = 15.0 AutoReadOnly -Float Property ROTATION_SPEED_FALLBACK = 20.0 AutoReadOnly -Float Property ROTATION_SPEED_MAX = 180.0 AutoReadOnly -Float Property ROTATION_SPEED_CHANGE_MOD = 0.25 AutoReadOnly -Float Property ROTATION_MAX = 90.0 AutoReadOnly - -Float Property MOVEMENT_SPEED_START = 10.0 AutoReadOnly -Float Property MOVEMENT_SPEED_FALLBACK = 20.0 AutoReadOnly -Float Property MOVEMENT_SPEED_MAX = 200.0 AutoReadOnly -Float Property MOVEMENT_SPEED_CHANGE_MOD = 0.25 AutoReadOnly -Float Property MOVEMENT_MAX = 100.0 AutoReadOnly - -Float Property FAST_TRANSLATION_SPEED = 1000000.0 AutoReadOnly - -Float fObjectPosX -Float fObjectPosY -Float fObjectPosZ -Float fObjectAngleX -Float fObjectAngleY -Float fObjectAngleZ -Float fPlayerPosZ -Float fTablePosZ - -Float fTranslationSpeed -Float fTranslationSpeedIncrease - -Int iWorkingState -Int iCurrentTranslation -Bool bGamepadMode -Int iWatchedKeyCode -Int iTurnLeftKey -Int iTurnRightKey -Int iMoveUpKey -Int iMoveDownKey - -Function Setup(ObjectReference curObjectRef) - ForceRefTo(curObjectRef) - - iWorkingState = STATE_IDLE - - bGamepadMode = Game.UsingGamepad() - If bGamepadMode == False - iTurnLeftKey = Input.GetMappedKey(CONTROL_TURN_LEFT, 0) - iTurnRightKey = Input.GetMappedKey(CONTROL_TURN_RIGHT, 0) - iMoveUpKey = Input.GetMappedKey(CONTROL_MOVE_UP, 0) - iMoveDownKey = Input.GetMappedKey(CONTROL_MOVE_DOWN, 0) - Else - iTurnLeftKey = 274 - iTurnRightKey = 275 - iMoveUpKey = 280 - iMoveDownKey = 281 - EndIf - - If PlayerRef == None ; Just in case - PlayerRef = Game.GetPlayer() - EndIf - - fPlayerPosZ = PlayerRef.GetPositionZ() - fTablePosZ = fPlayerPosZ + 64.0 - - GoToState("Working") - - TryRegisterForKey(iTurnLeftKey, CONTROL_TURN_LEFT) - TryRegisterForKey(iTurnRightKey, CONTROL_TURN_RIGHT) - TryRegisterForKey(iMoveUpKey, CONTROL_MOVE_UP) - TryRegisterForKey(iMoveDownKey, CONTROL_MOVE_DOWN) - - _00E_PlayerHousingManipulationShader.Play(curObjectRef) -EndFunction - -Function TryRegisterForKey(Int iKeyCode, String control) - If iKeyCode > 0 - RegisterForKey(iKeyCode) - Else - RegisterForControl(control) - EndIf -EndFunction - -Function Shutdown(Bool bRegisterNewOffsets) - GoToState("") - UnregisterForAllKeys() - UnregisterForAllControls() - UnregisterForUpdate() - - ObjectReference myRef = GetRef() - If myRef != None - _00E_PlayerHousingManipulationShader.Stop(myRef) - - While iWorkingState != STATE_IDLE && iWorkingState != STATE_WORKING - Utility.WaitMenuMode(0.05) - EndWhile - If iWorkingState == STATE_WORKING - myRef.StopTranslation() - EndIf - - If bRegisterNewOffsets - Float fNewOffsetAngleZ = myRef.GetAngleZ() - PlayerRef.GetAngleZ() - Float fNewOffsetPosZ = myRef.GetPositionZ() - PlayerRef.GetPositionZ() - (GetOwningQuest() as _00E_PlayerhousingMaster).RegisterNewHousingObjectOffsets(fNewOffsetAngleZ, fNewOffsetPosZ) - EndIf - - Clear() - EndIf -EndFunction - -State Working - Event OnKeyDown(Int iKeyCode) - TryStartTranslation(KeyCodeToTranslationMode(iKeyCode), iKeyCode) - EndEvent - - Event OnKeyUp(Int iKeyCode, Float fHoldTime) - TryStopTranslation(KeyCodeToTranslationMode(iKeyCode)) - EndEvent - - Event OnControlDown(String control) - TryStartTranslation(ControlToTranslationMode(control), 0) - EndEvent - - Event OnControlUp(String control, Float fHoldTime) - TryStopTranslation(ControlToTranslationMode(control)) - EndEvent - - Event OnUpdate() - ; OnControlUp is not always properly triggered. Maybe OnKeyUp too. The code below is a workaround for that. - ; For gamepads this failsafe is useless because Input.IsKeyPressed always returns False for controller buttons. - If iWatchedKeyCode > 0 && iWorkingState == STATE_WORKING - If Input.IsKeyPressed(iWatchedKeyCode) - RegisterForSingleUpdate(0.05) - Else - TryStopTranslation(iCurrentTranslation) - EndIf - EndIf - EndEvent - - Event OnTranslationComplete() - ; The previously started translation reached its end point - - If iWorkingState != STATE_WORKING - Return - EndIf - iWorkingState = STATE_UPDATING - - ObjectReference myRef = GetRef() - - If iWatchedKeyCode <= 0 || fTranslationSpeedIncrease < 0.0 - ; Do nothing - ElseIf iCurrentTranslation == TRANSLATION_TURN_LEFT || iCurrentTranslation == TRANSLATION_TURN_RIGHT - Float fRotationAngle = GetNextTranslationStep(ROTATION_SPEED_MAX, ROTATION_SPEED_CHANGE_MOD, ROTATION_MAX) - fObjectAngleZ = myRef.GetAngleZ() - TurnTranslate(myRef, fRotationAngle) - - iWorkingState = STATE_WORKING - Return - ElseIf iCurrentTranslation == TRANSLATION_MOVE_UP || iCurrentTranslation == TRANSLATION_MOVE_DOWN - Float fMoveZ = GetNextTranslationStep(MOVEMENT_SPEED_MAX, MOVEMENT_SPEED_CHANGE_MOD, MOVEMENT_MAX) - fObjectPosZ = myRef.GetPositionZ() - MoveTranslate(myRef, fMoveZ) - - iWorkingState = STATE_WORKING - Return - EndIf - - ; Fallback - FinalizeTranslation(myRef) - UIMenuPrevNext.Play(PlayerRef) - - iWorkingState = STATE_IDLE - EndEvent -EndState - -Int Function KeyCodeToTranslationMode(Int iKeyCode) - If iKeyCode > 0 - If iKeyCode == iTurnLeftKey - Return TRANSLATION_TURN_LEFT - ElseIf iKeyCode == iTurnRightKey - Return TRANSLATION_TURN_RIGHT - ElseIf iKeyCode == iMoveUpKey - Return TRANSLATION_MOVE_UP - ElseIf iKeyCode == iMoveDownKey - Return TRANSLATION_MOVE_DOWN - EndIf - EndIf - - Return -1 -EndFunction - -Int Function ControlToTranslationMode(String control) - If control == CONTROL_TURN_LEFT - Return TRANSLATION_TURN_LEFT - ElseIf control == CONTROL_TURN_RIGHT - Return TRANSLATION_TURN_RIGHT - ElseIf control == CONTROL_MOVE_UP - Return TRANSLATION_MOVE_UP - ElseIf control == CONTROL_MOVE_DOWN - Return TRANSLATION_MOVE_DOWN - EndIf - - Return -1 -EndFunction - -Function TryStartTranslation(Int iTranslationMode, Int iTriggerKeyCode) - If iTranslationMode < 0 || iWorkingState != STATE_IDLE - Return - EndIf - - iWorkingState = STATE_UPDATING - iCurrentTranslation = iTranslationMode - iWatchedKeyCode = iTriggerKeyCode - - ObjectReference myRef = GetRef() - - fObjectPosX = myRef.GetPositionX() - fObjectPosY = myRef.GetPositionY() - fObjectPosZ = myRef.GetPositionZ() - - fObjectAngleX = myRef.GetAngleX() - fObjectAngleY = myRef.GetAngleY() - fObjectAngleZ = myRef.GetAngleZ() - - fTranslationSpeedIncrease = 0.0 - - If iCurrentTranslation == TRANSLATION_TURN_LEFT || iCurrentTranslation == TRANSLATION_TURN_RIGHT - If iWatchedKeyCode > 0 - fTranslationSpeed = ROTATION_SPEED_START - TurnTranslate(myRef, fTranslationSpeed * ROTATION_SPEED_CHANGE_MOD) - Else - fTranslationSpeed = ROTATION_SPEED_FALLBACK - TurnTranslate(myRef, ROTATION_MAX) - EndIf - ElseIf iCurrentTranslation == TRANSLATION_MOVE_UP || iCurrentTranslation == TRANSLATION_MOVE_DOWN - If iWatchedKeyCode > 0 - fTranslationSpeed = MOVEMENT_SPEED_START - MoveTranslate(myRef, fTranslationSpeed * MOVEMENT_SPEED_CHANGE_MOD) - Else - fTranslationSpeed = MOVEMENT_SPEED_FALLBACK - MoveTranslate(myRef, MOVEMENT_MAX) - EndIf - EndIf - - If iWatchedKeyCode > 0 && bGamepadMode == False - RegisterForSingleUpdate(0.05) - EndIf - - iWorkingState = STATE_WORKING -EndFunction - -Function TryStopTranslation(Int iTranslationMode) - If iCurrentTranslation != iTranslationMode || iWorkingState != STATE_WORKING - Return - EndIf - - iWorkingState = STATE_UPDATING - - ObjectReference myRef = GetRef() - myRef.StopTranslation() - UnregisterForUpdate() - FinalizeTranslation(myRef) - - iWorkingState = STATE_IDLE -EndFunction - -Function TurnTranslate(ObjectReference myRef, Float fRotationAngle) - If iCurrentTranslation == TRANSLATION_TURN_LEFT - fObjectAngleZ -= fRotationAngle - Else - fObjectAngleZ += fRotationAngle - EndIf - myRef.TranslateTo(fObjectPosX, fObjectPosY, fObjectPosZ, fObjectAngleX, fObjectAngleY, fObjectAngleZ, FAST_TRANSLATION_SPEED, fTranslationSpeed) -EndFunction - -Function MoveTranslate(ObjectReference myRef, Float fMoveZ) - If iCurrentTranslation == TRANSLATION_MOVE_DOWN - Float fNewZ = fObjectPosZ - fMoveZ - If fObjectPosZ > fTablePosZ && fNewZ < fTablePosZ - ; A primitive "drop on the table" - fNewZ = fTablePosZ - fTranslationSpeedIncrease = -1.0 ; Stop on reaching fPlayerPosZ. - ElseIf fObjectPosZ > fPlayerPosZ && fNewZ < fPlayerPosZ - ; A primitive "drop on the floor" - fNewZ = fPlayerPosZ - fTranslationSpeedIncrease = -1.0 ; Stop on reaching fPlayerPosZ. - EndIf - fObjectPosZ = fNewZ - Else - fObjectPosZ += fMoveZ - EndIf - myRef.TranslateTo(fObjectPosX, fObjectPosY, fObjectPosZ, fObjectAngleX, fObjectAngleY, fObjectAngleZ, fTranslationSpeed, FAST_TRANSLATION_SPEED) -EndFunction - -Float Function GetNextTranslationStep(Float fSpeedMax, Float fSpeedChangeMod, Float fChangeMax) - If fTranslationSpeed < fSpeedMax - If fTranslationSpeedIncrease < 20.0 - fTranslationSpeedIncrease += 5.0 - EndIf - fTranslationSpeed += fTranslationSpeedIncrease - If fTranslationSpeed > fSpeedMax - fTranslationSpeed = fSpeedMax - EndIf - EndIf - Float fResult = fTranslationSpeed * fSpeedChangeMod - If fTranslationSpeed >= fSpeedMax || fResult > fChangeMax - Return fChangeMax - Else - Return fResult - EndIf -EndFunction - -Function FinalizeTranslation(ObjectReference myRef) - ; TranslateTo below prevents the object from twitching and becoming blurry when a translation ends - If iCurrentTranslation == TRANSLATION_TURN_LEFT || iCurrentTranslation == TRANSLATION_TURN_RIGHT - fObjectAngleZ = myRef.GetAngleZ() - ElseIf iCurrentTranslation == TRANSLATION_MOVE_UP || iCurrentTranslation == TRANSLATION_MOVE_DOWN - fObjectPosZ = myRef.GetPositionZ() - EndIf - myRef.TranslateTo(fObjectPosX, fObjectPosY, fObjectPosZ, fObjectAngleX, fObjectAngleY, fObjectAngleZ, FAST_TRANSLATION_SPEED, FAST_TRANSLATION_SPEED) -EndFunction diff --git a/scripts/source/_00e_playerhousingcurrentotranslation.psc b/scripts/source/_00e_playerhousingcurrentotranslation.psc deleted file mode 100644 index 45bac641..00000000 --- a/scripts/source/_00e_playerhousingcurrentotranslation.psc +++ /dev/null @@ -1,117 +0,0 @@ -Scriptname _00E_PlayerhousingCurrentOTranslation extends ReferenceAlias - -EffectShader Property _00E_PlayerHousingTranslationShader Auto -Actor Property PlayerRef Auto - -Bool bIsWorking = False -Bool bIsWarmingUp = False - -Float fDistance -Float fOffsetAngleZ -Float fOffsetPosZ - -Float Property ORBIT_ANGULAR_SPEED_CAP = 30.0 AutoReadOnly -Float Property FAST_TRANSLATION_SPEED = 1000000.0 AutoReadOnly - - -Function Setup(_00E_Playerhousing_Furniture furnitureRef, Bool bEnteringPlacement, Float fStoredOffsetAngleZ, Float fStoredOffsetPositionZ) - bIsWarmingUp = True - furnitureRef.Disable() - - If PlayerRef == None - PlayerRef = Game.GetPlayer() - EndIf - - fDistance = furnitureRef.CustomDistance - If fDistance <= 0.0 - fDistance = 100.0 - EndIf - - If bEnteringPlacement - fOffsetAngleZ = furnitureRef.OffsetAngleZ - fOffsetPosZ = furnitureRef.OffsetPositionZ - - If furnitureRef.IsSetPositionIncompatible == False - Float x = PlayerRef.GetPositionX() - Float y = PlayerRef.GetPositionY() - Float z = PlayerRef.GetPositionZ() - Float fAngleZ = PlayerRef.GetAngleZ() - - furnitureRef.SetPosition(x + fDistance * Math.sin(fAngleZ), y + fDistance * Math.cos(fAngleZ), z + fOffsetPosZ) - furnitureRef.SetAngle(0, 0, fAngleZ + fOffsetAngleZ) - EndIf - - ObjectReference myRef = furnitureRef as ObjectReference - If (myRef as _00E_Playerhousing_MannequinControl) - (myRef as _00E_Playerhousing_MannequinControl).StartPlacement() - ElseIf (myRef as _00E_Phasmalist_Workbench) - (myRef as _00E_Phasmalist_Workbench).StartPlacement() - EndIf - Else - fOffsetAngleZ = fStoredOffsetAngleZ - fOffsetPosZ = fStoredOffsetPositionZ - EndIf - - ForceRefTo(furnitureRef) - bIsWorking = True - furnitureRef.Enable() -EndFunction - -Function Shutdown() - bIsWorking = False - - ObjectReference myRef = GetRef() - If myRef - While bIsWarmingUp && (PlayerRef.GetParentCell() == myRef.GetParentCell()) - Utility.WaitMenuMode(0.05) - EndWhile - myRef.StopTranslation() - _00E_PlayerHousingTranslationShader.Stop(myRef) - Clear() - EndIf -EndFunction - -Event OnLoad() - ; Loop needs to be extracted from the rest of the code due to performance reasons (don't know why exactly, but defining new functions slows this down dramatically) - ObjectReference myRef = GetRef() - Float fPrevAngleZ = -1.0 - - myRef.SetMotionType(4) ; Set motion type to Motion_Keyframed. This would fix "collision phantoms" of the object while the player is moving around "dragging" it. - _00E_PlayerHousingTranslationShader.Play(myRef) - - bIsWarmingUp = False - - While bIsWorking - Float x = PlayerRef.GetPositionX() - Float y = PlayerRef.GetPositionY() - Float z = PlayerRef.GetPositionZ() - Float fAngleZ = PlayerRef.GetAngleZ() - - ; Cap the angular speed of the object's orbiting around the player at ORBIT_ANGULAR_SPEED_CAP. - ; This fixes some objects pushing the player (because they pass THROUGH the player?) on sharp camera turns. - If fPrevAngleZ >= 0.0 - Float fDelta = fAngleZ - fPrevAngleZ - If fDelta < -180.0 - fDelta += 360.0 - ElseIf fDelta > 180.0 - fDelta -= 360.0 - EndIf - If fDelta < -ORBIT_ANGULAR_SPEED_CAP - fAngleZ = fPrevAngleZ - ORBIT_ANGULAR_SPEED_CAP - If fAngleZ < 0.0 - fAngleZ += 360.0 - EndIf - ElseIf fDelta > ORBIT_ANGULAR_SPEED_CAP - fAngleZ = fPrevAngleZ + ORBIT_ANGULAR_SPEED_CAP - If fAngleZ >= 360.0 - fAngleZ -= 360.0 - EndIf - EndIf - EndIf - - If bIsWorking - myRef.TranslateTo(x + fDistance * Math.sin(fAngleZ), y + fDistance * Math.cos(fAngleZ), z + fOffsetPosZ, 0, 0, fAngleZ + fOffsetAngleZ, FAST_TRANSLATION_SPEED, FAST_TRANSLATION_SPEED) - EndIf - fPrevAngleZ = fAngleZ - EndWhile -EndEvent diff --git a/scripts/source/_00e_playerhousingmaster.psc b/scripts/source/_00e_playerhousingmaster.psc deleted file mode 100644 index bff27002..00000000 --- a/scripts/source/_00e_playerhousingmaster.psc +++ /dev/null @@ -1,554 +0,0 @@ -scriptname _00E_PlayerhousingMaster extends Quest - -Actor Property player Auto -ReferenceAlias Property currentHousingObjectInTranslation Auto -ReferenceAlias Property currentHousingObjectInManipulation Auto -Message Property _00E_Playerhousing_CannotPlaceObjectsHere Auto -Message Property _00E_Playerhousing_ContainerContentMove Auto -Message Property _00E_Playerhousing_StartTutorial Auto -Message Property _00E_Playerhousing_ExpansionBoardTutorial Auto -Message Property _00E_Playerhousing_TranslationMode Auto -Message Property _00E_Playerhousing_TranslationModeTutorial Auto -Message Property _00E_Playerhousing_TranslationModeTutorial_Gamepad Auto -Message Property _00E_Playerhousing_ManipulationMode Auto -Message Property _00E_Playerhousing_ManipulationModeTutorial Auto -Message Property _00E_Playerhousing_ManipulationModeTutorial_Gamepad Auto -Sound Property UIMenuActive Auto -GlobalVariable Property _00E_Meditate_Allowed Auto -GlobalVariable Property _00E_Phasmalist_TankMode Auto -GlobalVariable Property _00E_DisableCraftingTutorials Auto - -_00E_Playerhousing_Furniture currentHousingObject - -Bool bIsInPlacementMode = False -Bool bDisableNormalActivation = False -Bool bGamepadMode = False -Bool bDroppedFromInventory = False -Int iPickupKey - -Float fStoredOffsetAngleZ -Float fStoredOffsetPositionZ - -String Property CONTROL_ACTIVATE = "Activate" AutoReadOnly -String Property CONTROL_SHEATH = "Ready Weapon" AutoReadOnly - - -;===================================================================================== -; GLOBAL FUNCTIONS -;===================================================================================== - -_00E_PlayerhousingMaster Function GetMaster() Global - Return Game.GetFormFromFile(0x00043270, "Skyrim.esm") as _00E_PlayerhousingMaster -EndFunction - -Bool Function ReferenceCanBeActivated(ObjectReference ref) Global - If (ref as _00E_Playerhousing_Furniture) - _00E_PlayerhousingMaster master = GetMaster() - If master - Return master.IsNormalActivationEnabled() - EndIf - EndIf - - Return True -EndFunction - - -;===================================================================================== -; TUTORIALS -;===================================================================================== - -Bool bStartTutorialShown = False - -Bool bHideTranslationTutorial = False -Bool bHideTranslationTutorial_Gamepad = False -Bool bHideManipulationTutorial = False -Bool bHideManipulationTutorial_Gamepad = False - -Function ShowStartBuildModeTutorial() - If _00E_DisableCraftingTutorials.GetValueInt() == 0 && bStartTutorialShown == False - bStartTutorialShown = True - _00E_Playerhousing_StartTutorial.Show() - EndIf -EndFunction - -Function ShowExpansionBoardTutorial() - ; Called from _00E_Game_Playerhouse_BoardSC - If _00E_Playerhousing_ExpansionBoardTutorial.Show() == 1 - bHideTranslationTutorial = False - bHideTranslationTutorial_Gamepad = False - bHideManipulationTutorial = False - bHideManipulationTutorial_Gamepad = False - EndIf -EndFunction - -Bool Function _ShowPlacementModeTutorial(Message msgTutorial, Bool bHideFlag) - If bHideFlag == False - Return (msgTutorial.Show() == 1) - Else - Return bHideFlag - EndIf -EndFunction - -Function ShowTranslationModeTutorial() - If bGamepadMode - bHideTranslationTutorial_Gamepad = _ShowPlacementModeTutorial(_00E_Playerhousing_TranslationModeTutorial_Gamepad, bHideTranslationTutorial_Gamepad) - Else - bHideTranslationTutorial = _ShowPlacementModeTutorial(_00E_Playerhousing_TranslationModeTutorial, bHideTranslationTutorial) - EndIf -EndFunction - -Function ShowManipulationModeTutorial() - If bGamepadMode - bHideManipulationTutorial_Gamepad = _ShowPlacementModeTutorial(_00E_Playerhousing_ManipulationModeTutorial_Gamepad, bHideManipulationTutorial_Gamepad) - Else - bHideManipulationTutorial = _ShowPlacementModeTutorial(_00E_Playerhousing_ManipulationModeTutorial, bHideManipulationTutorial) - EndIf -EndFunction - - -;===================================================================================== -; SERVICE FUNCTIONS -;===================================================================================== - -Bool Function CanEnterPlacementMode() - Return (_00E_Meditate_Allowed.GetValue() != 0.0 && _00E_Phasmalist_TankMode.GetValue() == 0.0) -EndFunction - -Float fPlacementModeCarryWeightMod = 0.0 - -Function EnterPlacementMode() - If bIsInPlacementMode == False - bIsInPlacementMode = True - _00E_Meditate_Allowed.SetValueInt(0) - Game.SetInChargen(true, true, false) ; Forbid saving the game while placing stuff - - ; Make the player over encumbered to prevent them from the default running and in general to slow them down - fPlacementModeCarryWeightMod = Player.GetAV("CarryWeight") * 2.0 - If fPlacementModeCarryWeightMod < 1000.0 - fPlacementModeCarryWeightMod = 1000.0 - EndIf - Player.ModAV("CarryWeight", -fPlacementModeCarryWeightMod) - - bGamepadMode = Game.UsingGamepad() - If bGamepadMode == False - iPickupKey = Input.GetMappedKey(CONTROL_SHEATH, 0) - Else - iPickupKey = 277 - EndIf - EndIf -EndFunction - -Function ExitPlacementMode() - If bIsInPlacementMode - bIsInPlacementMode = False - If fPlacementModeCarryWeightMod != 0.0 - Player.ModAV("CarryWeight", fPlacementModeCarryWeightMod) - fPlacementModeCarryWeightMod = 0.0 - EndIf - Game.SetInChargen(false, true, false) ; Re-allow saving - _00E_Meditate_Allowed.SetValueInt(1) - EndIf - - currentHousingObject = None ; Prevent persistence -EndFunction - -Function PickUpHousingObject() - ; Clear currentHousingObject ASAP because of possible race conditions - _00E_Playerhousing_Furniture furnitureRef = (currentHousingObject as _00E_Playerhousing_Furniture) - currentHousingObject = None - - Form furnBaseObject = furnitureRef.GetBaseObject() - If (furnBaseObject as ActorBase) || (furnBaseObject as Container) - If furnitureRef.GetNumItems() > 0 - furnitureRef.RemoveAllItems(Player) - _00E_Playerhousing_ContainerContentMove.Show() - Else - ; Whatever... - furnitureRef.RemoveAllItems(Player) - EndIf - EndIf - Player.AddItem(furnitureRef.GetInventoryItem(), 1, False) - furnitureRef.Disable() - _00E_Phasmalist_Workbench worbenchRef = (furnitureRef as ObjectReference) as _00E_Phasmalist_Workbench - If worbenchRef - worbenchRef.OnPickUp() - EndIf - furnitureRef.Delete() -EndFunction - -Function FinishPlacingHousingObject() - ; Clear currentHousingObject ASAP because of possible race conditions - _00E_Playerhousing_Furniture furnitureRef = (currentHousingObject as _00E_Playerhousing_Furniture) - currentHousingObject = None - - Utility.Wait(0.05) ; Wait for the shaders to stop for sure - furnitureRef.finishPlacement() - PlaySwitchSound() -EndFunction - -Function PlaySwitchSound() - UIMenuActive.Play(player) -EndFunction - -Function RegisterNewHousingObjectOffsets(Float fNewOffsetAngleZ, Float fNewOffsetPositionZ) - fStoredOffsetAngleZ = fNewOffsetAngleZ - fStoredOffsetPositionZ = fNewOffsetPositionZ -EndFunction - -Function Update_209() - bStartTutorialShown = ((Self as Quest) as _00E_PlayerhousingTutorial).StartTutorialIsShown() -EndFunction - - -;===================================================================================== -; CONTROLS -;===================================================================================== - -Bool bLockActions = False -Bool bActiveActivate = False - -Function LockActions() - bLockActions = True - InterruptActivate() -EndFunction - -Function UnlockActions() - bLockActions = False - InterruptActivate() -EndFunction - -Function InterruptActivate() - If bActiveActivate - bActiveActivate = False - UnregisterForUpdate() - EndIf -EndFunction - -Function EnableBuildmodeControls() - RegisterForControl(CONTROL_ACTIVATE) - If bIsInPlacementMode && iPickupKey > 0 - RegisterForKey(iPickupKey) - EndIf - - UnlockActions() -EndFunction - -Function DisableBuildmodeControls() - LockActions() - - UnregisterForAllControls() - UnregisterForAllKeys() - UnregisterForUpdate() -EndFunction - -Event OnControlDown(String control) - If control == CONTROL_ACTIVATE - If bActiveActivate - bActiveActivate = False - bDisableNormalActivation = True - UnregisterForUpdate() - ElseIf bLockActions == False - bActiveActivate = True - bDisableNormalActivation = False - RegisterForSingleUpdate(1.1) - EndIf - EndIf -EndEvent - -Event OnControlUp(String control, Float holdTime) - If control == CONTROL_ACTIVATE - If bActiveActivate - bActiveActivate = False - UnregisterForUpdate() - If bLockActions == False - activateShortPressed() - EndIf - EndIf - EndIf -EndEvent - -Event OnUpdate() - If bActiveActivate - bActiveActivate = False - bDisableNormalActivation = True - If bLockActions == False - activateLongPressed() - EndIf - EndIf -EndEvent - -Event OnKeyDown(Int iKeyCode) - If iKeyCode == iPickupKey - If bLockActions == False - pickUpPressed() - EndIf - EndIf -EndEvent - - -;===================================================================================== -; DEFAULT STATE -;===================================================================================== - -Event OnBeginState() - ExitPlacementMode() -EndEvent - -Function playerItemDropped(_00E_Playerhousing_FurnitureItem akItemReference) - ; Called from _00E_Playerhousing_FurnitureItem on a placeable dropped from the inventory - Player.AddItem(akItemReference, 1, False) - _00E_Playerhousing_CannotPlaceObjectsHere.Show() -EndFunction - -Function activateShortPressed() - ; Process short activate press -EndFunction - -Function activateLongPressed() - ; Process long activate press -EndFunction - -Function pickUpPressed() - ; Process pick up key press -EndFunction - -Function enableBuildmode() - ; Enter the build mode when the player enters their house - ShowStartBuildModeTutorial() - GoToState("Buildmode") -EndFunction - -Function disableBuildmode() - ; Exit a build mode when the player leaves their house -EndFunction - -Bool Function IsNormalActivationEnabled() - ; The player can activate a placeable furniture normally - Return True -EndFunction - - -;===================================================================================== -; STATE Buildmode -;===================================================================================== - -STATE Buildmode - ; The player can enter the manipulation or translation mode by choosing a housing object or dropping a housing item - - Event OnBeginState() - ExitPlacementMode() - bDisableNormalActivation = True - EnableBuildmodeControls() - EndEvent - - Event OnEndState() - DisableBuildmodeControls() - EndEvent - - Function playerItemDropped(_00E_Playerhousing_FurnitureItem akItemReference) - If CanEnterPlacementMode() == False || bLockActions ; Locked by something else - Player.AddItem(akItemReference, 1, False) - Return - EndIf - LockActions() - - currentHousingObject = akItemReference.placeFurnitureAtMe() - If currentHousingObject == None - ; Some error happened - Player.AddItem(akItemReference, 1, False) - UnlockActions() - Return - EndIf - - DisableBuildmodeControls() - akItemReference.Disable() - currentHousingObject.InventoryItem = akItemReference.GetBaseObject() - akItemReference.Delete() - bDroppedFromInventory = True - GoToState("Translation") - EndFunction - - Function activateLongPressed() - LockActions() - - _00E_Playerhousing_Furniture targetRef = Game.GetCurrentCrosshairRef() as _00E_Playerhousing_Furniture - If targetRef && targetRef.IsFurnitureInUse() == False && Utility.IsInMenuMode() == False && CanEnterPlacementMode() - currentHousingObject = targetRef - GoToState("Translation") - Else - UnlockActions() - EndIf - EndFunction - - Function activateShortPressed() - ObjectReference targetRef = Game.GetCurrentCrosshairRef() - If (targetRef as _00E_Playerhousing_Furniture) && (bLockActions == False) - If (targetRef as _00E_Playerhousing_FurnitureItem) - ; Activate() would mean "Take" for this misc. object, so do nothing - ElseIf (targetRef as _00E_Theriantrophist_BlockCraftingSC) || (targetRef as _00E_Playerhousing_MannequinControl) || (targetRef as _00E_BedScript) || (targetRef as _00E_Phasmalist_Workbench) || (targetRef as _00E_PlaceableGrammophonPlay) - ; These objects do activation themselves in OnActivate event - Else - targetRef.Activate(player, true) - EndIf - EndIf - EndFunction - - Function enableBuildmode() - ; Do nothing - EndFunction - - Function disableBuildmode() - GoToState("") - EndFunction - - Bool Function IsNormalActivationEnabled() - Return ((bDisableNormalActivation == False) && (bLockActions == False)) - EndFunction - -ENDSTATE - - -;===================================================================================== -; STATE Translation -;===================================================================================== - -STATE Translation - ; The selected housing object is moved with the player - - Event OnBeginState() - Bool bEnteringPlacement = (bIsInPlacementMode == False) - - Game.DisablePlayerControls(abMovement = false, abFighting = true, abCamSwitch = false, abLooking = false, abSneaking = false, abMenu = true, abActivate = true) - EnterPlacementMode() - - If bEnteringPlacement && bDroppedFromInventory == False - ObjectReference housingObjRef = currentHousingObject as ObjectReference - If (housingObjRef as _00E_PlaceableGrammophonPlay) - (housingObjRef as _00E_PlaceableGrammophonPlay).StopMusic() - EndIf - EndIf - - If bDroppedFromInventory == False - PlaySwitchSound() - Else - bDroppedFromInventory = False - EndIf - - _00E_Playerhousing_TranslationMode.Show() - - (currentHousingObjectInTranslation as _00E_PlayerhousingCurrentOTranslation).Setup(currentHousingObject, bEnteringPlacement, fStoredOffsetAngleZ, fStoredOffsetPositionZ) - - ShowTranslationModeTutorial() - - EnableBuildmodeControls() - EndEvent - - Event OnEndState() - Game.EnablePlayerControls(abMovement = true, abFighting = true, abCamSwitch = true, abLooking = true, abSneaking = true, abMenu = true, abActivate = true) - EndEvent - - Function activateShortPressed() - DisableBuildmodeControls() - (currentHousingObjectInTranslation as _00E_PlayerhousingCurrentOTranslation).Shutdown() - GoToState("Manipulation") - EndFunction - - Function activateLongPressed() - DisableBuildmodeControls() - (currentHousingObjectInTranslation as _00E_PlayerhousingCurrentOTranslation).Shutdown() - FinishPlacingHousingObject() - GoToState("Buildmode") - EndFunction - - Function pickUpPressed() - DisableBuildmodeControls() - (currentHousingObjectInTranslation as _00E_PlayerhousingCurrentOTranslation).Shutdown() - PickUpHousingObject() - GoToState("Buildmode") - EndFunction - - Function enableBuildmode() - ; Do nothing - EndFunction - - Function disableBuildmode() - DisableBuildmodeControls() - (currentHousingObjectInTranslation as _00E_PlayerhousingCurrentOTranslation).Shutdown() - If currentHousingObject - PickUpHousingObject() - EndIf - GoToState("") - EndFunction - - Bool Function IsNormalActivationEnabled() - Return False - EndFunction - -ENDSTATE - - -;===================================================================================== -; STATE Manipulation -;===================================================================================== - -STATE Manipulation - ; The player can change orientation or altitude of the selected housing object by using the keys - - Event OnBeginState() - Game.DisablePlayerControls(abMovement = false, abFighting = true, abCamSwitch = false, abLooking = false, abSneaking = false, abMenu = true, abActivate = true) - Game.SetPlayerAIDriven(True) - - PlaySwitchSound() - - _00E_Playerhousing_ManipulationMode.Show() - - (currentHousingObjectInManipulation as _00E_PlayerhousingCurrentOManipulate).Setup(currentHousingObject) - - ShowManipulationModeTutorial() - - EnableBuildmodeControls() - EndEvent - - Event OnEndState() - Game.SetPlayerAIDriven(False) - Game.EnablePlayerControls(abMovement = true, abFighting = true, abCamSwitch = true, abLooking = true, abSneaking = true, abMenu = true, abActivate = true) - EndEvent - - Function activateShortPressed() - DisableBuildmodeControls() - (currentHousingObjectInManipulation as _00E_PlayerhousingCurrentOManipulate).Shutdown(True) - GoToState("Translation") - EndFunction - - Function activateLongPressed() - DisableBuildmodeControls() - (currentHousingObjectInManipulation as _00E_PlayerhousingCurrentOManipulate).Shutdown(False) - FinishPlacingHousingObject() - GoToState("Buildmode") - EndFunction - - Function pickUpPressed() - DisableBuildmodeControls() - (currentHousingObjectInManipulation as _00E_PlayerhousingCurrentOManipulate).Shutdown(False) - PickUpHousingObject() - GoToState("Buildmode") - EndFunction - - Function enableBuildmode() - ; Do nothing - EndFunction - - Function disableBuildmode() - DisableBuildmodeControls() - (currentHousingObjectInManipulation as _00E_PlayerhousingCurrentOManipulate).Shutdown(False) - If currentHousingObject - PickUpHousingObject() - EndIf - GoToState("") - EndFunction - - Bool Function IsNormalActivationEnabled() - Return False - EndFunction - -ENDSTATE diff --git a/scripts/source/_00e_playerhousingtutorial.psc b/scripts/source/_00e_playerhousingtutorial.psc deleted file mode 100644 index 308e38f8..00000000 --- a/scripts/source/_00e_playerhousingtutorial.psc +++ /dev/null @@ -1,14 +0,0 @@ -Scriptname _00E_PlayerhousingTutorial extends Quest -{ OBSOLETE. Left for version update. } - -Bool Function StartTutorialIsShown() - Return False -EndFunction - -STATE NoTutorial - - Bool Function StartTutorialIsShown() - Return True - EndFunction - -Endstate diff --git a/scripts/source/_00e_playersetupscript.psc b/scripts/source/_00e_playersetupscript.psc deleted file mode 100644 index 65452046..00000000 --- a/scripts/source/_00e_playersetupscript.psc +++ /dev/null @@ -1,663 +0,0 @@ -Scriptname _00E_PlayerSetUpScript extends ObjectReference -{Initializes all the necessary Quests, maintains the player, contains various OnPlayerLoadGame() failsafes} - -Float Property CURRENT_PATCH_VERSION = 2.09 AutoReadOnly - - -;===================================================================================== -; EVENTS -;===================================================================================== - -Event OnInit() - - ; needs the IsInMenuMode() check to prevent stuck messages when FS is not loaded - While Utility.IsInMenuMode() - Utility.WaitMenuMode(0.1) - EndWhile - - CheckIfForgottenStoriesIsLoaded() - - If self == (PlayerREF as ObjectReference) - - If fPatchVersion == 0.00 - fPatchVersion = CURRENT_PATCH_VERSION - EndIf - - GoToState("RealPlayer") - PlayerREF.SetActorValue("speedMult", 95) - PlayerREF.SetActorValue("Healrate", 0) - - SetAmountAutosaves() - - EnableDisableKillmove() - - AddPerks() - - DisableRegularWaiting() - StartQuests(QuestsToStart) - - EndIf - -EndEvent - -Event OnPlayerLoadGame() - If self == (PlayerREF as ObjectReference) ; A check just in case. Most likely this condition is always True - CheckIfForgottenStoriesIsLoaded() - Maintenance() - If GetState() != "RealPlayer" ; Post-1.2.5.0 version update - GoToState("RealPlayer") - EndIf - EndIf -EndEvent - -State RealPlayer - - ;/ Event OnBeginState() - Debug.Trace(self + ": OnBeginState RealPlayer") - EndEvent /; - -EndState - - -;===================================================================================== -; FUNCTIONS -;===================================================================================== - -Function CheckIfForgottenStoriesIsLoaded() - - ; function that quits back to the main menu when the Enderal - Forgotten Stories.esm is not not being added to the plugins.txt - ; and hence not being loaded in-game. Unknown reason, probably write protection issues - - If Game.GetModByName("Enderal - Forgotten Stories.esm") == 255 - bFSWasNotLoadedBefore = true - _00E_Game_ForgottenStoriesNotLoaded.Show() - Game.QuitToMainMenu() - Else - If bFSWasNotLoadedBefore == true - AddPerks() - If FSQuestsToStartFailsafePatch1560 == None - FSQuestsToStartFailsafePatch1560 = Game.GetFormFromFile(0x0102F4B0, "Enderal - Forgotten Stories.esm") as FormList - EndIf - StartQuests(FSQuestsToStartFailsafePatch1560) - bFSWasNotLoadedBefore = false - EndIf - EndIf - -EndFunction - -;===================================================================================== -; 1.5.6.0 -;===================================================================================== - -Function ResetFSNQR05Temple() - - ; resets the cells which is needed due to the fixes on enemies and ambushes in patch 1.5.6.0 - Quest FS_NQR05 = Game.GetFormFromFile(0x000438D2,"Skyrim.esm") as Quest - Cell FS_NQR05_Temple_02_New = Game.GetFormFromFile(0x00045101,"Skyrim.esm") as Cell - If FS_NQR05.GetStage() < 165 - FS_NQR05_Temple_02_New.Reset() - EndIf - -EndFunction - -;===================================================================================== -; 1.5.7.0 -;===================================================================================== - -Function CleanMQ12bGhostFlags() - - ; cleans old ghost flags on certain NPCs after the siege when patch 1.5.7.0 is applied - ; only needed once, since it won't happen anymore for everyone with a save before the siege - _00E_MQ12b_Functions MQ12bFunctions = Game.GetFormFromFile(0x0002EBAD,"Skyrim.esm") as _00E_MQ12b_Functions - MQ12bFunctions.OldRemoveGhostFlag() - -EndFunction - -;===================================================================================== -; 1.5.8.0 -;===================================================================================== - -Function ResetAuroraOnLoad() - ; resets Aurora if she was stuck during the ritual scene due to the gamehour change while she was in the smoking animation - _00E_FS_NQ07_Functions FS_NQ07Functions = Game.GetFormFromFile(0x0101CA09,"Enderal - Forgotten Stories.esm") as _00E_FS_NQ07_Functions - FS_NQ07Functions.ResetAurora() -EndFunction - -Function DisableMQ12bPanicTriggerbox() - ; disables MQ12b_SC3_PanicTriggerboxREF when patch 1.5.8.0 is applied - _00E_MQ12b_Functions MQ12bFunctions = Game.GetFormFromFile(0x0002EBAD,"Skyrim.esm") as _00E_MQ12b_Functions - If MQ12bFunctions.IsCompleted() - MQ12bFunctions.DisablePanicTriggerbox() - EndIf -EndFunction - -Function ReAddDarkKeeperAffinity() - - ; Dark Keeper Affinity Update - Spell _00E_Affinity_AbDarkKeeper = Game.GetFormFromFile(0x00143340,"Skyrim.esm") as Spell - If PlayerREF.HasSpell(_00E_Affinity_AbDarkKeeper) - PlayerREF.RemoveSpell(_00E_Affinity_AbDarkKeeper) - Utility.Wait(1) - PlayerREF.AddSpell(_00E_Affinity_AbDarkKeeper, false) - EndIf - -EndFunction - -Function ReAddFuryDrivenPerk() - - ; Fury Driven ability update - Spell abFuryDriven = Game.GetFormFromFile(0x000855CE, "Skyrim.esm") as Spell - If PlayerREF.HasSpell(abFuryDriven) - PlayerREF.RemoveSpell(abFuryDriven) - Utility.Wait(1) - PlayerREF.AddSpell(abFuryDriven, False) - EndIf - -EndFunction - -Function UpdateLivingTempleTrigger() - - ; Living Temple's ambush trigger update - ObjectReference triggerRef = Game.GetFormFromFile(0x000C6766, "Skyrim.esm") as ObjectReference - (triggerRef as defaultActivateSelf).playerAndAlliesOnly = True - -EndFunction - -Function UpdateMQ11a() - - ; MQ11a update - ObjectReference portcullisRef = Game.GetFormFromFile(0x000E1D1F, "Skyrim.esm") as ObjectReference - Quest MQ11a = Game.GetFormFromFile(0x0002EBA9, "Skyrim.esm") as Quest - If (MQ11a.GetStage() <= 125) && (portcullisRef.Is3DLoaded() == False) - (portcullisRef as _00E_DUNGate01Script).isOpen = False - EndIf - - If MQ11a.IsRunning() && (MQ11a.IsCompleted() == False) - (MQ11a as _00E_MQ11a_Functions).UpdateCaliaAliasScriptState() - EndIf - - ObjectReference NQ34_EnableMarkerREF = Game.GetFormFromFile(0x000480E8, "Skyrim.esm") as ObjectReference - If MQ11a.GetStage() >= 45 - NQ34_EnableMarkerREF.Enable() - EndIf - - Actor NQ34_WildMageREF = Game.GetFormFromFile(0x00141F00, "Skyrim.esm") as Actor - Quest NQ34 = Game.GetFormFromFile(0x00020A12, "Skyrim.esm") as Quest - If NQ34.GetStage() == 15 || NQ34.GetStage() == 20 - NQ34_WildMageREF.Enable() - EndIf - - If NQ34_WildMageREF.IsDead() && NQ34.GetStage() == 15 - NQ34.SetStage(20) - EndIf - -EndFunction - -Function AddPerks() - - ; adds the new Balancing perks for alchemy potions to the player, this is needed because of the changes with the Lycantroph - PlayerREF.AddPerk(_00E_FS_Alchemy_BalancingPerk) - PlayerREF.AddPerk(_00E_FS_Alchemy_BalancingPerk_RestorePotions) - -EndFunction - -Function DisableRegularWaiting() -{Disables regular waiting by adding the no-wait ability} - - PlayerREF.AddSpell(_00E_AbBlockWaiting, False) - -EndFunction - -Function StartQuests(Formlist QuestList) - - ; starts all quests that are in the formlist - Int iIndex = QuestList.GetSize() - While iIndex - iIndex -= 1 - Quest kQuest = QuestList.GetAt(iIndex) as Quest - kQuest.Start() - endwhile - -EndFunction - -;===================================================================================== -; 1.6.0.0 -;===================================================================================== - -Function UpdatePhasmalistContainer() - - ObjectReference Phasmalist_ApparationInventory_Bandit_Tier4 = Game.GetFormFromFile(0x0101E99B, "Enderal - Forgotten Stories.esm") as ObjectReference - ObjectReference Phasmalist_ApparationInventory_Archer_Tier5 = Game.GetFormFromFile(0x0101E9CA, "Enderal - Forgotten Stories.esm") as ObjectReference - Armor _00E_Phasmalist_Trinket_Bandit_Tier4 = Game.GetFormFromFile(0x0101E9A6, "Enderal - Forgotten Stories.esm") as Armor - Armor _00E_Phasmalist_Trinket_Archer_Tier5 = Game.GetFormFromFile(0x0101E9D4, "Enderal - Forgotten Stories.esm") as Armor - - _00E_Phasmalist_ApparationSC _36E_Phasmalist_Apparation_Hybrid_Tier4 = Game.GetFormFromFile(0x01025309, "Enderal - Forgotten Stories.esm") as _00E_Phasmalist_ApparationSC - _36E_Phasmalist_Apparation_Hybrid_Tier4.inventoryContainer = Phasmalist_ApparationInventory_Bandit_Tier4 - - If (PlayerREF.GetItemCount(_00E_Phasmalist_Trinket_Bandit_Tier4) > 0 && PlayerREF.GetItemCount(_00E_Phasmalist_Trinket_Archer_Tier5) == 0) - Phasmalist_ApparationInventory_Archer_Tier5.RemoveAllItems(Phasmalist_ApparationInventory_Bandit_Tier4, false, true) - EndIf - -EndFunction - -Function UpdatePassengerBookAtShipwreck() - - _00E_FS_NQ02_Functions FS_NQ02_Functions = (Game.GetFormFromFile(0x000438AC, "Skyrim.esm") as Quest) as _00E_FS_NQ02_Functions - FS_NQ02_Functions.UpdatePassengerBook() - -EndFunction - -Function ResetMQ02Riddle() - - GlobalVariable _00E_MQ02Riddle = Game.GetFormFromFile(0x00074B07, "Skyrim.esm") as GlobalVariable - - If _00E_MQ02Riddle.GetValueInt() > 0 - _00E_MQ02_Functions MQ02Functions = Game.GetFormFromFile(0x0002EBA1, "Skyrim.esm") as _00E_MQ02_Functions - MQ02Functions.ResetRiddle() - EndIf - -EndFunction - - -;===================================================================================== -; 1.6.1.0 -;===================================================================================== - - -Function UpdateMQ02() - _00E_MQ02_Functions MQ02Functions = Game.GetFormFromFile(0x0002EBA1, "Skyrim.esm") as _00E_MQ02_Functions - Int mq02stage = MQ02Functions.GetStage() - If mq02stage >= 138 && mq02stage < 170 - MQ02Functions.MQ02_TripToArkEnableMarker.EnableNoWait() - EndIf -EndFunction - - -;===================================================================================== -; 1.6.2.0 -;===================================================================================== - - -Function UpdateItemHandler() - - Cell ClassMenue = Game.GetFormFromFile(0x000A7FBC, "Skyrim.esm") as Cell - - If PlayerREF.GetParentCell() == ClassMenue - Quest ClassMenuItemHandler = Game.GetFormFromFile(0x00048442, "Skyrim.esm") as Quest - ReferenceAlias Player = ClassMenuItemHandler.GetAliasByName("Player") as ReferenceAlias - Player.ForceRefTo(PlayerREF) - EndIf - -EndFunction - - -;===================================================================================== -; 2.0.6 -;===================================================================================== - -Function UpdateMQ12b_206() - _00E_MQ12b_Functions MQ12bFunctions = Game.GetFormFromFile(0x0002EBAD, "Skyrim.esm") as _00E_MQ12b_Functions - Quest MQ15 = Game.GetFormFromFile(0x0002EBB0, "Skyrim.esm") as Quest - If MQ12bFunctions.GetStage() >= 135 && MQ15.GetStage() < 5 - MQ12bFunctions.OldReenableDisabledNPC() - EndIf -EndFunction - - -;===================================================================================== -; 2.0.8 -;===================================================================================== - -Function Update_208() - ; Obsolete abilities cleanup - _00E_FS_NQ07_Functions FS_NQ07_Quest = Game.GetFormFromFile(0x0001CA09, "Enderal - Forgotten Stories.esm") as _00E_FS_NQ07_Functions - Int iFS_NQ07Stage = FS_NQ07_Quest.GetStage() - If iFS_NQ07Stage >= 5 && iFS_NQ07Stage < 410 - FS_NQ07_Quest.UpdateAarosCarryTraySpell() - Else - RemoveObsoleteSpell(0x0009A893, "Skyrim.esm", 0x000F649A, "Skyrim.esm") - EndIf - - RemoveObsoleteSpell(0x0010D339, "Skyrim.esm", 0x000F649A, "Skyrim.esm") - RemoveObsoleteSpell(0x0006FFAF, "Skyrim.esm", 0x000F6498, "Skyrim.esm") - RemoveObsoleteSpell(0x000F64A0, "Skyrim.esm", 0x000F6498, "Skyrim.esm") - - ; Refill _00E_AnimTest_SC package arrays where needed - FillAnimTestPackages(0x00137889, "Skyrim.esm", 0x00070657, "Skyrim.esm") - FillAnimTestPackages(0x0013788A, "Skyrim.esm", 0x00070657, "Skyrim.esm") - FillAnimTestPackages(0x0013789F, "Skyrim.esm", 0x00070657, "Skyrim.esm") - FillAnimTestPackages(0x001378A2, "Skyrim.esm", 0x00070657, "Skyrim.esm") - FillAnimTestPackages(0x001378AA, "Skyrim.esm", 0x00070657, "Skyrim.esm") - FillAnimTestPackages(0x001378AB, "Skyrim.esm", 0x00070657, "Skyrim.esm") - FillAnimTestPackages(0x00147E12, "Skyrim.esm", 0x00070657, "Skyrim.esm") - FillAnimTestPackages(0x00147E14, "Skyrim.esm", 0x00070657, "Skyrim.esm") - - FillAnimTestPackages(0x0010D336, "Skyrim.esm", 0x00070645, "Skyrim.esm") - FillAnimTestPackages(0x0010D33B, "Skyrim.esm", 0x00070645, "Skyrim.esm") - FillAnimTestPackages(0x00147DEA, "Skyrim.esm", 0x00070645, "Skyrim.esm") - FillAnimTestPackages(0x00147E37, "Skyrim.esm", 0x00070645, "Skyrim.esm") - - ; "Gypsy minstrels" update - Keyword performSpotKwd = Game.GetFormFromFile(0x000FB905, "Skyrim.esm") as Keyword - (Game.GetFormFromFile(0x00044EBC, "Skyrim.esm") as _00E_BardPlayInstrumentScript).LinkedPlayMarkerKeyword = performSpotKwd - - (Game.GetFormFromFile(0x00046D79, "Skyrim.esm") as _00E_GypsyMinstrelsControlScript).UpdateWaypoint() -EndFunction - -Function RemoveObsoleteSpell(Int idNPC, String esmNPC, Int idSpell, String esmSpell) - Spell obsoleteSpell = Game.GetFormFromFile(idSpell, esmSpell) as Spell - (Game.GetFormFromFile(idNPC, esmNPC) as Actor).RemoveSpell(obsoleteSpell) -EndFunction - -Function FillAnimTestPackages(Int idNPC, String esmNPC, Int idPackage, String esmPackage) - Package newPackage = Game.GetFormFromFile(idPackage, esmPackage) as Package - (Game.GetFormFromFile(idNPC, esmNPC) as _00E_AnimTest_SC).UpdateFillPackages(newPackage) -EndFunction - - -;===================================================================================== -; 2.0.9 -;===================================================================================== - -Function Update_209() - Spell abSoulcaller = Game.GetFormFromFile(0x002F0EA, "Enderal - Forgotten Stories.esm") as Spell - If PlayerREF.HasSpell(abSoulcaller) - PlayerREF.RemoveSpell(abSoulcaller) - Utility.Wait(1) - PlayerREF.AddSpell(abSoulcaller, False) - EndIf - - Perk perkBloodlust = Game.GetFormFromFile(0x00069D38, "Skyrim.esm") as Perk - _ResetPerk(perkBloodlust) - - _00E_PlayerhousingMaster.GetMaster().Update_209() -EndFunction - - -;===================================================================================== -; ALL UPDATES -;===================================================================================== - -Function EnableDisableKillmove() - - ; it seems like that this ini setting does not do stuff by itself (or it is bugged) - ; therefore we need to read it from the file and change the global with which the killmoves are conditioned - If (Utility.GetINIBool("bVATSDisable:VATS") == 1) - KillMove.SetValueInt(0) - ElseIf (Utility.GetINIBool("bVATSDisable:VATS") == 0) - KillMove.SetValueInt(1) - EndIf - -EndFunction - -Function SetAmountAutosaves() - - ; increases amount of autosaves created from 3 to 5 without editing the ini files - ; new default ini files already have set the int to 5 - If Utility.GetINIInt("iAutoSaveCount:SaveGame") == 3 - Utility.SetINIInt("iAutoSaveCount:SaveGame", 5) - EndIf - -EndFunction - -Function SetAutoSaveInterval() - - ; updates the autosave interval - _00E_AutoSaveSystem_Functions AutoSaveSystem_Functions = Game.GetFormFromFile(0x00048141, "Skyrim.esm") as _00E_AutoSaveSystem_Functions - AutoSaveSystem_Functions.UpdateAutoSaveInterval() - -EndFunction - -Function FailsafeMQ05PrologueAliases() - - ; failsafe for issue 1536, fills empty aliases - If MQ05PrologueFunctions == None - MQ05PrologueFunctions = Game.GetFormFromFile(0x00033A5B, "Skyrim.esm") as _00E_MQ05Prologue_Functions - EndIf - MQ05PrologueFunctions.FillEmptyAliasesFailsafe() - -EndFunction - -Function RefreshMountNamesOnLoad() - - _00E_NQ06_Functions NQ06Functions = Game.GetFormFromFile(0x000725BA,"Skyrim.esm") as _00E_NQ06_Functions - NQ06Functions.RefreshNamesOnSaveLoad() - -EndFunction - -Function _ResetPerk(Perk p) - If PlayerREF.HasPerk(p) - PlayerREF.RemovePerk(p) - PlayerREF.AddPerk(p) - EndIf -EndFunction - -Function ResetArmorWeightPerks() - - ; Perks modifying armor weights need some push on each game load to work. - ; The push is needed only if the player is over-encumbered on game load. - ; If the player is not over-encumbered, the push is not needed because checking the inventory, picking up items, sheathing/drawing a weapon will reset the perks anyway. - If PlayerREF.IsOverEncumbered() - _ResetPerk(_00E_Class_Keeper_P05_C_Conditioning) - _ResetPerk(_00E_Class_Vagrant_P05_B_Lightweight) - EndIf - -EndFunction - -Function FixMoreAffinitiesMod() -{Fixes "More Affinites" mod missing properties in the Levelsystem scripts} - - _00E_QuestFunctions QuestFunctionsScript = (Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest) as _00E_QuestFunctions - If QuestFunctionsScript._00E_RemoveAllItems_TrashContainer == NONE - - Debug.Messagebox("Found broken scripts caused by mod >>More Affinities<<. Press OK to fix scripts.") - _00E_ConfigMenu ConfigMenuScript = (Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest) as _00E_ConfigMenu - ConfigMenuScript.controlQuest = (Game.GetFormFromFile(0x0101EC71, "Enderal - Forgotten Stories.esm") as Quest) as _FS_Phasmalist_ControlQuest - ConfigMenuScript._00E_ConfigMenu_DisableCraftingTutorials = Game.GetFormFromFile(0x00046D8E, "Skyrim.esm") as Message - ConfigMenuScript._00E_ConfigMenu_DisableMenuTutorials = Game.GetFormFromFile(0x00046D8A, "Skyrim.esm") as Message - ConfigMenuScript._00E_ConfigMenu_DisableOtherTutorials = Game.GetFormFromFile(0x00046D8F, "Skyrim.esm") as Message - ConfigMenuScript._00E_ConfigMenu_DisableQuestTutorials = Game.GetFormFromFile(0x00046D8C, "Skyrim.esm") as Message - ConfigMenuScript._00E_ConfigMenu_DisableReadAloudBooks = Game.GetFormFromFile(0x0102E982, "Enderal - Forgotten Stories.esm") as Message - ConfigMenuScript._00E_ConfigMenu_DisableSkillTutorials = Game.GetFormFromFile(0x00046D8D, "Skyrim.esm") as Message - ConfigMenuScript._00E_ConfigMenu_GameplayOptions = Game.GetFormFromFile(0x0102F1BC, "Enderal - Forgotten Stories.esm") as Message - ConfigMenuScript._00E_ConfigMenu_Meditate = Game.GetFormFromFile(0x00046D98, "Skyrim.esm") as Message - ConfigMenuScript._00E_ConfigMenu_OtherOptions = Game.GetFormFromFile(0x00046D89, "Skyrim.esm") as Message - ConfigMenuScript._00E_ConfigMenu_VideoSkip = Game.GetFormFromFile(0x0102E983, "Enderal - Forgotten Stories.esm") as Message - ConfigMenuScript._00E_DisableCraftingTutorials = Game.GetFormFromFile(0x00046D90, "Skyrim.esm") as GlobalVariable - ConfigMenuScript._00E_DisableMenuTutorials = Game.GetFormFromFile(0x00046D8B, "Skyrim.esm") as GlobalVariable - ConfigMenuScript._00E_DisableOtherTutorials = Game.GetFormFromFile(0x00046D93, "Skyrim.esm") as GlobalVariable - ConfigMenuScript._00E_DisableQuestTutorials = Game.GetFormFromFile(0x00046D92, "Skyrim.esm") as GlobalVariable - ConfigMenuScript._00E_DisableReadAloudBooks = Game.GetFormFromFile(0x0102E984, "Enderal - Forgotten Stories.esm") as GlobalVariable - ConfigMenuScript._00E_DisableSkillTutorials = Game.GetFormFromFile(0x00046D91, "Skyrim.esm") as GlobalVariable - ConfigMenuScript._00E_FS_ConfigMenu_Mount_Teleport = Game.GetFormFromFile(0x0102F1B9, "Enderal - Forgotten Stories.esm") as Message - ConfigMenuScript._00E_FS_ConfigMenu_Phasmalist_Teleport = Game.GetFormFromFile(0x0101F2B6, "Enderal - Forgotten Stories.esm") as Message - ConfigMenuScript._00E_FS_IsForgottenStoriesActivated = Game.GetFormFromFile(0x0004320E, "Skyrim.esm") as GlobalVariable - ConfigMenuScript._00E_HorseFlute_New = ((Game.GetFormFromFile(0x000725BA, "Skyrim.esm") as Quest).GetAliasByName("HorseFlute")) as _00E_Horseflute_SC - ConfigMenuScript._00E_VideoSkip = Game.GetFormFromFile(0x0102E985, "Enderal - Forgotten Stories.esm") as GlobalVariable - - - QuestFunctionsScript.BastionPerks = Game.GetFormFromFile(0x0006686B, "Skyrim.esm") as Formlist - QuestFunctionsScript.DerwishPerks = Game.GetFormFromFile(0x0006686D, "Skyrim.esm") as Formlist - QuestFunctionsScript.ElementalismPerks = Game.GetFormFromFile(0x00066875, "Skyrim.esm") as Formlist - QuestFunctionsScript.EspionagePerks = Game.GetFormFromFile(0x00066889, "Skyrim.esm") as Formlist - QuestFunctionsScript.GameHour = Game.GetFormFromFile(0x00000038, "Skyrim.esm") as GlobalVariable - QuestFunctionsScript.Gold001 = Game.GetFormFromFile(0x0000000f, "Skyrim.esm") as MiscObject - QuestFunctionsScript.LifeAndDeathPerks = Game.GetFormFromFile(0x00066873, "Skyrim.esm") as Formlist - QuestFunctionsScript.MAGIllusionCharm = Game.GetFormFromFile(0x00075805, "Skyrim.esm") as Sound - QuestFunctionsScript.ManipulationPerks = Game.GetFormFromFile(0x0006686A, "Skyrim.esm") as Formlist - QuestFunctionsScript.PlayerSkillMenu = ((Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest).GetAliasByName("Player") as Alias) as _00E_Game_SkillmenuSC - QuestFunctionsScript.RagePerks = Game.GetFormFromFile(0x00066887, "Skyrim.esm") as Formlist - QuestFunctionsScript.SympathyEsme = Game.GetFormFromFile(0x0102A498, "Enderal - Forgotten Stories.esm") as GlobalVariable - QuestFunctionsScript.TrickeryPerks = Game.GetFormFromFile(0x0006687F, "Skyrim.esm") as Formlist - QuestFunctionsScript.VagabondPerks = Game.GetFormFromFile(0x00066877, "Skyrim.esm") as Formlist - QuestFunctionsScript._00E_AchievementsEnabled = Game.GetFormFromFile(0x00046F83, "Skyrim.esm") as GlobalVariable - QuestFunctionsScript._00E_AllAmmos = Game.GetFormFromFile(0x000456C0, "Skyrim.esm") as Formlist - QuestFunctionsScript._00E_ArmorSetScript_sSetBonusRemoved = Game.GetFormFromFile(0x00036F96, "Skyrim.esm") as Message - QuestFunctionsScript._00E_DisableQuestTutorials = Game.GetFormFromFile(0x00046D92, "Skyrim.esm") as GlobalVariable - QuestFunctionsScript._00E_DisableSkillTutorials = Game.GetFormFromFile(0x00046D91, "Skyrim.esm") as GlobalVariable - QuestFunctionsScript._00E_FS_A3_AlreadyKnowThisLevel = Game.GetFormFromFile(0x0102F533, "Enderal - Forgotten Stories.esm") as Message - QuestFunctionsScript._00E_FS_A3_NeedToLearnOtherLevels = Game.GetFormFromFile(0x0101EC7D, "Enderal - Forgotten Stories.esm") as Message - QuestFunctionsScript._00E_FS_A3_sIn = Game.GetFormFromFile(0x00043BE0, "Skyrim.esm") as Message - QuestFunctionsScript._00E_FS_A3_sMageClassName = Game.GetFormFromFile(0x00043BE4, "Skyrim.esm") as Message - QuestFunctionsScript._00E_FS_A3_sRogueClassName = Game.GetFormFromFile(0x00043BE3, "Skyrim.esm") as Message - QuestFunctionsScript._00E_FS_A3_sToUnlockThisClass = Game.GetFormFromFile(0x00043BE1, "Skyrim.esm") as Message - QuestFunctionsScript._00E_FS_A3_sWarriorClassName = Game.GetFormFromFile(0x00043BE2, "Skyrim.esm") as Message - QuestFunctionsScript._00E_FS_A3_sYouNeedSkillpoints = Game.GetFormFromFile(0x00043BDF, "Skyrim.esm") as Message - QuestFunctionsScript._00E_FS_NQ02_Esme = Game.GetFormFromFile(0x0101F0D0, "Enderal - Forgotten Stories.esm") as ActorBase - QuestFunctionsScript._00E_FS_NQR05_SlowMotionSP = Game.GetFormFromFile(0x0102E2BD, "Enderal - Forgotten Stories.esm") as Spell - QuestFunctionsScript._00E_FS_NQR05_SlowMotion_IntroM = Game.GetFormFromFile(0x0102E2BF, "Enderal - Forgotten Stories.esm") as Sound - QuestFunctionsScript._00E_FS_NQR05_SlowMotion_OutroM = Game.GetFormFromFile(0x0102E2C1, "Enderal - Forgotten Stories.esm") as Sound - QuestFunctionsScript._00E_Levelsystem_sAbilityStanceQyrai = Game.GetFormFromFile(0x00046D9B, "Skyrim.esm") as Message - QuestFunctionsScript._00E_Levelsystem_sAbilityStanceSkaragg = Game.GetFormFromFile(0x00046D9C, "Skyrim.esm") as Message - QuestFunctionsScript._00E_PleaseRemoveMoney = Game.GetFormFromFile(0x000480DA, "Skyrim.esm") as Message - QuestFunctionsScript._00E_RemoveAllItems_TrashContainer = Game.GetFormFromFile(0x000469E7, "Skyrim.esm") as ObjectReference - QuestFunctionsScript._00E_SkillbookWarning = Game.GetFormFromFile(0x00031ACF, "Skyrim.esm") as Message - - - _00E_Game_SkillmenuSC SkillMenuScript = ((Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest).GetAliasByName("Player") as Alias) as _00E_Game_SkillmenuSC - SkillMenuScript._00E_FS_Game_Affinity_Spectralist = Game.GetFormFromFile(0x01029A35, "Skyrim.esm") as Message - - - _00E_PlayerHousing_CellNameSC CellNameScript = ((Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest).GetAliasByName("Player") as Alias) as _00E_PlayerHousing_CellNameSC - CellNameScript.FS_NQR03 = Game.GetFormFromFile(0x0014CEA2, "Skyrim.esm") as Quest - CellNameScript.FS_NQR03_RhalataTemple = Game.GetFormFromFile(0x0010D1C2, "Skyrim.esm") as Cell - CellNameScript._00E_sPlayerHouseMarketQuarterName = Game.GetFormFromFile(0x00047CA5, "Skyrim.esm") as Message - CellNameScript._00E_sPlayerHouseNobleQuarterName = Game.GetFormFromFile(0x00047CA6, "Skyrim.esm") as Message - CellNameScript._00E_sRhalataTempleName = Game.GetFormFromFile(0x00047C29, "Skyrim.esm") as Message - - - _00E_WeatherControlScriptSC WeatherControlScript = ((Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest).GetAliasByName("Player") as Alias) as _00E_WeatherControlScriptSC - WeatherControlScript.CapitalCityCastleWorld = Game.GetFormFromFile(0x00070729, "Skyrim.esm") as WorldSpace - WeatherControlScript.CapitalCityLocation = Game.GetFormFromFile(0x000A1A12, "Skyrim.esm") as Location - WeatherControlScript.MQ09 = Game.GetFormFromFile(0x0007FA91, "Skyrim.esm") as Quest - WeatherControlScript.MQ12b = Game.GetFormFromFile(0x0002EBAD, "Skyrim.esm") as Quest - WeatherControlScript.MQ17 = Game.GetFormFromFile(0x0007FA93, "Skyrim.esm") as Quest - WeatherControlScript.SkyrimOvercastRain = Game.GetFormFromFile(0x000C821F, "Skyrim.esm") as Weather - WeatherControlScript.Vyn = Game.GetFormFromFile(0x00001D3C, "Skyrim.esm") as WorldSpace - WeatherControlScript._00E_EnderalOvercast = Game.GetFormFromFile(0x00072785, "Skyrim.esm") as Weather - WeatherControlScript._00E_MQ11c_SilberhainDeadWeather = Game.GetFormFromFile(0x00096807, "Skyrim.esm") as GlobalVariable - WeatherControlScript._00E_SuntempleLocations = Game.GetFormFromFile(0x0003BB5B, "Skyrim.esm") as FormList - - Utility.Wait(1) - Debug.Messagebox("Scripts fixed. Make sure to save the game. Restart the client and reload the save that you just created.\n If you have set items equipped, unequip them all and re-equip them for potential set bonuses to apply.") - EndIf - -EndFunction - -;===================================================================================== -; MAINTENANCE -;===================================================================================== - -Function Maintenance() - - If fPatchVersion <= 1.25 && !bdoOnce - int iButton01 = _00E_Game_OldSaves_01.Show() - If iButton01 == 0 - Game.QuitToMainMenu() - ElseIf iButton01 == 1 - int iButton02 = _00E_Game_OldSaves_02.Show() - If iButton02 == 0 - Game.QuitToMainMenu() - ElseIf iButton02 == 1 - bdoOnce = true - EndIf - EndIf - ElseIf fPatchVersion >= 1.5 && fPatchVersion < CURRENT_PATCH_VERSION - - ; only do this once when update 1.5.6.0 is applied - If fPatchVersion < 1.56 - ResetFSNQR05Temple() - EndIf - ; only do this once when update 1.5.7.0 is applied - If fPatchVersion < 1.57 - CleanMQ12bGhostFlags() - EndIf - ; only do this once when update 1.5.8.0 is applied - If fPatchVersion < 1.58 - ResetAuroraOnLoad() - DisableMQ12bPanicTriggerbox() - ReAddDarkKeeperAffinity() - ReAddFuryDrivenPerk() - UpdateLivingTempleTrigger() - UpdateMQ11a() - EndIf - ; only do this once when update 1.6.0.0 is applied - If fPatchVersion < 1.60 - UpdatePhasmalistContainer() - UpdatePassengerBookAtShipwreck() - ResetMQ02Riddle() - EndIf - ; only do this once when update 1.6.1.0 is applied - If fPatchVersion < 1.61 - UpdateMQ02() - EndIf - ; only do this once when update 1.6.2.0 is applied - If fPatchVersion < 1.62 - UpdateItemHandler() - EndIf - ; only do this once when update 2.0.6 (SE) is applied - If fPatchVersion < 2.06 - UpdateMQ12b_206() - EndIf - ; only do this once when update 2.0.8 (SE) is applied - If fPatchVersion < 2.08 - Update_208() - EndIf - ; only do this once when update 2.0.9 (SE) is applied - If fPatchVersion < 2.09 - Update_209() - EndIf - fPatchVersion = CURRENT_PATCH_VERSION - EndIf - - ; changes to the actor value healrate will not persist in consecutive saves - ; every time a save gets loaded the healrate needs to be set to 0, otherwise it will go back again to default at 0.7 - ; this is called before active magic effects of potions or spells are applied to the player which could also alter the value - PlayerREF.SetActorValue("Healrate", 0) - - EnableDisableKillmove() - - ResetArmorWeightPerks() - - SetAmountAutosaves() - - SetAutoSaveInterval() - - FailsafeMQ05PrologueAliases() - - RefreshMountNamesOnLoad() - - ; fixes properties that were accidentally set to NONE by the "More Affinities" mod - If Game.GetModByName("Enderal_FS_More_Affinities.esp") != 255 - FixMoreAffinitiesMod() - EndIf - -EndFunction - -;===================================================================================== -; PROPERTIES -;===================================================================================== - -float fPatchVersion -bool bdoOnce = false -bool bFSWasNotLoadedBefore = false - -_00E_MQ05Prologue_Functions Property MQ05PrologueFunctions Auto - -Perk Property _00E_FS_Alchemy_BalancingPerk Auto -Perk Property _00E_FS_Alchemy_BalancingPerk_RestorePotions Auto - -Spell Property _00E_AbBlockWaiting Auto -Actor Property PlayerREF Auto - -FormList Property QuestsToStart Auto -FormList Property FSQuestsToStartFailsafePatch1560 Auto - -Message Property _00E_Game_OldSaves_01 Auto -Message Property _00E_Game_OldSaves_02 Auto -Message Property _00E_Game_ForgottenStoriesNotLoaded Auto - -GlobalVariable Property KillMove Auto - -Perk Property _00E_Class_Keeper_P05_C_Conditioning Auto -Perk Property _00E_Class_Vagrant_P05_B_Lightweight Auto diff --git a/scripts/source/_00e_questfunctions.psc b/scripts/source/_00e_questfunctions.psc deleted file mode 100644 index c3e906c3..00000000 --- a/scripts/source/_00e_questfunctions.psc +++ /dev/null @@ -1,1420 +0,0 @@ -Scriptname _00E_QuestFunctions extends Quest Conditional -{This script is meant to be attached to any quests and serves as a Function library. Simply import it to call Global functions, and create a script property to access non-global functions} - -Import math -Import Utility - -;===================================================================================== -; EXP -;===================================================================================== - -Function GiveEP(int ToGive) - - If (PlayerREF as _00E_EPUpdateFunctions).receiveEP(ToGive) - ; Player receives EP - EndIf - -EndFunction - -;===================================================================================== -; SYMPATHY -;===================================================================================== - -Function ModSympathyNG(Actor akSympathyActor, int iSympathyMod, bool bIsFlirt = False, bool bStringOverride = False, String sOverride = "") - - Levelsystem_SympathyActor.ForceRefTo(akSympathyActor) - - ActorBase sympathyBase = akSympathyActor.GetActorBase() - - If sympathyBase == _00E_MC_Jespar - SympathyJespar.Mod(iSympathyMod) - ElseIf sympathyBase == _00E_MC_Calia - SympathyCalia.Mod(iSympathyMod) - ElseIf sympathyBase == _00E_CapitalCityMaelGroschenfrst - SympathyMaelGroschenfuerst.Mod(iSympathyMod) - ElseIf sympathyBase == _00E_SC_Dijaam - SympathyDijaam.Mod(iSympathyMod) - ElseIf sympathyBase == _00E_SC_Tharael - SympathyTharael.Mod(iSympathyMod) - ElseIf sympathyBase == _00E_MQ11c_Ryneus - SympathyRyneus.Mod(iSympathyMod) - ElseIf sympathyBase == _00E_MC_Yuslan - SympathyYuslan.Mod(iSympathyMod) - ElseIf sympathyBase == _00E_FS_NQ02_Esme - SympathyEsme.Mod(iSympathyMod) - EndIf - - If bIsFlirt - If sympathyBase == _00E_MC_Jespar - JesparFlirtCounter.SetValueInt(JesparFlirtCounter.GetValueInt() + 1) - ElseIf sympathyBase == _00E_MC_Calia - CaliaFlirtCounter.SetValueInt(CaliaFlirtCounter.GetValueInt() + 1) - ElseIf sympathyBase == _00E_SC_Dijaam - DijaamFlirtCounter.SetValueInt(DijaamFlirtCounter.GetValueInt() + 1) - ElseIf sympathyBase == _00E_SC_Tharael - TharaelFlirtCounter.SetValueInt(TharaelFlirtCounter.GetValueInt() + 1) - EndIf - EndIf - - String sActorName = sympathyBase.GetName() - - If !bStringOverride - If (iSympathyMod > 0) && (iSympathyMod <= 5) - _00E_Levelsystem_sApproves.Show() - ; Debug.Notification(sActorName + sLevelsystemAppreciate + ".") - ElseIf (iSympathyMod > 5) && (iSympathyMod <= 10) - _00E_Levelsystem_sAppreciates.Show() - ; Debug.Notification(sActorName + sLevelsystemAppreciateALot + ".") - ElseIf (iSympathyMod > 10) && (iSympathyMod <= 20) - _00E_Levelsystem_sAppreciatesALot.Show() - ; Debug.Notification(sActorName + sLevelsystemApproves + ".") - ElseIf (iSympathyMod < 0) && (iSympathyMod >= -5) - _00E_Levelsystem_sDislikes.Show() - ; Debug.Notification(sActorName + sLevelsystemDislikes + ".") - ElseIf (iSympathyMod < -5) && (iSympathyMod >= -10) - _00E_Levelsystem_sHurt.Show() - ; Debug.Notification(sActorName + sLevelsystemOffended + ".") - ElseIf (iSympathyMod < -10) && (iSympathyMod >= -20) - _00E_Levelsystem_sVeryHurt.Show() - ; Debug.Notification(sActorName + sLevelsystemVeryOffended + ".") - EndIf - Else - Debug.Notification(sActorName + sOverride) - EndIf - -EndFunction - -;===================================================================================== -; CAMERA -;===================================================================================== - -Function LockCamera() - - fCameraMaxDistance = Utility.GetINIFloat("fVanityModeMaxDist:Camera") - Utility.SetINIFloat("fVanityModeMaxDist:Camera", Utility.GetIniFloat("fVanityModeMinDist:Camera")) - -EndFunction - -Function UnlockCamera() - - Utility.SetINIFloat("fVanityModeMaxDist:Camera", fCameraMaxDistance) - -EndFunction - -;===================================================================================== -; GLOBAL FUNCTIONS -;===================================================================================== - -Function Brawl(Actor pTarget, Actor pTargetFriend = None) - - BrawlKeyword.SendStoryEvent(None, pTarget, pTargetFriend) - -EndFunction - -function PlayerAIWalkStop() Global - - Game.ShowFirstPersonGeometry(True) - Game.SetPlayerAIDriven(False) - Game.EnablePlayerControls() - -endFunction - -function PlayerAIWalk(bool abLockedSight = True) Global - - Game.ShowFirstPersonGeometry(False) - Game.SetPlayerAIDriven(True) - If abLockedSight == True - Game.DisablePlayerControls(true, true, true, true, true, true, true, true) - ElseIf abLockedSight == False - Game.DisablePlayerControls(true, true, true, False, true, true, true, true) - EndIf - -endFunction - -Function DisableDialogueQuitting() Global -{Disables the TAB Key during dialogue. Resets automatically upon dialogue exit via Goodbye.} - - UI.InvokeBool("Dialogue Menu", "_root.DialogueMenu_mc.SetVariable", False) - -EndFunction - -Function EnableDialogueQuitting() Global -{Disables the TAB Key during dialogue. Resets automatically upon dialogue exit via Goodbye.} - - UI.InvokeBool("Dialogue Menu", "_root.DialogueMenu_mc.SetVariable", True) - -EndFunction - -Function RefreshFace() Global - - String facegen = "bUseFaceGenPreprocessedHeads:General" - Utility.SetINIBool(facegen, False) - Game.GetPlayer().QueueNiNodeUpdate() - Utility.SetINIBool(facegen, True) - -EndFunction - -Function ShowHelpMessage(Message msg, Float fDuration = 5.0, String sEvent = "Empty") Global - - Message.ResetHelpMessage(sEvent) - msg.ShowAsHelpMessage(sEvent, fDuration, 1.0, 1) - -EndFunction - -Function SafeMoveTo(ObjectReference refToMove, ObjectReference targetRef, Bool bFadeIn = False) Global - - ; A safer way to move an object reference to another ref than just MoveTo. - ; Mostly for actors to take their intended positions. - ; It's better for the actor to be already running a package that moves them to targetRef at the moment this function is called. - - refToMove.Disable() - refToMove.MoveTo(targetRef) - refToMove.Enable(bFadeIn) - -EndFunction - -Function SafeMoveTo_NoWait(ObjectReference refToMove, ObjectReference targetRef, Bool bFadeIn = False) Global - - ; A safer way to move an object reference to another ref than just MoveTo (without waiting for it to be fully enabled). - ; Mostly for actors to take their intended positions. - ; It's better for the actor to be already running a package that moves them to targetRef at the moment this function is called. - - refToMove.Disable() - refToMove.MoveTo(targetRef) - refToMove.EnableNoWait(bFadeIn) - -EndFunction - -Bool Function DistanceFailsafeMoveTo(ObjectReference refToMove, ObjectReference targetRef, Float fTooFarDistance) Global - - ; Moves refToMove to targetRef if refToMove is not within fTooFarDistance from targetRef. - ; Mostly for character travel failsafes in scenes. - - ; Debug.Trace("FailsafeMoveTo: refToMove = " + refToMove + "; d = " + refToMove.GetDistance(targetRef)) - If refToMove.GetDistance(targetRef) >= fTooFarDistance - refToMove.MoveTo(targetRef) - ; Debug.Trace("FailsafeMoveTo: refToMove = " + refToMove + " force-moved to marker") - Return True - Else - Return False - EndIf - -EndFunction - -Function WaitForReferenceToLoad(ObjectReference ref) Global - - Int maxIterationsToWait = 180 - While ref.Is3DLoaded() == False && maxIterationsToWait > 0 - ; Utility.Wait(0.02) - maxIterationsToWait -= 1 - EndWhile - -EndFunction - -Float Function NormalizeHour(Float fHour) Global - - If fHour >= 24.0 - Return (fHour - 24.0) - ElseIf fHour < 0.0 - Return (fHour + 24.0) - Else - Return fHour - EndIf - -EndFunction - -Bool Function HourIsInRange(Float fHour, Float fHourStart, Float fHourEnd) Global - - ; "Smart" test for fHour being withing a range. - ; Works both with "day" ranges (e.g., 06:00- 20:00) and with "night" ranges (e.g., 21:00-06:00) - - fHour = NormalizeHour(fHour) - fHourStart = NormalizeHour(fHourStart) - fHourEnd = NormalizeHour(fHourEnd) - - If fHourStart <= fHourEnd ; Something like 06:00 - 20:00 - Return (fHour >= fHourStart && fHour < fHourEnd) - Else ; Something like 20:00 - 06:00 - Return (fHour >= fHourStart || fHour < fHourEnd) - EndIf - -EndFunction - -Function EnableReferenceFormList(FormList referenceList) Global - - Int nItems = referenceList.GetSize() - Int i = 0 - - If nItems < 128 && nItems > 1 - Form[] refArray = referenceList.ToArray() - While i < nItems - (refArray[i] as ObjectReference).EnableNoWait() - i += 1 - EndWhile - Else - While i < nItems - (referenceList.GetAt(i) as ObjectReference).EnableNoWait() - i += 1 - EndWhile - EndIf - -EndFunction - -Function DisableReferenceFormList(FormList referenceList) Global - - Int nItems = referenceList.GetSize() - Int i = 0 - - If nItems < 128 && nItems > 1 - Form[] refArray = referenceList.ToArray() - While i < nItems - (refArray[i] as ObjectReference).DisableNoWait() - i += 1 - EndWhile - Else - While i < nItems - (referenceList.GetAt(i) as ObjectReference).DisableNoWait() - i += 1 - EndWhile - EndIf - -EndFunction - -Float Function SetActorScale(Actor akActor, Float fNewScale) Global - - ; Sets the scale of akActor to fNewScale and returns the old scale. - ; This is a workaround for GetScale() returning the cumulative scale of Race.Height * Actor.Scale for actors. - ; So it results in a messed up scale if the value returned by GetScale() is used to revert the scale change for an actor whose race has a non-1.00 height (for example, HighElfRace) - - Float fOriginalScale = akActor.GetScale() - akActor.SetScale(fNewScale) - ; Now use the known fNewScale and the return of GetScale() to get the race height coeff, and apply that coeff to fOriginalScale to calculate the true actor's reference scale. - Return fOriginalScale * fNewScale / akActor.GetScale() - -EndFunction - -Float Function AdjustTimePeriodByEngineTimerError(Float fUnadjustedPeriod) Global - - ; In SE, the game time runs slower than the real time by about 2.5/60 second - - Return fUnadjustedPeriod - (2.5 * Math.Floor(fUnadjustedPeriod) / 60.0) - -EndFunction - -Function PrintDebugMessage(String msg) Global - ; Dummy to fix error messages in Papyrus.log about missing function -EndFunction - -Function PDB(String msg) Global - ; Dummy to fix error messages in Papyrus.log about missing function -EndFunction - - - -;===================================================================================== -; GENERAL NON-GLOBAL FUNCTIONS -;===================================================================================== - -Function RemoveSilence() - - _00E_SilenceTransitionLowPriority02.Remove() - _00E_Music_Special_MQ12b_Samael.Remove() - _00E_SilenceLongTransitionHighPriority.Remove() - _00E_SilenceTransitionLowPriority.Remove() - _00E_SilenceTransitionHighPriority.Remove() - _00E_SilenceAbruptHighPriority.Remove() - _00E_Music_Special_TavernSilence.Remove() - AudioCategoryAMB.UnMute() - AudioCategoryAMBr.UnMute() - AudioCategorySFX.UnMute() - -EndFunction - -Function RemoveCombatSoundtracks() - - int iIndex = _00E_MUS_AllCombatSoundtracks.GetSize() - - while iIndex > 0 - iIndex -= 1 - MusicType musicToRemove = _00E_MUS_AllCombatSoundtracks.GetAt(iIndex) as MusicType - musicToRemove.Remove() - endwhile - -EndFunction - -Function ShowFailedMessage(String companionName = "Jespar") - - if companionName == "Jespar" && _00E_DisableQuestTutorials.GetValueInt() == 0 - _00E_Tutorial_Companions02_Jespar.Show() - ElseIf _00E_DisableQuestTutorials.GetValueInt() == 0 - _00E_Tutorial_Companions02_Calia.Show() - EndIf - -EndFunction - -Function ShowBrawlTutorial() - - If _00E_DisableSkillTutorials.GetValueInt() == 0 - Message.ResetHelpMessage("Brawl") - _00E_Tutorial_Brawl.ShowAsHelpMessage("Brawl", 3, 3, 1) - EndIf - -EndFunction - -Function PriestHeal() -{Called in dialoges with priests} - - PlayerREF.RestoreActorValue("Health", PlayerREF.GetAV("Health")) - _00E_PriestCureDiseases.Cast(PlayerREF, PlayerREF) - -EndFunction - -Function TeleportNPC(Actor NPCToTeleport, ObjectReference TeleportTarget) -{Teleport an NPC, with animations and FX} - - Weapon weap01 = NPCToTeleport.GetEquippedWeapon(0) - Weapon weap02 = NPCToTeleport.GetEquippedWeapon(1) - - If weap01 != None - NPCToTeleport.UnEquipItem(weap01) - EndIf - If weap02 != None - NPCToTeleport.UnEquipItem(weap02) - EndIf - NPCToTeleport.PlayIdle(IdleMagic_01) - _00E_TeleportCastSound.Play(NPCToTeleport) - Wait(3) - - if NPCToTeleport.GetActorBase().GetSex() == 0 - NPCToTeleport.PlayIdle(IdleT02AscendMale) - Else - NPCToTeleport.PlayIdle(IdleT02AscendFemale) - EndIf - - _00E_MagicProtectionSpellM.Play(NPCToTeleport) - Wait(4) - TimeFadeOut01FXS.Play(NPCToTeleport) - Wait(2) - _00E_A2_Ghostwalk_TeleportDoneSound.Play(NPCToTeleport) - - ObjectReference TeleportFXMarker = NPCToTeleport.PlaceAtMe(XMarkerHeading, 1) - TeleportFXMarker.MoveTo(NPCToTeleport, 0.0, 0.0, 100.0) - ObjectReference FXExplosion = TeleportFXMarker.PlaceAtMe(_00E_TeleportExplosion, 1) - _00E_NPCTeleportExplosionIMOD.Apply() - Game.ShakeCamera(afStrength = 0.2) - NPCToTeleport.MoveTo(TeleportTarget) - Debug.sendAnimationEvent(NPCToTeleport, "IdleWebEnterInstant") - NPCToTeleport.setActorValue("Variable03", 5) - TimeFadeOut01FXS.Stop(NPCToTeleport) - If NPCToTeleport.Is3DLoaded() - TimeFadeIn01FXS.Play(NPCToTeleport) - EndIf - Wait(0.5) - NPCToTeleport.playidle(WebIdleExit) - Wait(1) - TimeFadeIn01FXS.Stop(NPCToTeleport) - NPCToTeleport.setActorValue("Variable03", 0) - If weap01 != None - NPCToTeleport.EquipItem(weap01) - EndIf - If weap02 != None - NPCToTeleport.EquipItem(weap02) - EndIf - - Return - -EndFunction - -Function SetAllowIdleChatter(bool bAllow = False) - - if !bAllow - bAllowIdleChatter = False - SendModEvent("IdleChatterOff") - Elseif bAllow - bAllowIdleChatter = True - EndIf - -EndFunction - -Function ShowSynergyMessage() - - _00E_Levelsystem_sSynergyDiscovered.Show() - GiveEP(150) - - If _00E_AchievementsEnabled.GetValueInt() == 1 && !bUnlockedSynergyAchievement - Game.UnlockAchievement("END_SYNERGY_01") - bUnlockedSynergyAchievement = true - EndIf - -EndFunction - -Function SkipTimeToHour(Float fNewHourOfDay, Float fMinHoursToSkip = 0.0) - - ; Progresses the current in-game time to the desired hour (and optionally, by no less than fMinHoursToSkip hours), moving to the next day if needed - - Float fCurHour = GameHour.GetValue() - If fNewHourOfDay <= fCurHour - fNewHourOfDay += 24.0 ; Go to the next day - EndIf - If (fNewHourOfDay - fCurHour) < fMinHoursToSkip - fNewHourOfDay += 24.0 ; Go to the next day - EndIf - GameHour.SetValue(fNewHourOfDay) - SendModEvent("TimeSkip") - -EndFunction - -Function SkipHours(Float fHoursToSkip) - - ; Progresses the current in-game time by fHoursToSkip hours - - GameHour.SetValue(GameHour.GetValue() + fHoursToSkip) - SendModEvent("TimeSkip") - -EndFunction - - -;===================================================================================== -; Player Teleport -;===================================================================================== - -Event OnUpdate() - Game.EnablePlayerControls() -EndEvent - -Function TeleportPlayer(ObjectReference TeleportTarget) - - Game.DisablePlayerControls(abCamSwitch = true) - Wait(3) - If PlayerREF.IsWeaponDrawn() - PlayerREF.SheatheWeapon() - EndIf - Wait(2) - TeleportIn() - PlayerREF.MoveTo(TeleportTarget) - TeleportOut() - RefreshFace() - -EndFunction - -Function TeleportIn() - - Game.ForceThirdPerson() - - if Player.GetSex() == 0 - PlayerREF.PlayIdle(IdleT02AscendMale) - Else - PlayerREF.PlayIdle(IdleT02AscendFemale) - EndIf - - _00E_MagicProtectionSpellM.Play(PlayerREF) - Wait(2.7) - TimeFadeOut01FXS.Play(PlayerREF) - Wait(1.3) - _00E_TeleportImod.Apply() - Wait(2) - -EndFunction - -Function TeleportOut() - - _00E_A2_Ghostwalk_TeleportDoneSound.Play(playerREF) - PlayerREF.PlaceAtMe(_00E_NPCOorbayaTeleportExplosionBlue, 1) - Debug.sendAnimationEvent(playerREF, "IdleWebEnterInstant") - PlayerREF.setActorValue("Variable03", 5) - TimeFadeOut01FXS.Stop(PlayerREF) - TimeFadeIn01FXS.Play(PlayerREF) - Wait(0.5) - PlayerREF.playidle(WebIdleExit) - TimeFadeIn01FXS.Stop(PlayerREF) - PlayerREF.setActorValue("Variable03", 0) - PlayerREF.DrawWeapon() - Wait(3) - Debug.SendAnimationEvent(PlayerREF, "IdleForceDefaultState") - PlayerREF.PlayIdle(IdleForceDefaultState) - PlayerREF.setActorValue("Variable03", 0) - Game.EnablePlayerControls() - _FS_Phasmalist_ControlQuest.MoveApparitionToPlayer() - RegisterForSingleUpdate(2) - -EndFunction - -;===================================================================================== -; FADE TO BLACK -;===================================================================================== - -Function FadeToBlackAndBack() - - FadeToBlackIMOD.Apply() - Wait(2.8) - FadeToBlackIMOD.PopTo(FadeToBlackHoldIMOD) - Wait(1.9) - FadeToBlackHoldIMOD.PopTo(FadeToBlackBackIMOD) - -EndFunction - -Function FadeToBlack() - - FadeToBlackIMOD.Apply() - Wait(2.8) - FadeToBlackIMOD.PopTo(FadeToBlackHoldImod) - -EndFunction - -Function FadeToBlackBack() - - FadeToBlackHoldImod.PopTo(FadeToBlackBackImod) - -EndFunction - -;===================================================================================== -; FAKEHEADTRACK (unused?) -;===================================================================================== - -function FakeHeadtrackStart() - - _00E_HeadtrackGlobal.SetValueInt(1) - game.SetPlayerAIDriven(true) - game.DisablePlayerControls(true, true, true, true, true, true, true, false, 0) - PlayerREF.AddPerk(_00E_VisionPerk) - UpdateSpeed(PlayerREF) - Wait(0.500000) - PlayerREF.RemoveSpell(_00E_Vision_UpdateAb) - -endFunction - -function FakeHeadtrackEnd() - - _00E_HeadtrackGlobal.SetValueInt(0) - game.EnablePlayerControls(true, true, true, true, true, true, true, true, 0) - game.SetPlayerAIDriven(false) - PlayerREF.RemovePerk(_00E_VisionPerk) - UpdateSpeed(PlayerREF) - Wait(0.500000) - -endFunction - -;===================================================================================== -; VISION -;===================================================================================== - -function EndVision(bool ScenePlaying, Scene RunningScene = None) - - If PlayerREF.HasSpell(_00E_Vision_TimeSpell) - PlayerREF.RemoveSpell(_00E_Vision_TimeSpell) - ElseIf PlayerREF.HasSpell(_00E_Vision_NoTimeSpell) - PlayerREF.RemoveSpell(_00E_Vision_NoTimeSpell) - ElseIf PlayerREF.HasSpell(_00E_Vision_NoTimeSubtleSpell) - PlayerREF.RemoveSpell(_00E_Vision_NoTimeSubtleSpell) - EndIf - VisionLight.Delete() - If ScenePlaying == True && RunningScene.IsPlaying() - RunningScene.Stop() - EndIf - PlayerREF.MoveTo(PlayerVisionStartMarker) - -endFunction - -Function VisionEffectTimestop(bool bSilent = False, bool bCustomImod = False, bool bCustomMusic = False) - - If bCustomImod == False - _00E_VisionStartTimestopIMOD.Apply() - _00E_VisionImod.ApplyCrossFade(0.25) - EndIf - - PlayerREF.AddSpell(_00E_Vision_TimeSpell, False) - - if !bCustomMusic - _00E_SilenceAbruptHighPriority.Add() - EndIf - - MagRacialBattlecryFire.Play(PlayerREF) - fPlayerSpeedBeforeVision = PlayerREF.GetActorValue("SpeedMult") - PlayerREF.SetActorValue("SpeedMult", 35) - UpdateSpeed(PlayerREF) - - If !bSilent - VisionSound = _00E_VisionLPM.Play(PlayerREF) - EndIf - - _00E_VisionShaderParticles.Apply(0.5) - AudioCategoryFST.Mute() - - PlayerREF.SetGhost(True) - - PlayerVisionStartMarker = PlayerREF.PlaceAtMe(XMarker as form, 1, false, false) - PlayerVisionFailsaveMarker.MoveTo(PlayerREF) - Game.DisablePlayerControls(false, true, true, false, true, false, true, false) - Game.ForceFirstPerson() - Game.ShowFirstPersonGeometry(False) - Wait(0.100000) - -EndFunction - -Function VisionEffectTimestopStop(bool bMovementHasBeenLocked = False) - - float fSpeedMultBefore = PlayerREF.GetAV("speedMult") - - PlayerREF.SetGhost(False) - Game.DisablePlayerControls() - PlayerREF.SetActorValue("SpeedMult", PlayerSpeed) - PlayerREF.SetGhost(False) - AudioCategoryFST.UnMute() - UpdateSpeed(PlayerREF) - Game.ShowFirstPersonGeometry(True) - - If !bMovementHasBeenLocked - If PlayerVisionFailsaveMarker.GetDistance(PlayerREF) <= 1000 - PlayerREF.MoveTo(PlayerVisionStartMarker) - Elseif PlayerVisionFailsaveMarker.GetDistance(PlayerREF) >= 1000 - PlayerREF.MoveTo(PlayerVisionFailsaveMarker) - EndIf - EndIf - - PlayerREF.SetGhost(False) - Sound.StopInstance(VisionSound) - MAGConjurePortalClose.Play(PlayerREF) - _00E_SilenceAbruptHighPriority.Remove() - PlayerREF.RemoveSpell(_00E_Vision_TimeSpell) - _00E_VisionShaderParticles.Remove(0.5) - _00E_VisionEndImod.ApplyCrossFade(1) - Wait(0.5) - PlayerREF.SetAV("speedMult", fPlayerSpeedBeforeVision) - - If PlayerREF.GetAV("speedMult") < 50 - PlayerREF.SetAV("speedMult", 100) - EndIf - - UpdateSpeed(PlayerREF) - Game.EnablePlayerControls() - Game.SetPlayerAIDriven(0) - Game.ShowFirstPersonGeometry(True) - _00E_SilenceAbruptHighPriority.Remove() - -EndFunction - -Function VisionEffectNoTimestop(Formlist RefsInvolved, Formlist ActorsToFreeze, bool bCustomMusic = False) - - Game.ShowFirstPersonGeometry(False) - PlayerREF.SetAlpha(0.1) - PlayerREF.AddPerk(_00E_VisionPerk) - UpdateSpeed(PlayerREF) - MagRacialBattlecryFire.Play(PlayerREF) - - if !bCustomMusic - _00E_SilenceAbruptHighPriority.Add() - EndIf - - AudioCategoryFST.Mute() - PlayerVisionStartMarker = PlayerREF.PlaceAtMe(XMarker as form, 1, false, false) - PlayerVisionFailsaveMarker.MoveTo(PlayerREF) - PlayerREF.SetGhost(True) - VisionSound = _00E_VisionLPM.Play(PlayerREF) - _00E_VisionStartImod.Apply() - - If PlayerREF.IsInInterior() - _00E_VisionShaderParticles.Apply(0.5) - EndIf - - if RefsInvolved != None - int iIndex = RefsInvolved.GetSize() - - while iIndex > 0 - iIndex -= 1 - Actor VisionREF = RefsInvolved.GetAt(iIndex) as Actor - if VisionREF.IsDisabled() - VisionREF.EnableNoWait() - EndIf - VisionRef.SetAlpha(0.5) - MS04MemoryFXBody01VFX.Play(VisionREF) - EndWhile - endif - - if ActorsToFreeze != None - int iIndex02 = ActorsToFreeze.GetSize() - - while iIndex02 > 0 - iIndex02 -= 1 - Actor FreezeREF = ActorsToFreeze.GetAt(iIndex02) as Actor - FreezeREF.EnableAI(False) - EndWhile - endif - - _00E_MQ16_VisionIMOD.Remove() - _00E_VisionImod.ApplyCrossFade(1) - -EndFunction - -Function VisionEffectNoTimestopStop(Formlist RefsInvolved, Formlist ActorsToFreeze, bool bHasBeenRestrained = False) - - PlayerREF.SetAlpha(1.0) - Game.ShowFirstPersonGeometry(True) - - If !bHasBeenRestrained - If PlayerVisionFailsaveMarker.GetDistance(PlayerREF) <= 1000 - PlayerREF.MoveTo(PlayerVisionStartMarker) - Elseif PlayerVisionFailsaveMarker.GetDistance(PlayerREF) >= 1000 - PlayerREF.MoveTo(PlayerVisionFailsaveMarker) - EndIf - EndIf - - _00E_VisionEndImod.ApplyCrossFade(1) - If PlayerREF.IsInInterior() - _00E_VisionShaderParticles.Remove(0.5) - EndIf - - if RefsInvolved != None - int iIndex = RefsInvolved.GetSize() - - while iIndex > 0 - iIndex -= 1 - Actor VisionREF = RefsInvolved.GetAt(iIndex) as Actor - MS04MemoryFXBody01VFX.Stop(VisionREF) - VisionRef.SetAlpha(1) - EndWhile - endif - - if ActorsToFreeze != None - int iIndex02 = ActorsToFreeze.GetSize() - - while iIndex02 > 0 - iIndex02 -= 1 - Actor FreezeREF = ActorsToFreeze.GetAt(iIndex02) as Actor - FreezeREF.EnableAI(True) - EndWhile - endif - - AudioCategoryFST.UnMute() - PlayerREF.SetGhost(False) - Sound.StopInstance(VisionSound) - MAGConjurePortalClose.Play(PlayerREF) - _00E_SilenceAbruptHighPriority.Remove() - PlayerREF.RemovePerk(_00E_VisionPerk) - - If PlayerREF.GetAV("speedMult") < 50 - PlayerREF.SetAV("speedMult", 100) - EndIf - - UpdateSpeed(PlayerREF) - _00E_MQ16_VisionIMOD.Remove() - _00E_VisionImod.Remove() - -EndFunction - -Function UpdateSpeed(Actor SpeedUpdateActor) - - If SpeedUpdateActor.HasSpell(_00E_Vision_UpdateAb) - SpeedUpdateActor.RemoveSpell(_00E_Vision_UpdateAb) - EndIf - - SpeedUpdateActor.AddSpell(_00E_Vision_UpdateAb, False) - Wait(0.1) - SpeedUpdateActor.RemoveSpell(_00E_Vision_UpdateAb) - -EndFunction - -;===================================================================================== -; AREMOVE ITEMS SAFE -;===================================================================================== - -Function RemoveAllItemsSafeVersion(ObjectReference TransferToLoc = NONE) - If Gold001 == NONE || _00E_AllAmmos == NONE - Return - EndIf - - RemoveItemsIncrementally(Gold001, TransferToLoc) - Form[] arrows = _00E_AllAmmos.ToArray() - Int i = 0 - While i < arrows.Length - RemoveItemsIncrementally(arrows[i], TransferToLoc) - i += 1 - EndWhile - - If TransferToLoc == NONE - PlayerREF.removeAllItems(_00E_RemoveAllItems_TrashContainer, abRemoveQuestItems = false) - _00E_RemoveAllItems_TrashContainer.removeAllItems() - Else - PlayerREF.RemoveAllItems(akTransferTo = TransferToLoc, abRemoveQuestItems = true) - EndIf -EndFunction - -Function RemoveItemsIncrementally(Form akItem, ObjectReference TransferToLoc) - Int nCount = PlayerREF.GetItemCount(akItem) - If nCount > 3000000 && akItem == Gold001 - _00E_PleaseRemoveMoney.Show() - EndIf - While nCount > 0 - PlayerREF.RemoveItem(akItem, 10000, true, TransferToLoc) - nCount -= 10000 - EndWhile -EndFunction - -;===================================================================================== -; ADDED IN FORGOTTEN STORIES -;===================================================================================== - -Function SlowMotion(float fDuration = 5.0, bool bSound = true) - - PlayerREF.AddSpell(_00E_FS_NQR05_SlowMotionSP, False) - - if bSound - _00E_FS_NQR05_SlowMotion_IntroM.Play(PlayerREF) - endif - - Wait(fDuration) - - if bSound - _00E_FS_NQR05_SlowMotion_OutroM.Play(PlayerREF) - endif - - PlayerREF.RemoveSpell(_00E_FS_NQR05_SlowMotionSP) - -EndFunction - -Function UnsummonApparitionIfExists() Global - - _FS_Phasmalist_ControlQuest.UnsummonApparitionIfExists() - -EndFunction - -Function EndWerewolfModeWhenTransformed() Global - - ; This function ends the werewolf mode if the player is currently transformed, with no penalties. - _FS_TheriantrophistControlQuest.TransformBackIfTransformed() - ; Links to Theriantrophist script. - -EndFunction - -Function SetNPCAsCompanion(Actor akActor, bool bCompanion = True, int iCompanionHealth = 100, int iCompanionStamina = 100, int iCompanionMagicka = 100) Global -;Sets an NPC as companion, showing his health bar, making him friendly, unflagging him as ghost. Does the opposite when bCompanion is set to false. -;Additionally sets the AVs Health, Stamina, Magicka for the NPC companion - - _00E_FS_ForgottenStories_Functions ForgottenStoriesMiscDialogue = Game.GetFormFromFile(0x01016E89, "Enderal - Forgotten Stories.esm") as _00E_FS_ForgottenStories_Functions - - If bCompanion - - akActor.SetRelationshipRank(Game.GetPlayer(), 3) - akActor.SetGhost(False) - akActor.getActorbase().SetEssential(true) ; just in case, had trouble with FS_NQR05 - akActor.SetPlayerTeammate(True) - akActor.IgnoreFriendlyHits() - akActor.SetAV("Health", iCompanionHealth) - akActor.SetAV("Stamina", iCompanionStamina) - akActor.SetAV("Magicka", iCompanionMagicka) - ForgottenStoriesMiscDialogue.showActorHealthBars(akActor) - - Else - - akActor.SetGhost(True) - akActor.getActorbase().SetEssential(true) ; just in case, had trouble with FS_NQR05 - akActor.ResetHealthAndLimbs() - akActor.SetPlayerTeammate(False) - akActor.IgnoreFriendlyHits(False) - ForgottenStoriesMiscDialogue.hideActorHealthBars(akActor) - - EndIf - -EndFunction - -Function StartVoicedLetter(MusicType MTVoicedLetter) - - MTToRemove = MTVoicedLetter - RegisterForMenu("Book Menu") - MTVoicedLetter.Add() - -EndFunction - -Event OnMenuClose(String MenuName) - - If MenuName == "Book Menu" - MTToRemove.Remove() - UnregisterForMenu("Book Menu") - EndIf - -EndEvent - - -; SKILL BOOKS - -Message Property _00E_SkillbookWarning Auto - -Bool _SkillBookReadLocked = False - -Function _ReadSkillBook(String skillName, Int skillTopLimit, Form bookItem, Message msgSkillIncrease, GlobalVariable availablePoints, Message msgNoPoints) - Message failMsg = None - - While _SkillBookReadLocked - WaitMenuMode(0.1) - EndWhile - _SkillBookReadLocked = True - - ; DO NOT FORGET TO FALSE _SkillBookReadLocked ON RETURN - - If availablePoints.GetValue() >= 1 - Int curSkill = PlayerREF.GetBaseActorValue(skillName) as Int - - If curSkill >= skillTopLimit - failMsg = _00E_Levelsystem_sSkillTooWellDeveloped - ElseIf curSkill >= (skillTopLimit - 25) || (_00E_SkillbookWarning.Show() == 0) ; If cur. skill is within the book's limit or the player says "Yes" - ; Do skill increase - curSkill += 1 - PlayerREF.SetActorValue(skillName, curSkill) - availablePoints.Mod(-1) - _SkillBookReadLocked = False - msgSkillIncrease.Show(1, curSkill) - Return - EndIf - Else ; availablePoints < 1 - failMsg = msgNoPoints - EndIf - - ; Processing failed read - _SkillBookReadLocked = False - - If failMsg != None - failMsg.Show() - EndIf - - PlayerREF.AddItem(bookItem, 1, True) -EndFunction - -Function ReadPrimarySkillBook(String skillName, Int skillTopLimit, Form bookItem, Message msgSkillIncrease) - _ReadSkillBook(skillName, skillTopLimit, bookItem, msgSkillIncrease, Lernpunkte, _00E_Levelsystem_sNoMoreLearningPoints) -EndFunction - -Function ReadCraftingSkillBook(String skillName, Int skillTopLimit, Form bookItem, Message msgSkillIncrease) - _ReadSkillBook(skillName, skillTopLimit, bookItem, msgSkillIncrease, Handwerkspunkte, _00E_Levelsystem_sNoMoreCraftingPoints) -EndFunction - -Function ReadMemorySkillBook(String sClass, Int iTier, Message talentMessage, float fRecoveryTime02, float fRecoveryTime03, Potion PotionItem, Shout TaughtTalent, WordOfPower Word01, WordOfPower Word02, WordOfPower Word03, Perk Perk01, Perk Perk02, Perk Perk03) - While _MemoryBookReadLocked - WaitMenuMode(0.1) - EndWhile - _MemoryBookReadLocked = True - - int iButton = talentMessage.Show() - - if iButton == 0 - - if iTier == 1 - iRequiredPoints = iPointRequirementTier01 - Elseif iTier == 2 - iRequiredPoints = iPointRequirementTier02 - Else - iRequiredPoints = iPointRequirementTier03 - EndIf - - if RequirementsMetMemoryBook(iTier, Perk01, Perk02, Perk03, sClass) - TeachTalent(iTier, TaughtTalent, Perk01, Perk02, Perk03, Word01, Word02, Word03, fRecoveryTime02, fRecoveryTime03) - Else - - if bValidSkilllevel - - Message messageToShow = _00E_FS_A3_sMageClassName - - if sClass == "Rogue" - messageToShow = _00E_FS_A3_sRogueClassName - Elseif sClass == "Warrior" - messageToShow = _00E_FS_A3_sWarriorClassName - EndIf - Debug.Notification(_00E_FS_A3_sYouNeedSkillpoints.GetName() + " " + iRequiredPoints + _00E_FS_A3_sIn.GetName() + messageToShow.GetName() + _00E_FS_A3_sToUnlockThisClass.GetName()) - - EndIf - - PlayerREF.AddItem(PotionItem, 1, true) - - EndIf - _MemoryBookReadLocked = False - - Else - - PlayerREF.AddItem(PotionItem, 1, true) - _MemoryBookReadLocked = False - Return - - EndIf -EndFunction - -bool Function RequirementsMetMemoryBook(int iTier, Perk Perk01, Perk Perk02, Perk Perk03, string sClass) - - Formlist ClassFormList01 - Formlist ClassFormList02 - Formlist ClassFormList03 - - if (iTier == 3 && !PlayerREF.HasPerk(Perk02)) || (iTier == 2 && !PlayerREF.HasPerk(Perk01)) - - _00E_FS_A3_NeedToLearnOtherLevels.Show() - bValidSkilllevel = False - Return False - - Elseif (iTier == 1 && PlayerREF.HasPerk(Perk01)) || (iTier == 2 && PlayerREF.HasPerk(Perk02)) || (iTier == 3 && PlayerREF.HasPerk(Perk03)) - - _00E_FS_A3_AlreadyKnowThisLevel.Show() - bValidSkilllevel = False - Return False - - Else - - bValidSkilllevel = True - - if sClass == "Rogue" - ClassFormList01 = EspionagePerks - ClassFormList02 = TrickeryPerks - ClassFormList03 = VagabondPerks - - Elseif sClass == "Warrior" - ClassFormList01 = BastionPerks - ClassFormList02 = DerwishPerks - ClassFormList03 = RagePerks - - Elseif sClass == "Mage" - ClassFormList01 = ElementalismPerks - ClassFormList02 = LifeAndDeathPerks - ClassFormList03 = ManipulationPerks - EndIf - - int iTotalPointsInRequiredClass = (PlayerSkillMenu.GetPointsInClass(ClassFormList01) + PlayerSkillMenu.GetPointsInClass(ClassFormList02) + PlayerSkillMenu.GetPointsInClass(ClassFormList03)) - if iTotalPointsInRequiredClass >= iRequiredPoints - Return True - Else - Return False - EndIf - - EndIf - -EndFunction - -Function TeachTalent(int iLevel, Shout TaughtTalent, Perk Perk01, Perk Perk02, Perk Perk03, WordOfPower Word01, WordOfPower Word02, WordOfPower Word03, float fRecoveryTime02, float fRecoveryTime03) - - if iLevel == 1 - - PlayerREF.AddPerk(Perk01) - PlayerREF.AddShout(TaughtTalent) - Game.UnlockWord(Word01) - Game.TeachWord(Word01) - - Elseif iLevel == 2 - - PlayerREF.AddPerk(Perk02) - Game.UnlockWord(Word02) - Game.TeachWord(Word02) - SetRecoveryTimeMemoryBook(2, TaughtTalent, fRecoveryTime02, fRecoveryTime03) - - Else - - PlayerREF.AddPerk(Perk03) - Game.UnlockWord(Word03) - Game.TeachWord(Word03) - SetRecoveryTimeMemoryBook(3, TaughtTalent, fRecoveryTime02, fRecoveryTime03) - - EndIf - - TalentPoints.Mod(-1) - - If _00E_AchievementsEnabled.GetValueInt() == 1 - Game.UnlockAchievement("END_TALENT_BOOK_01") - EndIf - -EndFunction - -Function SetRecoveryTimeMemoryBook(int iWord, Shout TaughtTalent, float fRecoveryTime02, float fRecoveryTime03) -{This function handles the issue of cooldowns not depending on the value in the CK but on the duration the player presses the [Shout] key on his keyboard.} - - If iWord == 2 - TaughtTalent.SetNthRecoveryTime(0, fRecoveryTime02) - TaughtTalent.SetNthRecoveryTime(1, fRecoveryTime02) - Else - TaughtTalent.SetNthRecoveryTime(0, fRecoveryTime03) - TaughtTalent.SetNthRecoveryTime(1, fRecoveryTime03) - TaughtTalent.SetNthRecoveryTime(2, fRecoveryTime03) - EndIf - -EndFunction - - -; EQUIPPING SETS - -Function OnArmorSetBonusAdded(Bool bFullSet) - Sound.SetInstanceVolume(MAGIllusionCharm.Play(PlayerREF), 0.4) ; Play MAGIllusionCharm at lower volume - - If bFullSet && bSetAchievementUnlocked == False && _00E_AchievementsEnabled.GetValueInt() == 1 - Game.UnlockAchievement("END_SET_01") - bSetAchievementUnlocked = True - EndIf -EndFunction - -Function OnArmorSetBonusRemoved() - _00E_ArmorSetScript_sSetBonusRemoved.Show() -EndFunction - - - -Float fDefaultHeadTrackTimerOldValue = 0.0 -Float fStayHeadTrackTimerOldValue = 0.0 - -Function StopRandomHeadTracking() - ; Raise "change headtrack target" timers a lot so the NPCs would stare at what the scene tells them, without randomly switching to the player or other NPCs - If fDefaultHeadTrackTimerOldValue == 0.0 - fDefaultHeadTrackTimerOldValue = Game.GetGameSettingFloat("fAIHoldDefaultHeadTrackTimer") - Game.SetGameSettingFloat("fAIHoldDefaultHeadTrackTimer", 1000.0) - EndIf - If fStayHeadTrackTimerOldValue == 0.0 - fStayHeadTrackTimerOldValue = Game.GetGameSettingFloat("fAIStayonScriptHeadtrack") - Game.SetGameSettingFloat("fAIStayonScriptHeadtrack", 1000.0) - EndIf -EndFunction - -Function ResumeRandomHeadTracking() - If fDefaultHeadTrackTimerOldValue > 0.0 - Game.SetGameSettingFloat("fAIHoldDefaultHeadTrackTimer", fDefaultHeadTrackTimerOldValue) - fDefaultHeadTrackTimerOldValue = 0.0 - EndIf - If fStayHeadTrackTimerOldValue > 0.0 - Game.SetGameSettingFloat("fAIStayonScriptHeadtrack", fStayHeadTrackTimerOldValue) - fStayHeadTrackTimerOldValue = 0.0 - EndIf -EndFunction - - -;===================================================================================== -; PROPERTIES -;===================================================================================== - -int Property iMajorClassIndex Auto Conditional Hidden -int Property iMinorClassIndex Auto Conditional Hidden - -bool Property bAllowIdleChatter = True Auto Conditional Hidden ; Set this to true when NPCs shouldn't Idle around - -float Property fPlayerSpeedBeforeVision Auto Hidden -float Property fCameraMaxDistance Auto Hidden -float Property fBaseGravity Auto Hidden - -;Actor akPlayerCopy - -Sound Property _00E_FS_NQR05_SlowMotion_IntroM Auto -Sound Property _00E_FS_NQR05_SlowMotion_OutroM Auto - -ActorBase Property _00E_MC_Jespar Auto -ActorBase Property _00E_MC_Calia Auto -ActorBase Property _00E_SC_Tharael Auto -ActorBase Property _00E_SC_Dijaam Auto -ActorBase Property _00E_MQ11c_Ryneus Auto -ActorBase Property _00E_CapitalCityMaelGroschenfrst Auto -ActorBase Property _00E_MC_Yuslan Auto -ActorBase Property _00E_FS_NQ02_Esme Auto - -GlobalVariable Property SympathyTharael Auto -GlobalVariable Property SympathyJespar Auto -GlobalVariable Property SympathyDijaam Auto -GlobalVariable Property SympathyMaelGroschenfuerst Auto -GlobalVariable Property SympathyCalia Auto -GlobalVariable Property SympathyYuslan Auto -GlobalVariable Property SympathyEsme Auto - -GlobalVariable Property CaliaFlirtCounter Auto -GlobalVariable Property DijaamFlirtCounter Auto -GlobalVariable Property JesparFlirtCounter Auto -GlobalVariable Property TharaelFlirtCounter Auto - -GlobalVariable Property _00E_AchievementsEnabled Auto - -ReferenceAlias Property Levelsystem_SympathyActor Auto - -Formlist Property _00E_AllAmmos Auto - -MiscObject Property Gold001 Auto - -Message Property _00E_PleaseRemoveMoney Auto - -GlobalVariable Property GameHour Auto - -;--------------------------------------VISION-----------------------------------; - -float PlayerSpeed -int VisionSound - -Perk Property _00E_VisionPerk Auto - -SoundCategory Property AudioCategoryFST Auto - -VisualEffect Property MS04MemoryFXBody01VFX Auto -ImageSpaceModifier Property _00E_VisionStartImod Auto -ImageSpaceModifier Property _00E_VisionIMOD Auto -ImageSpaceModifier Property _00E_VisionEndImod Auto -Sound Property _00E_VisionLPM Auto -Sound Property MagRacialBattlecryFire Auto -Sound Property MAGConjurePortalClose Auto - -Spell Property _00E_Vision_UpdateAb Auto - -MusicType Property _00E_SilenceTransitionLowPriority02 Auto -MusicType Property _00E_Music_Special_MQ12b_Samael Auto -MusicType Property _00E_SilenceLongTransitionHighPriority Auto -MusicType Property _00E_SilenceTransitionLowPriority Auto -MusicType Property _00E_SilenceTransitionHighPriority Auto -MusicType Property _00E_SilenceAbruptHighPriority Auto -MusicType Property _00E_Music_Special_TavernSilence Auto - -Formlist Property _00E_MUS_AllCombatSoundtracks Auto - -;--------------------------------------LEVELSYSTEM----------------------------------- - -GlobalVariable Property Handwerkspunkte auto -GlobalVariable Property SympathyRyneus auto -GlobalVariable Property Lernpunkte auto -GlobalVariable Property TalentPoints auto -GlobalVariable Property _00E_DisableQuestTutorials Auto -GlobalVariable Property _00E_DisableSkillTutorials Auto -Keyword Property BrawlKeyword Auto - -Message Property _00E_FS_A3_sYouNeedSkillpoints Auto -Message Property _00E_FS_A3_sIn Auto -Message Property _00E_FS_A3_sToUnlockThisClass Auto -Message Property _00E_FS_A3_sWarriorClassName Auto -Message Property _00E_FS_A3_sRogueClassName Auto -Message Property _00E_FS_A3_sMageClassName Auto -Message Property _00E_FS_A3_NeedToLearnOtherLevels Auto -Message Property _00E_FS_A3_AlreadyKnowThisLevel Auto - -int iPointRequirementTier01 = 5 -int iPointRequirementTier02 = 10 -int iPointRequirementTier03 = 15 - -int iRequiredPoints - -bool bValidSkilllevel - -Formlist Property EspionagePerks Auto -Formlist Property TrickeryPerks Auto -Formlist Property VagabondPerks Auto -Formlist Property BastionPerks Auto -Formlist Property DerwishPerks Auto -Formlist Property RagePerks Auto -Formlist Property ElementalismPerks Auto -Formlist Property LifeAndDeathPerks Auto -Formlist Property ManipulationPerks Auto - -_00E_Game_SkillmenuSC Property PlayerSkillMenu Auto - -Bool _MemoryBookReadLocked = False - -;-------------------------------------TELEPORT SCRIPT----------------------------------- - -VisualEffect Property MGTeleportInEffect Auto -Actor Property PlayerREF Auto -ActorBase Property Player Auto -EffectShader Property TimeFadeOut01FXS Auto -EffectShader Property TimeFadeIn01FXS Auto -Explosion Property _00E_TeleportExplosion Auto -Explosion Property _00E_NPCOorbayaTeleportExplosionBlue Auto - -Idle Property WebIdleExit Auto -Idle Property IdleT02AscendMale Auto -Idle Property IdleT02AscendFemale Auto -Idle Property IdleForceDefaultState Auto - -Static Property XMarkerHeading Auto - -Sound Property _00E_MagicProtectionSpellM Auto -Sound Property _00E_A2_Ghostwalk_TeleportDoneSound Auto -Sound Property _00E_TeleportCastSound Auto - -Message Property _00E_Tutorial_Brawl Auto -Message Property _00E_Tutorial_Companions02_Jespar Auto -Message Property _00E_Tutorial_Companions02_Calia Auto - -Message Property _00E_Levelsystem_sApproves Auto -Message Property _00E_Levelsystem_sAppreciates Auto -Message Property _00E_Levelsystem_sAppreciatesALot Auto -Message Property _00E_Levelsystem_sDislikes Auto -Message Property _00E_Levelsystem_sHurt Auto -Message Property _00E_Levelsystem_sVeryHurt Auto -Message Property _00E_Levelsystem_sDoesNotTrust Auto -Message Property _00E_Levelsystem_sExtremelyHurt Auto -Message Property _00E_Levelsystem_sIsHurt Auto - -Message Property _00E_Levelsystem_sSynergyDiscovered Auto -Message Property _00E_Levelsystem_sNoMoreCraftingPoints Auto -Message Property _00E_Levelsystem_sNoMoreLearningPoints Auto -Message Property _00E_Levelsystem_sSkillTooWellDeveloped Auto -Message Property _00E_Levelsystem_sSkillBy Auto -Message Property _00E_Levelsystem_sSkillTo Auto -Message Property _00E_Levelsystem_sSkillFrom Auto -Message Property _00E_Levelsystem_sSkillIncreased Auto -Message Property _00E_Levelsystem_sAbilityEnemyLevelTooHigh Auto -Message Property _00E_Levelsystem_sAbilityEnemyHasToBeAlive Auto -Message Property _00E_Levelsystem_sEnemyHasToBeDead Auto -Message Property _00E_Levelsystem_sAbilityEnemyTooFarAway Auto -Message Property _00E_Levelsystem_sAbilityTargetImmune Auto -Message Property _00E_Levelsystem_sAbilityMarkingRemoved Auto -Message Property _00E_Levelsystem_sEnemyMarked Auto -Message Property _00E_Levelsystem_sAbilityStanceStarted Auto -Message Property _00E_Levelsystem_sAbilityStanceEnded Auto -Message Property _00E_Levelsystem_sAbilityStanceQyrai Auto -Message Property _00E_Levelsystem_sAbilityStanceSkaragg Auto -Message Property _00E_Levelsystem_sEnemyAlreadyMarked Auto -Message Property _00E_Levelsystem_sEldritchBloodVictimMarked Auto -Message Property _00E_Levelsystem_sEldritchBloodAttackTargetMarked Auto -Message Property _00E_Levelsystem_sEldritchBloodAttackVictimMarkingRemoved Auto -Message Property _00E_Levelsystem_sEldritchBloodVictimMarkingRemoved Auto -Message Property _00E_Levelsystem_sGhostwalkEnemyTooCloseToWall Auto - -ObjectReference Property PlayerVisionStartMarker Auto Hidden -ObjectReference Property PlayerVisionFailsaveMarker Auto Hidden -ObjectReference Property VisionLight Auto Hidden - -ObjectReference Property _00E_RemoveAllItems_TrashContainer Auto - -Idle Property IdleMagic_01 Auto - -Spell Property _00E_Vision_NoTimeSpell Auto -Spell Property _00E_Vision_NoTimeSubtleSpell Auto -Spell Property _00E_Vision_TimeSpell Auto -Spell Property _00E_PriestCureDiseases Auto -Spell Property _00E_FS_NQR05_SlowMotionSP Auto - -GlobalVariable Property _00E_HeadtrackGlobal Auto - -ImageSpaceModifier Property FadeToBlackIMOD Auto -ImageSpaceModifier Property FadeToBlackHoldIMOD Auto -ImageSpaceModifier Property FadeToBlackBackIMOD Auto -ImageSpaceModifier Property _00E_NPCTeleportExplosionIMOD Auto -ImageSpaceModifier Property _00E_TeleportImod Auto -ImageSpaceModifier Property _00E_VisionStartTimestopIMOD Auto -ImageSpaceModifier Property _00E_MQ16_VisionIMOD Auto - -ShaderParticleGeometry Property _00E_VisionShaderParticles Auto - -SoundCategory Property AudioCategoryAMB Auto -SoundCategory Property AudioCategoryAMBr Auto -SoundCategory Property AudioCategorySFX Auto - -Static Property XMarker Auto - -int doOnce -int done -float SpeedBefore - -bool bUnlockedSynergyAchievement - -;for re-equipping the player after the bathouse scene -Armor PlayerHelmet -Armor PlayerCuirass -Armor PlayerGauntlets -Armor PlayerBoots -Armor PlayerRing01 -Armor PlayerRing02 -Armor PlayerNecklace -Weapon RightHandWeapon -Weapon LeftHandWeapon -Spell RightHandSpell -Spell LeftHandSpell -Armor Shield - -;for VoiceLetters -MusicType MTToRemove - -;for sets -Sound Property MAGIllusionCharm Auto -Message Property _00E_ArmorSetScript_sSetBonusRemoved Auto -bool bSetAchievementUnlocked = false diff --git a/source/scripts/_00e_gaboff_grammophonesc.psc b/source/scripts/_00e_gaboff_grammophonesc.psc index c394488e..beb7f698 100644 --- a/source/scripts/_00e_gaboff_grammophonesc.psc +++ b/source/scripts/_00e_gaboff_grammophonesc.psc @@ -1,40 +1,132 @@ Scriptname _00E_Gaboff_GrammophoneSC extends ObjectReference -Event OnUpdate() +Message Property _00E_Gaboff_GrammophoneMSG Auto +Message Property _00E_PlayerhousingKoppophonVolume Auto +Sound Property _00E_MUS_Special_OceansWidowM Auto +MiscObject Property Gold001 Auto +Actor Property PlayerREF Auto + +Int iSoundID = -1 +Float fVolume = 0.5 +Bool bMusicLocked = False + +Float Property MUSIC_LENGTH = 212.3 AutoReadOnly + + +;===================================================================================== +; FUNCTIONS +;===================================================================================== + +Function PlayMusic(Sound musicSound, Float fMusicLength) + If fVolume <= 0.0 || fVolume > 1.0 + fVolume = 0.5 + EndIf + RegisterForModEvent("BardsLoadGame", "OnBardsLoadGame") + iSoundID = musicSound.Play(Self) + Sound.SetInstanceVolume(iSoundID, fVolume) + RegisterForSingleUpdate(_00E_QuestFunctions.AdjustTimePeriodByEngineTimerError(fMusicLength)) + GoToState("") + _00E_PlayerhousingKoppophonVolume.Show(fVolume * 100.0) +EndFunction + +Function ChangeMusicVolume() + If fVolume >= 0.0 && fVolume < 1.0 + fVolume += 0.25 + Else ; fVolume >= 1.0 or something is wrong with fVolume + fVolume = 0.0 + EndIf + Sound.SetInstanceVolume(iSoundID, fVolume) + _00E_PlayerhousingKoppophonVolume.Show(fVolume * 100.0) +EndFunction + +Function StopMusic() + bMusicLocked = True + + GoToState("DoneCleanup") + UnregisterForModEvent("BardsLoadGame") + UnregisterForUpdate() + + If iSoundID != -1 + Sound.StopInstance(iSoundID) + iSoundID = -1 + EndIf + + bMusicLocked = False +EndFunction + +Function TryStopMusic() + If bMusicLocked == False + StopMusic() + Else + RegisterForSingleUpdate(0.5) + EndIf +EndFunction - bIsPlaying = False +;===================================================================================== +; EVENTS +;===================================================================================== + +Event OnInit() + GoToState("DoneCleanup") EndEvent Event OnActivate(ObjectReference akActionRef) + If akActionRef == PlayerREF && bMusicLocked == False + bMusicLocked = True - If !bIsPlaying - - int iButton = _00E_Gaboff_GrammophoneMSG.Show() - - if iButton == 0 - - bIsPlaying = True - PlayerREF.RemoveItem(Gold001, 5) - _00E_MUS_Special_OceansWidowM.Play(Self) - RegisterForSingleUpdate(160) - + If iSoundID == -1 + If _00E_Gaboff_GrammophoneMSG.Show() == 0 + PlayerREF.RemoveItem(Gold001, 5) + PlayMusic(_00E_MUS_Special_OceansWidowM, MUSIC_LENGTH) + EndIf Else - - Return - + ChangeMusicVolume() EndIf - + + bMusicLocked = False EndIf - EndEvent -bool bIsPlaying +Event OnUpdate() + TryStopMusic() +EndEvent -Actor Property PlayerREF Auto +Event OnBardsLoadGame(string eventName, string strArg, float numArg, Form sender) + ; Player just loaded a save with the gramophone playing. The sound is dead by now. + TryStopMusic() +EndEvent -MiscObject Property Gold001 Auto +Event OnCellAttach() + TryStopMusic() +EndEvent -Message Property _00E_Gaboff_GrammophoneMSG Auto +Event OnLoad() + TryStopMusic() +EndEvent + +Event OnCellDetach() + TryStopMusic() +EndEvent + +Event OnUnload() + TryStopMusic() +EndEvent + +State DoneCleanup + Event OnCellAttach() + ; Do nothing + EndEvent + + Event OnLoad() + ; Do nothing + EndEvent + + Event OnCellDetach() + ; Do nothing + EndEvent -Sound Property _00E_MUS_Special_OceansWidowM Auto \ No newline at end of file + Event OnUnload() + ; Do nothing + EndEvent +EndState diff --git a/source/scripts/_00e_game_playerhouse_boardsc.psc b/source/scripts/_00e_game_playerhouse_boardsc.psc index 733ade9e..5297a5c8 100644 --- a/source/scripts/_00e_game_playerhouse_boardsc.psc +++ b/source/scripts/_00e_game_playerhouse_boardsc.psc @@ -104,8 +104,8 @@ function OnActivate(ObjectReference akActionRef) EndIf elseif iButton == 6 - - PlayerhousingMaster.ShowTutorial() + + _00E_PlayerhousingMaster.GetMaster().ShowExpansionBoardTutorial() endIf @@ -184,4 +184,3 @@ Message Property _00E_Game_PlayerHouse_RemoveFurniture Auto _00E_NQ24_Playerhousing_Functions Property NQ24 Auto _00E_PlayerHousing_CellNameSC Property Player Auto -_00E_PlayerhousingTutorial Property PlayerhousingMaster Auto \ No newline at end of file diff --git a/source/scripts/_00e_placeablegrammophonplay.psc b/source/scripts/_00e_placeablegrammophonplay.psc index c28ab841..4a428c87 100644 --- a/source/scripts/_00e_placeablegrammophonplay.psc +++ b/source/scripts/_00e_placeablegrammophonplay.psc @@ -1,63 +1,161 @@ Scriptname _00E_PlaceableGrammophonPlay extends ObjectReference -Sound Property soundToPlay Auto -MusicType Property _00E_SilenceTransitionHighPriority Auto +Sound Property _00E_MUS_Placeable_Koppophon Auto +MusicType Property _00E_SilenceTransitionHighPriority Auto ; OBSOLETE. Left for version update on older saves. +MusicType Property _00E_SilenceKoppophon Auto GlobalVariable Property _00E_AchievementsEnabled Auto Message Property _00E_PlayerhousingKoppophonVolume Auto -bool bDone -float Property soundLengthInSeconds Auto +Actor Property PlayerREF Auto -int playbackId = -1 -float volume = 0.5 -bool bmuted = true +Int playbackId = -1 +Float volume = 0.5 +Bool bDone ; Unlocked END_KOPPOPHON_01 achievement +Bool bMusicLocked = False +Bool bOldSilenceUpdated = False -Event OnCellAttach() - playbackId = -1 - bmuted = true -Endevent +Float Property MUSIC_LENGTH = 87.2 AutoReadOnly -Event OnLoad() - playbackId = -1 - bmuted = true -Endevent -Event OnCellDetach() - _00E_SilenceTransitionHighPriority.Remove() - Sound.StopInstance(playbackId) - playbackId = -1 +;===================================================================================== +; FUNCTIONS +;===================================================================================== + +Function StopMusic() + bMusicLocked = True + + UnregisterForModEvent("BardsLoadGame") UnregisterForUpdate() -Endevent + + If bOldSilenceUpdated == False + bOldSilenceUpdated = True + If playbackId != -1 + _00E_SilenceTransitionHighPriority.Remove() + EndIf + EndIf + + If playbackId != -1 + Sound.StopInstance(playbackId) + playbackId = -1 + EndIf + + _00E_SilenceKoppophon.Remove() + + bMusicLocked = False +EndFunction + +Function TryStopMusic() + If bMusicLocked == False + StopMusic() + Else + RegisterForSingleUpdate(0.5) + EndIf +EndFunction + +Function Cleanup() + GoToState("DoneCleanup") + TryStopMusic() +EndFunction + + +;===================================================================================== +; EVENTS +;===================================================================================== + +Event OnInit() + GoToState("DoneCleanup") +EndEvent Event OnActivate(ObjectReference triggerRef) - if playbackId == -1 - playbackId = soundToPlay.Play(Self) - RegisterForSingleUpdate(soundLengthInSeconds) - If volume == 0 - volume = 0.5 - endif - Sound.setInstanceVolume(playbackId, volume) - _00E_SilenceTransitionHighPriority.Add() - If _00E_AchievementsEnabled.GetValueInt() == 1 && !bDone - bDone = true - Game.UnlockAchievement("END_KOPPOPHON_01") + If triggerRef == PlayerREF && _00E_PlayerhousingMaster.ReferenceCanBeActivated(Self) && bMusicLocked == False + bMusicLocked = True + + If playbackId == -1 ; Start playing + bOldSilenceUpdated = True + RegisterForModEvent("BardsLoadGame", "OnBardsLoadGame") + + _00E_SilenceKoppophon.Add() + + playbackId = _00E_MUS_Placeable_Koppophon.Play(Self) + If volume <= 0.0 || volume > 1.0 + volume = 0.5 + EndIf + Sound.SetInstanceVolume(playbackId, volume) + RegisterForSingleUpdate(_00E_QuestFunctions.AdjustTimePeriodByEngineTimerError(MUSIC_LENGTH)) + + GoToState("") + + _00E_PlayerhousingKoppophonVolume.Show(volume * 100.0) + + If _00E_AchievementsEnabled.GetValueInt() == 1 && (bDone == False) + bDone = True + Game.UnlockAchievement("END_KOPPOPHON_01") + EndIf + + ElseIf bOldSilenceUpdated == False + ; Player just loaded an older save with the Koppophon playing. The sound is dead by now. + StopMusic() + + Else ; Volume control + Float fNewVolume = volume + 0.25 + If fNewVolume > 1.0 + fNewVolume = 0.0 + EndIf + + Sound.SetInstanceVolume(playbackId, fNewVolume) + If fNewVolume == 0.0 ; On mute + _00E_SilenceKoppophon.Remove() + ElseIf volume == 0.0 ; On unmute + _00E_SilenceKoppophon.Add() + EndIf + volume = fNewVolume + + _00E_PlayerhousingKoppophonVolume.Show(volume * 100.0) + EndIf - else - volume = volume + 0.25 - if volume > 1 - volume = 0 - bmuted = false - _00E_SilenceTransitionHighPriority.Remove() - elseif bmuted == false - bmuted = true - _00E_SilenceTransitionHighPriority.Add() - Endif - Sound.SetInstanceVolume(playbackId, volume) - Endif - _00E_PlayerhousingKoppophonVolume.Show(volume*100) -Endevent + + bMusicLocked = False + EndIf +EndEvent Event OnUpdate() - _00E_SilenceTransitionHighPriority.Remove() - Sound.StopInstance(playbackId) - playbackId = -1 -Endevent \ No newline at end of file + TryStopMusic() +EndEvent + +Event OnBardsLoadGame(string eventName, string strArg, float numArg, Form sender) + ; Player just loaded a save with the Koppophon playing. The sound is dead by now. + TryStopMusic() +EndEvent + +Event OnCellAttach() + Cleanup() +EndEvent + +Event OnLoad() + Cleanup() +EndEvent + +Event OnCellDetach() + Cleanup() +EndEvent + +Event OnUnload() + Cleanup() +EndEvent + +State DoneCleanup + Event OnCellAttach() + ; Do nothing + EndEvent + + Event OnLoad() + ; Do nothing + EndEvent + + Event OnCellDetach() + ; Do nothing + EndEvent + + Event OnUnload() + ; Do nothing + EndEvent +EndState diff --git a/source/scripts/_00e_playerhousing_furniture.psc b/source/scripts/_00e_playerhousing_furniture.psc index caa89086..f5717f8f 100644 --- a/source/scripts/_00e_playerhousing_furniture.psc +++ b/source/scripts/_00e_playerhousing_furniture.psc @@ -1,25 +1,48 @@ scriptname _00E_Playerhousing_Furniture extends ObjectReference {A manipulatable housing object while being in the world} -_00E_Playerhousing_FurnitureItem Property furnitureItem auto hidden -{Set by Playerhousing_FurnitureItem when placing this Furniture} - -_00E_Playerhousing_FurnitureItem function getFurnitureItem() - return furnitureItem -Endfunction - -bool function shouldActivateBePossible() - return !((self as ObjectReference) as _00E_Playerhousing_FurnitureItem) ; if the _00E_Playerhousing_FurnitureItem script is on this object, activating means taking -Endfunction - -function finishPlacement() -{this function is called when the furniture object is at the right position and being placed; use e.g. for light} - blockActivation(true) - disable() - enable() +Float Property CustomDistance Auto +{ Custom distance from the player in the placemenet Move Mode } +Float Property OffsetAngleZ Auto +{ Custom offset Z rotation in the placemenet Move Mode } +Float Property OffsetPositionZ Auto +{ Custom offset Z position in the placemenet Move Mode } +Bool Property IsSetPositionIncompatible Auto +{ If the .nif of the object has a bhkCollisionObject with SET_LOCAL flag, SetPosition() or MoveTo() can easily mess this object up in the placement mode. } + +Form Property InventoryItem Auto Hidden + +_00E_Playerhousing_FurnitureItem Property furnitureItem Auto Hidden +{ OBSOLETE. Left for compatibility with older saves. } + +Form Function GetInventoryItem() + If furnitureItem ; Update from the old way of storing the base inventory item + If InventoryItem == None + InventoryItem = furnitureItem.GetBaseObject() + EndIf + furnitureItem = None + EndIf + + Return InventoryItem +EndFunction + +Function finishPlacement() + ; This function is called when the furniture object is at the right position and being placed. + + SetMotionType(Motion_Dynamic, True) + ; in case we place a mannequin, we need to store its position - If self.GetBaseObject() == Game.GetFormFromFile(0x00141028, "Skyrim.esm") - ObjectReference akNPC = self as ObjectReference - (akNPC as _00E_Playerhousing_MannequinControl).setForcePosition(akNPC.GetPositionX(), akNPC.GetPositionY(), akNPC.GetPositionZ(), akNPC.GetAngleX(), akNPC.GetAngleY(), akNPC.GetAngleZ()) + ObjectReference myObjRef = self as ObjectReference + If myObjRef as _00E_Playerhousing_MannequinControl + (myObjRef as _00E_Playerhousing_MannequinControl).FinishPlacement() + Else + BlockActivation(true) + Disable() + Utility.Wait(0.1) + Enable() + + If myObjRef as _00E_Phasmalist_Workbench + (myObjRef as _00E_Phasmalist_Workbench).FinishPlacement() + EndIf EndIf -Endfunction +EndFunction diff --git a/source/scripts/_00e_playerhousing_furnitureitem.psc b/source/scripts/_00e_playerhousing_furnitureitem.psc index 8d5d00af..30ea0540 100644 --- a/source/scripts/_00e_playerhousing_furnitureitem.psc +++ b/source/scripts/_00e_playerhousing_furnitureitem.psc @@ -1,8 +1,8 @@ scriptname _00E_Playerhousing_FurnitureItem extends ObjectReference {A manipulatable housing object while being in the players inventory} -Actorbase Property _MANNEQUIN_toCreate auto -furniture Property _FURNITURE_toCreate auto +ActorBase Property _MANNEQUIN_toCreate auto +Furniture Property _FURNITURE_toCreate auto Container Property _CONTAINER_toCreate auto Light Property _LIGHT_toCreate auto MiscObject Property _MISC_toCreate Auto @@ -11,42 +11,33 @@ Activator Property _ACTIVATOR_toCreate Auto _00E_PlayerhousingMaster Property master Auto Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) - if akNewContainer == none - if master == none - Debug.messagebox("ERROR: PlayerhousingMaster property in Playerhousingfurnitureitem is missing, please write a bugticket") - return - endif - - if master.canPlaceItem() - master.playerItemDropped(Self) - else - master.cannotPlaceObjectHere.show() - Game.getplayer().additem((self ), 1, true) - endif - endif -ENDevent + If akNewContainer == None + If master == None + master = _00E_PlayerhousingMaster.GetMaster() + EndIf + master.playerItemDropped(Self) + EndIf +EndEvent -_00E_Playerhousing_Furniture function placeFurnitureAtMe() +_00E_Playerhousing_Furniture Function placeFurnitureAtMe() _00E_Playerhousing_Furniture result = None - if _MANNEQUIN_toCreate - result = placeAtMe(_MANNEQUIN_toCreate, abForcePersist = true) as _00E_Playerhousing_Furniture - elseif _FURNITURE_toCreate - result = placeAtMe(_FURNITURE_toCreate) as _00E_Playerhousing_Furniture - elseif _CONTAINER_toCreate - result = placeAtMe(_CONTAINER_toCreate) as _00E_Playerhousing_Furniture - elseif _LIGHT_toCreate - result = placeAtMe(_LIGHT_toCreate) as _00E_Playerhousing_Furniture - elseif _ACTIVATOR_toCreate - result = placeAtMe(_ACTIVATOR_toCreate) as _00E_Playerhousing_Furniture - elseif _MISC_toCreate - result = placeAtMe(_MISC_toCreate) as _00E_Playerhousing_Furniture - else - Debug.MessageBox("ERROR: *_toCreate property in playerhousingfurnitureitem is missing, please write a bugticket") - return None - ENDif - if result == None + If _MANNEQUIN_toCreate + result = PlaceAtMe(_MANNEQUIN_toCreate, abForcePersist = True, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture + ElseIf _FURNITURE_toCreate + result = PlaceAtMe(_FURNITURE_toCreate, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture + ElseIf _CONTAINER_toCreate + result = PlaceAtMe(_CONTAINER_toCreate, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture + ElseIf _LIGHT_toCreate + result = PlaceAtMe(_LIGHT_toCreate, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture + ElseIf _ACTIVATOR_toCreate + result = PlaceAtMe(_ACTIVATOR_toCreate, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture + ElseIf _MISC_toCreate + result = PlaceAtMe(_MISC_toCreate, abInitiallyDisabled = True) as _00E_Playerhousing_Furniture + EndIf + + If result == None Debug.MessageBox("ERROR: *_toCreate property in playerhousingfurnitureitem is no furnitureitem, please write a bugticket") - Endif - result.furnitureItem = Self - return result -ENDfunction + EndIf + + Return result +EndFunction \ No newline at end of file diff --git a/source/scripts/_00e_playerhousing_lightfurniture.psc b/source/scripts/_00e_playerhousing_lightfurniture.psc index 09d7ed98..e61375f6 100644 --- a/source/scripts/_00e_playerhousing_lightfurniture.psc +++ b/source/scripts/_00e_playerhousing_lightfurniture.psc @@ -2,7 +2,7 @@ Scriptname _00E_Playerhousing_LightFurniture extends _00E_Playerhousing_Furnitur Light Property LIGHT_toCreate auto {not used due to graphic bugs} -ObjectReference createdLight +; ObjectReference createdLight function finishPlacement() {this function is called when the furniture object is at the right position and being placed; use e.g. for light} @@ -13,9 +13,11 @@ function finishPlacement() ;createdLight.setScale(0.99) Endfunction +;/ Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) if akOldContainer== None createdLight.disable() createdLight.delete() Endif Endevent +/; \ No newline at end of file diff --git a/source/scripts/_00e_playerhousing_mannequincontrol.psc b/source/scripts/_00e_playerhousing_mannequincontrol.psc index f9c4fa7b..8b70a7b1 100644 --- a/source/scripts/_00e_playerhousing_mannequincontrol.psc +++ b/source/scripts/_00e_playerhousing_mannequincontrol.psc @@ -2,292 +2,230 @@ Scriptname _00E_Playerhousing_MannequinControl extends Actor import utility -Form Property ArmorSlot01 auto hidden -Form Property ArmorSlot02 auto hidden -Form Property ArmorSlot03 auto hidden -Form Property ArmorSlot04 auto hidden -Form Property ArmorSlot05 auto hidden -Form Property ArmorSlot06 auto hidden -Form Property ArmorSlot07 auto hidden -Form Property ArmorSlot08 auto hidden -Form Property ArmorSlot09 auto hidden -Form Property ArmorSlot10 auto hidden - -Armor Property ArmorRefresh auto - Actor Property PlayerREF Auto -Form Property EmptySlot auto hidden +Bool bIsInPlacementMode = False +Bool bActivationBlocked = False -MiscObject Property _00E_Placeable_Mannequin Auto -Message Property _00E_MannequinInteractMSG Auto +;===================================================================================== +; EVENTS +;===================================================================================== -;int Property CurrentPose = 1 Auto -{The pose the Mannequin starts in, and is currently in. DEFAULT = 1} +Event OnCellLoad() + If bIsInPlacementMode == False + ResetOnLoad() + EndIf +EndEvent -float forceX -float forceY -float forceZ -float forceAngleX -float forceAngleY -float forceAngleZ +Event OnLoad() + If bIsInPlacementMode + ResetOnLoad() + EndIf +EndEvent -;===================================================================================== -; EVENTS -;===================================================================================== +Event OnActivate(ObjectReference TriggerRef) + If TriggerRef == PlayerREF && _00E_PlayerhousingMaster.ReferenceCanBeActivated(self) && bActivationBlocked == False + bActivationBlocked = True -EVENT OnInit() - - self.BlockActivation() - PrepareForcePosition() - -EndEVENT + ConvertArmorSlots() ; Version update -EVENT OnCellLoad() - - If !(self.IsActivationBlocked()) - self.BlockActivation() + OpenInventory(True) + ResetPosition() + Wait(0.1) + EnableAI(False) + + bActivationBlocked = False EndIf - - PrepareForcePosition() - -EndEVENT +EndEvent -EVENT OnActivate(ObjectReference TriggerRef) - - If self.IsActivationBlocked() - int iButton = _00E_MannequinInteractMSG.Show() - - If iButton == 0 - self.OpenInventory(true) - wait(0.1) - self.EnableAI(false) +Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) + If (akBaseItem as Armor) + If TryRegisterAddedArmor(akBaseItem) + EquipItem(akBaseItem) Else - self.RemoveAllItems(PlayerREF) - Wait(0.5) - PlayerREF.addItem(_00E_Placeable_Mannequin, 1, true) - PlayerREF.DropObject(_00E_Placeable_Mannequin, 1) - self.disable() - self.delete() + ;Turn it back if the mannequin has one of these already, or if all the slots are full. + RemoveItem(akBaseItem, aiItemCount, True, PlayerREF) EndIf + Else + RemoveItem(akBaseItem, aiItemCount, True, PlayerREF) + EndIf +EndEvent + +Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference) + If (akBaseObject as Armor) + UnregisterRemovedArmor(akBaseObject) EndIf +EndEvent -EndEVENT -EVENT OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) - - if (akBaseItem as Armor) - if akBaseItem != ArmorRefresh - AddToArmorSlot(akBaseItem) - self.EquipItem(akBaseItem) - endif - else - self.RemoveItem(akBaseItem, aiItemCount, true, PlayerREF) - endif +;===================================================================================== +; ARMOR SLOTS TRACKING +;===================================================================================== + +Form Property ArmorSlot01 Auto Hidden ; Obsolete. Left for version updates on older saves. +Form Property ArmorSlot02 Auto Hidden ; Obsolete. Left for version updates on older saves. +Form Property ArmorSlot03 Auto Hidden ; Obsolete. Left for version updates on older saves. +Form Property ArmorSlot04 Auto Hidden ; Obsolete. Left for version updates on older saves. +Form Property ArmorSlot05 Auto Hidden ; Obsolete. Left for version updates on older saves. +Form Property ArmorSlot06 Auto Hidden ; Obsolete. Left for version updates on older saves. +Form Property ArmorSlot07 Auto Hidden ; Obsolete. Left for version updates on older saves. +Form Property ArmorSlot08 Auto Hidden ; Obsolete. Left for version updates on older saves. +Form Property ArmorSlot09 Auto Hidden ; Obsolete. Left for version updates on older saves. +Form Property ArmorSlot10 Auto Hidden ; Obsolete. Left for version updates on older saves. + +Form[] ArmorSlots +Bool bConvertedArmorSlots = False + +Function ConvertArmorSlots() + If bConvertedArmorSlots + Return + EndIf + bConvertedArmorSlots = True + + ArmorSlots = New Form[10] + + Int index = _ConvertArmorSlot(0, ArmorSlot01) + index = _ConvertArmorSlot(index, ArmorSlot02) + index = _ConvertArmorSlot(index, ArmorSlot03) + index = _ConvertArmorSlot(index, ArmorSlot04) + index = _ConvertArmorSlot(index, ArmorSlot05) + index = _ConvertArmorSlot(index, ArmorSlot06) + index = _ConvertArmorSlot(index, ArmorSlot07) + index = _ConvertArmorSlot(index, ArmorSlot08) + index = _ConvertArmorSlot(index, ArmorSlot09) + index = _ConvertArmorSlot(index, ArmorSlot10) + + ArmorSlot01 = None + ArmorSlot02 = None + ArmorSlot03 = None + ArmorSlot04 = None + ArmorSlot05 = None + ArmorSlot06 = None + ArmorSlot07 = None + ArmorSlot08 = None + ArmorSlot09 = None + ArmorSlot10 = None +EndFunction + +Int Function _ConvertArmorSlot(Int index, Form armorItem) + If armorItem && ArmorSlots.Find(armorItem) < 0 + ArmorSlots[index] = armorItem + index += 1 + EndIf + + Return index +EndFunction + +Bool Function TryRegisterAddedArmor(Form armorItem) + ; First check to see if this is already in a slot + If ArmorSlots.Find(armorItem) >= 0 + Return False + EndIf + + ; Now find an emtpy slot to put it in, if there is one. + Int i = 0 + While i < ArmorSlots.Length + If ArmorSlots[i] == None + ArmorSlots[i] = armorItem + Return True + EndIf + + i += 1 + EndWhile -endEVENT + ; Nope. No room left. + Return False +EndFunction + +Function UnregisterRemovedArmor(Form armorItem) + ;This loop will also clear duplicates that might have been generated. + Int i = 0 + While i < ArmorSlots.Length + If ArmorSlots[i] == armorItem + ArmorSlots[i] = None + EndIf + i += 1 + EndWhile +EndFunction + +Function ReequipAllArmor() + UnequipAll() + + Int i = 0 + While i < ArmorSlots.Length + If ArmorSlots[i] + EquipItem(ArmorSlots[i]) + EndIf + i += 1 + EndWhile +EndFunction -EVENT OnObjectUnequipped(Form akBaseObject, ObjectReference akReference) - if (akBaseObject as Armor) - RemoveFromArmorSlot(akBaseObject) - endif -endEVENT ;===================================================================================== -; FUNCTIONS +; FUNCTIONS ;===================================================================================== -function PrepareForcePosition() +Float forceX +Float forceY +Float forceZ +Float forceAngleX +Float forceAngleY +Float forceAngleZ - wait(0.25) - self.BlockActivation(true) - ForcePosition() +Bool bPosisionValidated = False -Endfunction +Function ResetPosition() + If bPosisionValidated == False + bPosisionValidated = True -function ForcePosition() + If forceX == 0 && forceY == 0 && forceZ == 0 + Float fAngleZ = PlayerREF.GetAngleZ() + Float fDistanceFromPlayer = 100.0 - self.Enable() - self.EnableAI(false) - - If forceX == 0 && forceY == 0 && forceZ == 0 - forceX = PlayerREF.GetPositionX() - forceY = PlayerREF.GetPositionY() - forceZ = PlayerREF.GetPositionZ() + forceX = PlayerREF.GetPositionX() + fDistanceFromPlayer * Math.sin(fAngleZ) + forceY = PlayerREF.GetPositionY() + fDistanceFromPlayer * Math.cos(fAngleZ) + forceZ = PlayerREF.GetPositionZ() + EndIf EndIf - - wait(0.1) - self.setPosition(forceX, forceY, forceZ) - self.setAngle(forceAngleX,forceAngleY,forceAngleZ) - - self.additem(ArmorRefresh, 1) - self.removeitem(ArmorRefresh, 1) - - EquipCurrentArmor() - -ENDfunction - -function setForcePosition(float x, float y, float z, float angleX, float angleY, float angleZ) - forceX = x - forceY = y - forceZ = z - forceAngleX = angleX - forceAngleY = angleY - forceAngleZ = angleZ -Endfunction - -Function EquipCurrentArmor() - if (ArmorSlot01 != EmptySlot) - self.EquipItem(ArmorSlot01) - endif - if (ArmorSlot02 != EmptySlot) - self.EquipItem(ArmorSlot02) - endif - if (ArmorSlot03 != EmptySlot) - self.EquipItem(ArmorSlot03) - endif - if (ArmorSlot04 != EmptySlot) - self.EquipItem(ArmorSlot04) - endif - if (ArmorSlot05 != EmptySlot) - self.EquipItem(ArmorSlot05) - endif - if (ArmorSlot06 != EmptySlot) - self.EquipItem(ArmorSlot06) - endif - if (ArmorSlot07 != EmptySlot) - self.EquipItem(ArmorSlot07) - endif - if (ArmorSlot08 != EmptySlot) - self.EquipItem(ArmorSlot08) - endif - if (ArmorSlot09 != EmptySlot) - self.EquipItem(ArmorSlot09) - endif - if (ArmorSlot10 != EmptySlot) - self.EquipItem(ArmorSlot10) - endif -endFunction - -Function AddToArmorSlot(Form akBaseItem) - bool FoundEmptySlot = FALSE - - if (ArmorSlot01 == EmptySlot) && (FoundEmptySlot == FALSE) - ArmorSlot01 = akBaseItem - FoundEmptySlot = TRUE - endif - - if (ArmorSlot02 == EmptySlot) && (FoundEmptySlot == FALSE) - ArmorSlot02 = akBaseItem - FoundEmptySlot = TRUE - endif - - if (ArmorSlot03 == EmptySlot) && (FoundEmptySlot == FALSE) - ArmorSlot03 = akBaseItem - FoundEmptySlot = TRUE - endif - - if (ArmorSlot04 == EmptySlot) && (FoundEmptySlot == FALSE) - ArmorSlot04 = akBaseItem - FoundEmptySlot = TRUE - endif - - if (ArmorSlot05 == EmptySlot) && (FoundEmptySlot == FALSE) - ArmorSlot05 = akBaseItem - FoundEmptySlot = TRUE - endif - - if (ArmorSlot06 == EmptySlot) && (FoundEmptySlot == FALSE) - ArmorSlot06 = akBaseItem - FoundEmptySlot = TRUE - endif - - if (ArmorSlot07 == EmptySlot) && (FoundEmptySlot == FALSE) - ArmorSlot07 = akBaseItem - FoundEmptySlot = TRUE - endif - - if (ArmorSlot08 == EmptySlot) && (FoundEmptySlot == FALSE) - ArmorSlot08 = akBaseItem - FoundEmptySlot = TRUE - endif - - if (ArmorSlot09 == EmptySlot) && (FoundEmptySlot == FALSE) - ArmorSlot09 = akBaseItem - FoundEmptySlot = TRUE - endif - - if (ArmorSlot10 == EmptySlot) && (FoundEmptySlot == FALSE) - ArmorSlot10 = akBaseItem - FoundEmptySlot = TRUE - endif - FoundEmptySlot = FALSE -endFunction -Function RemoveFromArmorSlot(Form akBaseItem) - ;Trace("DARYL - " + self + " Running the RemoveFromArmorSlot Function") + SetPosition(forceX, forceY, forceZ) + SetAngle(forceAngleX, forceAngleY, forceAngleZ) +EndFunction - bool FoundMatchingSlot = FALSE - - if (ArmorSlot01 == akBaseItem) && (FoundMatchingSlot == FALSE) - ;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 01") - ArmorSlot01 = EmptySlot - FoundMatchingSlot = TRUE - endif - - if (ArmorSlot02 == akBaseItem) && (FoundMatchingSlot == FALSE) - ;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 02") - ArmorSlot02 = EmptySlot - FoundMatchingSlot = TRUE - endif - - if (ArmorSlot03 == akBaseItem) && (FoundMatchingSlot == FALSE) - ;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 03") - ArmorSlot03 = EmptySlot - FoundMatchingSlot = TRUE - endif - - if (ArmorSlot04 == akBaseItem) && (FoundMatchingSlot == FALSE) - ;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 04") - ArmorSlot04 = EmptySlot - FoundMatchingSlot = TRUE - endif - - if (ArmorSlot05 == akBaseItem) && (FoundMatchingSlot == FALSE) - ;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 05") - ArmorSlot05 = EmptySlot - FoundMatchingSlot = TRUE - endif - - if (ArmorSlot06 == akBaseItem) && (FoundMatchingSlot == FALSE) - ;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 06") - ArmorSlot06 = EmptySlot - FoundMatchingSlot = TRUE - endif - - if (ArmorSlot07 == akBaseItem) && (FoundMatchingSlot == FALSE) - ;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 07") - ArmorSlot07 = EmptySlot - FoundMatchingSlot = TRUE - endif - - if (ArmorSlot08 == akBaseItem) && (FoundMatchingSlot == FALSE) - ;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 08") - ArmorSlot08 = EmptySlot - FoundMatchingSlot = TRUE - endif - - if (ArmorSlot09 == akBaseItem) && (FoundMatchingSlot == FALSE) - ;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 09") - ArmorSlot09 = EmptySlot - FoundMatchingSlot = TRUE - endif - - if (ArmorSlot10 == akBaseItem) && (FoundMatchingSlot == FALSE) - ;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 10") - ArmorSlot10 = EmptySlot - FoundMatchingSlot = TRUE - endif - -endFunction +Function ResetOnLoad() + ConvertArmorSlots() ; Version update + + BlockActivation() + + EnableAI(True) + If bIsInPlacementMode == False + ResetPosition() + EndIf + ReequipAllArmor() + EnableAI(False) +EndFunction + +Function StartPlacement() + bIsInPlacementMode = True +EndFunction + +Function FinishPlacement() + bIsInPlacementMode = False + + Disable() + + forceX = GetPositionX() + forceY = GetPositionY() + forceZ = GetPositionZ() + forceAngleX = GetAngleX() + forceAngleY = GetAngleY() + forceAngleZ = GetAngleZ() + + bPosisionValidated = True + + Enable() + + _00E_QuestFunctions.WaitForReferenceToLoad(self) + ResetOnLoad() +EndFunction diff --git a/source/scripts/_00e_playerhousingcurrentomanipulate.psc b/source/scripts/_00e_playerhousingcurrentomanipulate.psc index 49572393..ff095ced 100644 --- a/source/scripts/_00e_playerhousingcurrentomanipulate.psc +++ b/source/scripts/_00e_playerhousingcurrentomanipulate.psc @@ -1,31 +1,336 @@ Scriptname _00E_PlayerhousingCurrentOManipulate extends ReferenceAlias -float deltaTranslationZ = 0.0 -float deltaRotation = 0.0 - -;translations needs to be extracted from the rest of the code due to performance reasons (don't know why exactely, but defining new functions slows this down dramatically) -;the registerForControl / unregisterForControl are called in _00E_PlayerhousingMaster - -Event onControlDown(String control) - getRef().stopTranslation() - if control == "Forward" - deltaTranslationZ = 100 - elseif control == "Back" - deltaTranslationZ = -100 - elseif control == "strafe left" - deltaRotation = 100 - elseif control == "strafe right" - deltaRotation = -100 - Endif - getRef().translateTo(getRef().getPositionX(), getRef().getPositionY(), getRef().getPositionZ() + deltaTranslationZ, getRef().getAngleX(), getRef().getAngleY(), getRef().getAngleZ() + deltaRotation, 100, 100) -Endevent - -Event onControlUp(String control, float holdTime) - getRef().stopTranslation() - if control == "Forward" || control == "Back" - deltaTranslationZ = 0 - elseif control == "strafe left" || control == "strafe right" - deltaRotation = 0 - Endif - getRef().translateTo(getRef().getPositionX(), getRef().getPositionY(), getRef().getPositionZ() + deltaTranslationZ, getRef().getAngleX(), getRef().getAngleY(), getRef().getAngleZ() + deltaRotation, 100, 100) -Endevent +EffectShader Property _00E_PlayerHousingManipulationShader Auto +Sound Property UIMenuPrevNext Auto +Actor Property PlayerRef Auto + +String Property CONTROL_TURN_LEFT = "Strafe Left" AutoReadOnly +String Property CONTROL_TURN_RIGHT = "Strafe Right" AutoReadOnly +String Property CONTROL_MOVE_UP = "Forward" AutoReadOnly +String Property CONTROL_MOVE_DOWN = "Back" AutoReadOnly + +Int Property TRANSLATION_TURN_LEFT = 0 AutoReadOnly +Int Property TRANSLATION_TURN_RIGHT = 1 AutoReadOnly +Int Property TRANSLATION_MOVE_UP = 2 AutoReadOnly +Int Property TRANSLATION_MOVE_DOWN = 3 AutoReadOnly + +Int Property STATE_IDLE = 0 AutoReadOnly +Int Property STATE_UPDATING = 1 AutoReadOnly +Int Property STATE_WORKING = 2 AutoReadOnly + +Float Property ROTATION_SPEED_START = 15.0 AutoReadOnly +Float Property ROTATION_SPEED_FALLBACK = 20.0 AutoReadOnly +Float Property ROTATION_SPEED_MAX = 180.0 AutoReadOnly +Float Property ROTATION_SPEED_CHANGE_MOD = 0.25 AutoReadOnly +Float Property ROTATION_MAX = 90.0 AutoReadOnly + +Float Property MOVEMENT_SPEED_START = 10.0 AutoReadOnly +Float Property MOVEMENT_SPEED_FALLBACK = 20.0 AutoReadOnly +Float Property MOVEMENT_SPEED_MAX = 200.0 AutoReadOnly +Float Property MOVEMENT_SPEED_CHANGE_MOD = 0.25 AutoReadOnly +Float Property MOVEMENT_MAX = 100.0 AutoReadOnly + +Float Property FAST_TRANSLATION_SPEED = 1000000.0 AutoReadOnly + +Float fObjectPosX +Float fObjectPosY +Float fObjectPosZ +Float fObjectAngleX +Float fObjectAngleY +Float fObjectAngleZ +Float fPlayerPosZ +Float fTablePosZ + +Float fTranslationSpeed +Float fTranslationSpeedIncrease + +Int iWorkingState +Int iCurrentTranslation +Bool bGamepadMode +Int iWatchedKeyCode +Int iTurnLeftKey +Int iTurnRightKey +Int iMoveUpKey +Int iMoveDownKey + +Function Setup(ObjectReference curObjectRef) + ForceRefTo(curObjectRef) + + iWorkingState = STATE_IDLE + + bGamepadMode = Game.UsingGamepad() + If bGamepadMode == False + iTurnLeftKey = Input.GetMappedKey(CONTROL_TURN_LEFT, 0) + iTurnRightKey = Input.GetMappedKey(CONTROL_TURN_RIGHT, 0) + iMoveUpKey = Input.GetMappedKey(CONTROL_MOVE_UP, 0) + iMoveDownKey = Input.GetMappedKey(CONTROL_MOVE_DOWN, 0) + Else + iTurnLeftKey = 274 + iTurnRightKey = 275 + iMoveUpKey = 280 + iMoveDownKey = 281 + EndIf + + If PlayerRef == None ; Just in case + PlayerRef = Game.GetPlayer() + EndIf + + fPlayerPosZ = PlayerRef.GetPositionZ() + fTablePosZ = fPlayerPosZ + 64.0 + + GoToState("Working") + + TryRegisterForKey(iTurnLeftKey, CONTROL_TURN_LEFT) + TryRegisterForKey(iTurnRightKey, CONTROL_TURN_RIGHT) + TryRegisterForKey(iMoveUpKey, CONTROL_MOVE_UP) + TryRegisterForKey(iMoveDownKey, CONTROL_MOVE_DOWN) + + _00E_PlayerHousingManipulationShader.Play(curObjectRef) +EndFunction + +Function TryRegisterForKey(Int iKeyCode, String control) + If iKeyCode > 0 + RegisterForKey(iKeyCode) + Else + RegisterForControl(control) + EndIf +EndFunction + +Function Shutdown(Bool bRegisterNewOffsets) + GoToState("") + UnregisterForAllKeys() + UnregisterForAllControls() + UnregisterForUpdate() + + ObjectReference myRef = GetRef() + If myRef != None + _00E_PlayerHousingManipulationShader.Stop(myRef) + + While iWorkingState != STATE_IDLE && iWorkingState != STATE_WORKING + Utility.WaitMenuMode(0.05) + EndWhile + If iWorkingState == STATE_WORKING + myRef.StopTranslation() + EndIf + + If bRegisterNewOffsets + Float fNewOffsetAngleZ = myRef.GetAngleZ() - PlayerRef.GetAngleZ() + Float fNewOffsetPosZ = myRef.GetPositionZ() - PlayerRef.GetPositionZ() + (GetOwningQuest() as _00E_PlayerhousingMaster).RegisterNewHousingObjectOffsets(fNewOffsetAngleZ, fNewOffsetPosZ) + EndIf + + Clear() + EndIf +EndFunction + +State Working + Event OnKeyDown(Int iKeyCode) + TryStartTranslation(KeyCodeToTranslationMode(iKeyCode), iKeyCode) + EndEvent + + Event OnKeyUp(Int iKeyCode, Float fHoldTime) + TryStopTranslation(KeyCodeToTranslationMode(iKeyCode)) + EndEvent + + Event OnControlDown(String control) + TryStartTranslation(ControlToTranslationMode(control), 0) + EndEvent + + Event OnControlUp(String control, Float fHoldTime) + TryStopTranslation(ControlToTranslationMode(control)) + EndEvent + + Event OnUpdate() + ; OnControlUp is not always properly triggered. Maybe OnKeyUp too. The code below is a workaround for that. + ; For gamepads this failsafe is useless because Input.IsKeyPressed always returns False for controller buttons. + If iWatchedKeyCode > 0 && iWorkingState == STATE_WORKING + If Input.IsKeyPressed(iWatchedKeyCode) + RegisterForSingleUpdate(0.05) + Else + TryStopTranslation(iCurrentTranslation) + EndIf + EndIf + EndEvent + + Event OnTranslationComplete() + ; The previously started translation reached its end point + + If iWorkingState != STATE_WORKING + Return + EndIf + iWorkingState = STATE_UPDATING + + ObjectReference myRef = GetRef() + + If iWatchedKeyCode <= 0 || fTranslationSpeedIncrease < 0.0 + ; Do nothing + ElseIf iCurrentTranslation == TRANSLATION_TURN_LEFT || iCurrentTranslation == TRANSLATION_TURN_RIGHT + Float fRotationAngle = GetNextTranslationStep(ROTATION_SPEED_MAX, ROTATION_SPEED_CHANGE_MOD, ROTATION_MAX) + fObjectAngleZ = myRef.GetAngleZ() + TurnTranslate(myRef, fRotationAngle) + + iWorkingState = STATE_WORKING + Return + ElseIf iCurrentTranslation == TRANSLATION_MOVE_UP || iCurrentTranslation == TRANSLATION_MOVE_DOWN + Float fMoveZ = GetNextTranslationStep(MOVEMENT_SPEED_MAX, MOVEMENT_SPEED_CHANGE_MOD, MOVEMENT_MAX) + fObjectPosZ = myRef.GetPositionZ() + MoveTranslate(myRef, fMoveZ) + + iWorkingState = STATE_WORKING + Return + EndIf + + ; Fallback + FinalizeTranslation(myRef) + UIMenuPrevNext.Play(PlayerRef) + + iWorkingState = STATE_IDLE + EndEvent +EndState + +Int Function KeyCodeToTranslationMode(Int iKeyCode) + If iKeyCode > 0 + If iKeyCode == iTurnLeftKey + Return TRANSLATION_TURN_LEFT + ElseIf iKeyCode == iTurnRightKey + Return TRANSLATION_TURN_RIGHT + ElseIf iKeyCode == iMoveUpKey + Return TRANSLATION_MOVE_UP + ElseIf iKeyCode == iMoveDownKey + Return TRANSLATION_MOVE_DOWN + EndIf + EndIf + + Return -1 +EndFunction + +Int Function ControlToTranslationMode(String control) + If control == CONTROL_TURN_LEFT + Return TRANSLATION_TURN_LEFT + ElseIf control == CONTROL_TURN_RIGHT + Return TRANSLATION_TURN_RIGHT + ElseIf control == CONTROL_MOVE_UP + Return TRANSLATION_MOVE_UP + ElseIf control == CONTROL_MOVE_DOWN + Return TRANSLATION_MOVE_DOWN + EndIf + + Return -1 +EndFunction + +Function TryStartTranslation(Int iTranslationMode, Int iTriggerKeyCode) + If iTranslationMode < 0 || iWorkingState != STATE_IDLE + Return + EndIf + + iWorkingState = STATE_UPDATING + iCurrentTranslation = iTranslationMode + iWatchedKeyCode = iTriggerKeyCode + + ObjectReference myRef = GetRef() + + fObjectPosX = myRef.GetPositionX() + fObjectPosY = myRef.GetPositionY() + fObjectPosZ = myRef.GetPositionZ() + + fObjectAngleX = myRef.GetAngleX() + fObjectAngleY = myRef.GetAngleY() + fObjectAngleZ = myRef.GetAngleZ() + + fTranslationSpeedIncrease = 0.0 + + If iCurrentTranslation == TRANSLATION_TURN_LEFT || iCurrentTranslation == TRANSLATION_TURN_RIGHT + If iWatchedKeyCode > 0 + fTranslationSpeed = ROTATION_SPEED_START + TurnTranslate(myRef, fTranslationSpeed * ROTATION_SPEED_CHANGE_MOD) + Else + fTranslationSpeed = ROTATION_SPEED_FALLBACK + TurnTranslate(myRef, ROTATION_MAX) + EndIf + ElseIf iCurrentTranslation == TRANSLATION_MOVE_UP || iCurrentTranslation == TRANSLATION_MOVE_DOWN + If iWatchedKeyCode > 0 + fTranslationSpeed = MOVEMENT_SPEED_START + MoveTranslate(myRef, fTranslationSpeed * MOVEMENT_SPEED_CHANGE_MOD) + Else + fTranslationSpeed = MOVEMENT_SPEED_FALLBACK + MoveTranslate(myRef, MOVEMENT_MAX) + EndIf + EndIf + + If iWatchedKeyCode > 0 && bGamepadMode == False + RegisterForSingleUpdate(0.05) + EndIf + + iWorkingState = STATE_WORKING +EndFunction + +Function TryStopTranslation(Int iTranslationMode) + If iCurrentTranslation != iTranslationMode || iWorkingState != STATE_WORKING + Return + EndIf + + iWorkingState = STATE_UPDATING + + ObjectReference myRef = GetRef() + myRef.StopTranslation() + UnregisterForUpdate() + FinalizeTranslation(myRef) + + iWorkingState = STATE_IDLE +EndFunction + +Function TurnTranslate(ObjectReference myRef, Float fRotationAngle) + If iCurrentTranslation == TRANSLATION_TURN_LEFT + fObjectAngleZ -= fRotationAngle + Else + fObjectAngleZ += fRotationAngle + EndIf + myRef.TranslateTo(fObjectPosX, fObjectPosY, fObjectPosZ, fObjectAngleX, fObjectAngleY, fObjectAngleZ, FAST_TRANSLATION_SPEED, fTranslationSpeed) +EndFunction + +Function MoveTranslate(ObjectReference myRef, Float fMoveZ) + If iCurrentTranslation == TRANSLATION_MOVE_DOWN + Float fNewZ = fObjectPosZ - fMoveZ + If fObjectPosZ > fTablePosZ && fNewZ < fTablePosZ + ; A primitive "drop on the table" + fNewZ = fTablePosZ + fTranslationSpeedIncrease = -1.0 ; Stop on reaching fPlayerPosZ. + ElseIf fObjectPosZ > fPlayerPosZ && fNewZ < fPlayerPosZ + ; A primitive "drop on the floor" + fNewZ = fPlayerPosZ + fTranslationSpeedIncrease = -1.0 ; Stop on reaching fPlayerPosZ. + EndIf + fObjectPosZ = fNewZ + Else + fObjectPosZ += fMoveZ + EndIf + myRef.TranslateTo(fObjectPosX, fObjectPosY, fObjectPosZ, fObjectAngleX, fObjectAngleY, fObjectAngleZ, fTranslationSpeed, FAST_TRANSLATION_SPEED) +EndFunction + +Float Function GetNextTranslationStep(Float fSpeedMax, Float fSpeedChangeMod, Float fChangeMax) + If fTranslationSpeed < fSpeedMax + If fTranslationSpeedIncrease < 20.0 + fTranslationSpeedIncrease += 5.0 + EndIf + fTranslationSpeed += fTranslationSpeedIncrease + If fTranslationSpeed > fSpeedMax + fTranslationSpeed = fSpeedMax + EndIf + EndIf + Float fResult = fTranslationSpeed * fSpeedChangeMod + If fTranslationSpeed >= fSpeedMax || fResult > fChangeMax + Return fChangeMax + Else + Return fResult + EndIf +EndFunction + +Function FinalizeTranslation(ObjectReference myRef) + ; TranslateTo below prevents the object from twitching and becoming blurry when a translation ends + If iCurrentTranslation == TRANSLATION_TURN_LEFT || iCurrentTranslation == TRANSLATION_TURN_RIGHT + fObjectAngleZ = myRef.GetAngleZ() + ElseIf iCurrentTranslation == TRANSLATION_MOVE_UP || iCurrentTranslation == TRANSLATION_MOVE_DOWN + fObjectPosZ = myRef.GetPositionZ() + EndIf + myRef.TranslateTo(fObjectPosX, fObjectPosY, fObjectPosZ, fObjectAngleX, fObjectAngleY, fObjectAngleZ, FAST_TRANSLATION_SPEED, FAST_TRANSLATION_SPEED) +EndFunction diff --git a/source/scripts/_00e_playerhousingcurrentotranslation.psc b/source/scripts/_00e_playerhousingcurrentotranslation.psc index ef0e1554..45bac641 100644 --- a/source/scripts/_00e_playerhousingcurrentotranslation.psc +++ b/source/scripts/_00e_playerhousingcurrentotranslation.psc @@ -1,12 +1,117 @@ Scriptname _00E_PlayerhousingCurrentOTranslation extends ReferenceAlias -GlobalVariable Property continueTranslateToPlayerLoop Auto +EffectShader Property _00E_PlayerHousingTranslationShader Auto +Actor Property PlayerRef Auto -Event onLoad() - ;loop needs to be extracted from the rest of the code due to performance reasons (don't know why exactely, but defining new functions slows this down dramatically) - Actor player = Game.getPlayer() - while continueTranslateToPlayerLoop.getValue() - getRef().TranslateTo(player.getPositionX() + 100 * Math.sin(player.getAngleZ()), player.getPositionY() + 100 * Math.cos(player.getAngleZ()), player.getPositionZ(), 0, 0, player.getAngleZ(), 5000) - Endwhile -Endevent +Bool bIsWorking = False +Bool bIsWarmingUp = False +Float fDistance +Float fOffsetAngleZ +Float fOffsetPosZ + +Float Property ORBIT_ANGULAR_SPEED_CAP = 30.0 AutoReadOnly +Float Property FAST_TRANSLATION_SPEED = 1000000.0 AutoReadOnly + + +Function Setup(_00E_Playerhousing_Furniture furnitureRef, Bool bEnteringPlacement, Float fStoredOffsetAngleZ, Float fStoredOffsetPositionZ) + bIsWarmingUp = True + furnitureRef.Disable() + + If PlayerRef == None + PlayerRef = Game.GetPlayer() + EndIf + + fDistance = furnitureRef.CustomDistance + If fDistance <= 0.0 + fDistance = 100.0 + EndIf + + If bEnteringPlacement + fOffsetAngleZ = furnitureRef.OffsetAngleZ + fOffsetPosZ = furnitureRef.OffsetPositionZ + + If furnitureRef.IsSetPositionIncompatible == False + Float x = PlayerRef.GetPositionX() + Float y = PlayerRef.GetPositionY() + Float z = PlayerRef.GetPositionZ() + Float fAngleZ = PlayerRef.GetAngleZ() + + furnitureRef.SetPosition(x + fDistance * Math.sin(fAngleZ), y + fDistance * Math.cos(fAngleZ), z + fOffsetPosZ) + furnitureRef.SetAngle(0, 0, fAngleZ + fOffsetAngleZ) + EndIf + + ObjectReference myRef = furnitureRef as ObjectReference + If (myRef as _00E_Playerhousing_MannequinControl) + (myRef as _00E_Playerhousing_MannequinControl).StartPlacement() + ElseIf (myRef as _00E_Phasmalist_Workbench) + (myRef as _00E_Phasmalist_Workbench).StartPlacement() + EndIf + Else + fOffsetAngleZ = fStoredOffsetAngleZ + fOffsetPosZ = fStoredOffsetPositionZ + EndIf + + ForceRefTo(furnitureRef) + bIsWorking = True + furnitureRef.Enable() +EndFunction + +Function Shutdown() + bIsWorking = False + + ObjectReference myRef = GetRef() + If myRef + While bIsWarmingUp && (PlayerRef.GetParentCell() == myRef.GetParentCell()) + Utility.WaitMenuMode(0.05) + EndWhile + myRef.StopTranslation() + _00E_PlayerHousingTranslationShader.Stop(myRef) + Clear() + EndIf +EndFunction + +Event OnLoad() + ; Loop needs to be extracted from the rest of the code due to performance reasons (don't know why exactly, but defining new functions slows this down dramatically) + ObjectReference myRef = GetRef() + Float fPrevAngleZ = -1.0 + + myRef.SetMotionType(4) ; Set motion type to Motion_Keyframed. This would fix "collision phantoms" of the object while the player is moving around "dragging" it. + _00E_PlayerHousingTranslationShader.Play(myRef) + + bIsWarmingUp = False + + While bIsWorking + Float x = PlayerRef.GetPositionX() + Float y = PlayerRef.GetPositionY() + Float z = PlayerRef.GetPositionZ() + Float fAngleZ = PlayerRef.GetAngleZ() + + ; Cap the angular speed of the object's orbiting around the player at ORBIT_ANGULAR_SPEED_CAP. + ; This fixes some objects pushing the player (because they pass THROUGH the player?) on sharp camera turns. + If fPrevAngleZ >= 0.0 + Float fDelta = fAngleZ - fPrevAngleZ + If fDelta < -180.0 + fDelta += 360.0 + ElseIf fDelta > 180.0 + fDelta -= 360.0 + EndIf + If fDelta < -ORBIT_ANGULAR_SPEED_CAP + fAngleZ = fPrevAngleZ - ORBIT_ANGULAR_SPEED_CAP + If fAngleZ < 0.0 + fAngleZ += 360.0 + EndIf + ElseIf fDelta > ORBIT_ANGULAR_SPEED_CAP + fAngleZ = fPrevAngleZ + ORBIT_ANGULAR_SPEED_CAP + If fAngleZ >= 360.0 + fAngleZ -= 360.0 + EndIf + EndIf + EndIf + + If bIsWorking + myRef.TranslateTo(x + fDistance * Math.sin(fAngleZ), y + fDistance * Math.cos(fAngleZ), z + fOffsetPosZ, 0, 0, fAngleZ + fOffsetAngleZ, FAST_TRANSLATION_SPEED, FAST_TRANSLATION_SPEED) + EndIf + fPrevAngleZ = fAngleZ + EndWhile +EndEvent diff --git a/source/scripts/_00e_playerhousingmaster.psc b/source/scripts/_00e_playerhousingmaster.psc index f4869efa..bff27002 100644 --- a/source/scripts/_00e_playerhousingmaster.psc +++ b/source/scripts/_00e_playerhousingmaster.psc @@ -1,246 +1,554 @@ scriptname _00E_PlayerhousingMaster extends Quest -EffectShader Property shaderActive Auto -{Shader that is applied while the object is being manipulated} Actor Property player Auto -GlobalVariable Property continueTranslateToPlayerLoop Auto -{Controls the translateTo player loop while being in Translation mode. This variable is used to communicate with _00E_PlayerhousingCurrentOTranslation} ReferenceAlias Property currentHousingObjectInTranslation Auto ReferenceAlias Property currentHousingObjectInManipulation Auto -Message Property cannotPlaceObjectHere auto +Message Property _00E_Playerhousing_CannotPlaceObjectsHere Auto +Message Property _00E_Playerhousing_ContainerContentMove Auto +Message Property _00E_Playerhousing_StartTutorial Auto +Message Property _00E_Playerhousing_ExpansionBoardTutorial Auto +Message Property _00E_Playerhousing_TranslationMode Auto +Message Property _00E_Playerhousing_TranslationModeTutorial Auto +Message Property _00E_Playerhousing_TranslationModeTutorial_Gamepad Auto +Message Property _00E_Playerhousing_ManipulationMode Auto +Message Property _00E_Playerhousing_ManipulationModeTutorial Auto +Message Property _00E_Playerhousing_ManipulationModeTutorial_Gamepad Auto +Sound Property UIMenuActive Auto +GlobalVariable Property _00E_Meditate_Allowed Auto +GlobalVariable Property _00E_Phasmalist_TankMode Auto +GlobalVariable Property _00E_DisableCraftingTutorials Auto _00E_Playerhousing_Furniture currentHousingObject -float timeToHoldActivateToFinish = 2.0 -Event onBeginState() - currentHousingObject = None ; prevent persistence +Bool bIsInPlacementMode = False +Bool bDisableNormalActivation = False +Bool bGamepadMode = False +Bool bDroppedFromInventory = False +Int iPickupKey + +Float fStoredOffsetAngleZ +Float fStoredOffsetPositionZ + +String Property CONTROL_ACTIVATE = "Activate" AutoReadOnly +String Property CONTROL_SHEATH = "Ready Weapon" AutoReadOnly + + +;===================================================================================== +; GLOBAL FUNCTIONS +;===================================================================================== + +_00E_PlayerhousingMaster Function GetMaster() Global + Return Game.GetFormFromFile(0x00043270, "Skyrim.esm") as _00E_PlayerhousingMaster +EndFunction + +Bool Function ReferenceCanBeActivated(ObjectReference ref) Global + If (ref as _00E_Playerhousing_Furniture) + _00E_PlayerhousingMaster master = GetMaster() + If master + Return master.IsNormalActivationEnabled() + EndIf + EndIf + + Return True +EndFunction + + +;===================================================================================== +; TUTORIALS +;===================================================================================== + +Bool bStartTutorialShown = False + +Bool bHideTranslationTutorial = False +Bool bHideTranslationTutorial_Gamepad = False +Bool bHideManipulationTutorial = False +Bool bHideManipulationTutorial_Gamepad = False + +Function ShowStartBuildModeTutorial() + If _00E_DisableCraftingTutorials.GetValueInt() == 0 && bStartTutorialShown == False + bStartTutorialShown = True + _00E_Playerhousing_StartTutorial.Show() + EndIf +EndFunction + +Function ShowExpansionBoardTutorial() + ; Called from _00E_Game_Playerhouse_BoardSC + If _00E_Playerhousing_ExpansionBoardTutorial.Show() == 1 + bHideTranslationTutorial = False + bHideTranslationTutorial_Gamepad = False + bHideManipulationTutorial = False + bHideManipulationTutorial_Gamepad = False + EndIf +EndFunction + +Bool Function _ShowPlacementModeTutorial(Message msgTutorial, Bool bHideFlag) + If bHideFlag == False + Return (msgTutorial.Show() == 1) + Else + Return bHideFlag + EndIf +EndFunction + +Function ShowTranslationModeTutorial() + If bGamepadMode + bHideTranslationTutorial_Gamepad = _ShowPlacementModeTutorial(_00E_Playerhousing_TranslationModeTutorial_Gamepad, bHideTranslationTutorial_Gamepad) + Else + bHideTranslationTutorial = _ShowPlacementModeTutorial(_00E_Playerhousing_TranslationModeTutorial, bHideTranslationTutorial) + EndIf +EndFunction + +Function ShowManipulationModeTutorial() + If bGamepadMode + bHideManipulationTutorial_Gamepad = _ShowPlacementModeTutorial(_00E_Playerhousing_ManipulationModeTutorial_Gamepad, bHideManipulationTutorial_Gamepad) + Else + bHideManipulationTutorial = _ShowPlacementModeTutorial(_00E_Playerhousing_ManipulationModeTutorial, bHideManipulationTutorial) + EndIf +EndFunction + + +;===================================================================================== +; SERVICE FUNCTIONS +;===================================================================================== + +Bool Function CanEnterPlacementMode() + Return (_00E_Meditate_Allowed.GetValue() != 0.0 && _00E_Phasmalist_TankMode.GetValue() == 0.0) +EndFunction + +Float fPlacementModeCarryWeightMod = 0.0 + +Function EnterPlacementMode() + If bIsInPlacementMode == False + bIsInPlacementMode = True + _00E_Meditate_Allowed.SetValueInt(0) + Game.SetInChargen(true, true, false) ; Forbid saving the game while placing stuff + + ; Make the player over encumbered to prevent them from the default running and in general to slow them down + fPlacementModeCarryWeightMod = Player.GetAV("CarryWeight") * 2.0 + If fPlacementModeCarryWeightMod < 1000.0 + fPlacementModeCarryWeightMod = 1000.0 + EndIf + Player.ModAV("CarryWeight", -fPlacementModeCarryWeightMod) + + bGamepadMode = Game.UsingGamepad() + If bGamepadMode == False + iPickupKey = Input.GetMappedKey(CONTROL_SHEATH, 0) + Else + iPickupKey = 277 + EndIf + EndIf +EndFunction + +Function ExitPlacementMode() + If bIsInPlacementMode + bIsInPlacementMode = False + If fPlacementModeCarryWeightMod != 0.0 + Player.ModAV("CarryWeight", fPlacementModeCarryWeightMod) + fPlacementModeCarryWeightMod = 0.0 + EndIf + Game.SetInChargen(false, true, false) ; Re-allow saving + _00E_Meditate_Allowed.SetValueInt(1) + EndIf + + currentHousingObject = None ; Prevent persistence +EndFunction + +Function PickUpHousingObject() + ; Clear currentHousingObject ASAP because of possible race conditions + _00E_Playerhousing_Furniture furnitureRef = (currentHousingObject as _00E_Playerhousing_Furniture) + currentHousingObject = None + + Form furnBaseObject = furnitureRef.GetBaseObject() + If (furnBaseObject as ActorBase) || (furnBaseObject as Container) + If furnitureRef.GetNumItems() > 0 + furnitureRef.RemoveAllItems(Player) + _00E_Playerhousing_ContainerContentMove.Show() + Else + ; Whatever... + furnitureRef.RemoveAllItems(Player) + EndIf + EndIf + Player.AddItem(furnitureRef.GetInventoryItem(), 1, False) + furnitureRef.Disable() + _00E_Phasmalist_Workbench worbenchRef = (furnitureRef as ObjectReference) as _00E_Phasmalist_Workbench + If worbenchRef + worbenchRef.OnPickUp() + EndIf + furnitureRef.Delete() +EndFunction + +Function FinishPlacingHousingObject() + ; Clear currentHousingObject ASAP because of possible race conditions + _00E_Playerhousing_Furniture furnitureRef = (currentHousingObject as _00E_Playerhousing_Furniture) + currentHousingObject = None + + Utility.Wait(0.05) ; Wait for the shaders to stop for sure + furnitureRef.finishPlacement() + PlaySwitchSound() +EndFunction + +Function PlaySwitchSound() + UIMenuActive.Play(player) +EndFunction + +Function RegisterNewHousingObjectOffsets(Float fNewOffsetAngleZ, Float fNewOffsetPositionZ) + fStoredOffsetAngleZ = fNewOffsetAngleZ + fStoredOffsetPositionZ = fNewOffsetPositionZ +EndFunction + +Function Update_209() + bStartTutorialShown = ((Self as Quest) as _00E_PlayerhousingTutorial).StartTutorialIsShown() +EndFunction + + +;===================================================================================== +; CONTROLS +;===================================================================================== + +Bool bLockActions = False +Bool bActiveActivate = False + +Function LockActions() + bLockActions = True + InterruptActivate() +EndFunction + +Function UnlockActions() + bLockActions = False + InterruptActivate() +EndFunction + +Function InterruptActivate() + If bActiveActivate + bActiveActivate = False + UnregisterForUpdate() + EndIf +EndFunction + +Function EnableBuildmodeControls() + RegisterForControl(CONTROL_ACTIVATE) + If bIsInPlacementMode && iPickupKey > 0 + RegisterForKey(iPickupKey) + EndIf + + UnlockActions() +EndFunction + +Function DisableBuildmodeControls() + LockActions() + + UnregisterForAllControls() + UnregisterForAllKeys() + UnregisterForUpdate() +EndFunction + +Event OnControlDown(String control) + If control == CONTROL_ACTIVATE + If bActiveActivate + bActiveActivate = False + bDisableNormalActivation = True + UnregisterForUpdate() + ElseIf bLockActions == False + bActiveActivate = True + bDisableNormalActivation = False + RegisterForSingleUpdate(1.1) + EndIf + EndIf EndEvent -bool function canPlaceItem() - return false -Endfunction +Event OnControlUp(String control, Float holdTime) + If control == CONTROL_ACTIVATE + If bActiveActivate + bActiveActivate = False + UnregisterForUpdate() + If bLockActions == False + activateShortPressed() + EndIf + EndIf + EndIf +EndEvent -Event onControlUp(String control, float holdTime) - if holdTime > timeToHoldActivateToFinish - activateLongPressed() - else - activatePressed() - Endif +Event OnUpdate() + If bActiveActivate + bActiveActivate = False + bDisableNormalActivation = True + If bLockActions == False + activateLongPressed() + EndIf + EndIf EndEvent -function enableBuildmode() -{Enables the player to choose housing objects for manipulation or translation; should be called when the player enters one of his houses} - ((Self as Quest) as _00E_PlayerhousingTutorial).onStartBuildmode() - GoToState("Buildmode") -ENDfunction +Event OnKeyDown(Int iKeyCode) + If iKeyCode == iPickupKey + If bLockActions == False + pickUpPressed() + EndIf + EndIf +EndEvent + + +;===================================================================================== +; DEFAULT STATE +;===================================================================================== -function playerItemDropped(_00E_Playerhousing_FurnitureItem akItemReference) -{Tests if this item drop by the player triggers an entering into buildmode and performs this change if necessary} -ENDfunction +Event OnBeginState() + ExitPlacementMode() +EndEvent + +Function playerItemDropped(_00E_Playerhousing_FurnitureItem akItemReference) + ; Called from _00E_Playerhousing_FurnitureItem on a placeable dropped from the inventory + Player.AddItem(akItemReference, 1, False) + _00E_Playerhousing_CannotPlaceObjectsHere.Show() +EndFunction -function enterBuildmode() -{Enables the player to translate the current housing object and change to manipulation mode} - GoToState("Translation") -ENDfunction +Function activateShortPressed() + ; Process short activate press +EndFunction -function toggleMode() -{Switches between tranlation and manipulation buildmode} -ENDfunction +Function activateLongPressed() + ; Process long activate press +EndFunction -function leaveBuildmode() -{Disables the player to translate or manipulate a housing object; the player can still enter buildmode again} -ENDfunction +Function pickUpPressed() + ; Process pick up key press +EndFunction -function disableBuildmode() -{Disables the player to enter buildmode} -ENDfunction +Function enableBuildmode() + ; Enter the build mode when the player enters their house + ShowStartBuildModeTutorial() + GoToState("Buildmode") +EndFunction -function activatePressed() -{updates the buildmode as necessary when the activation control has been pressed} -Endfunction +Function disableBuildmode() + ; Exit a build mode when the player leaves their house +EndFunction -function activateLongPressed() -{updates the buildmode as necessary when the activation control has been pressed long} -Endfunction +Bool Function IsNormalActivationEnabled() + ; The player can activate a placeable furniture normally + Return True +EndFunction -function translateCurrentHousingObjectLoop() -{translates the current housing object before the player in a recursive loop} -ENDfunction -function pickUp() -{deletes the current housing object and adds the appropriate item to the player's inventory} - Player.addItem(currentHousingObject.getFurnitureItem().getBaseObject(), 1) - currentHousingObject.disable() - currentHousingObject.delete() -Endfunction +;===================================================================================== +; STATE Buildmode +;===================================================================================== -;==================================================================== STATE Buildmode =================================================================================================== STATE Buildmode -;the player can enter the manipulation or translation mode by choosing a housing object or dropping a housing item + ; The player can enter the manipulation or translation mode by choosing a housing object or dropping a housing item - Event onBeginState() - currentHousingObject = None ; prevent persistence - RegisterForControl("activate") + Event OnBeginState() + ExitPlacementMode() + bDisableNormalActivation = True + EnableBuildmodeControls() EndEvent - bool function canPlaceItem() - return True - Endfunction - - Event onEndState() - unRegisterForControl("activate") + Event OnEndState() + DisableBuildmodeControls() EndEvent - - function playerItemDropped(_00E_Playerhousing_FurnitureItem akItemReference) - {Tests if this item drop by the player triggers an entering into buildmode and performs this change if necessary} + + Function playerItemDropped(_00E_Playerhousing_FurnitureItem akItemReference) + If CanEnterPlacementMode() == False || bLockActions ; Locked by something else + Player.AddItem(akItemReference, 1, False) + Return + EndIf + LockActions() + currentHousingObject = akItemReference.placeFurnitureAtMe() - akItemReference.delete() + If currentHousingObject == None + ; Some error happened + Player.AddItem(akItemReference, 1, False) + UnlockActions() + Return + EndIf + + DisableBuildmodeControls() + akItemReference.Disable() + currentHousingObject.InventoryItem = akItemReference.GetBaseObject() + akItemReference.Delete() + bDroppedFromInventory = True GoToState("Translation") - ENDfunction + EndFunction - function activateLongPressed() - {updates the buildmode as necessary when the activation control has been pressed long} - ObjectReference targetRef = Game.GetCurrentCrosshairRef() - if targetRef as _00E_Playerhousing_Furniture - currentHousingObject = targetRef as _00E_Playerhousing_Furniture + Function activateLongPressed() + LockActions() + + _00E_Playerhousing_Furniture targetRef = Game.GetCurrentCrosshairRef() as _00E_Playerhousing_Furniture + If targetRef && targetRef.IsFurnitureInUse() == False && Utility.IsInMenuMode() == False && CanEnterPlacementMode() + currentHousingObject = targetRef GoToState("Translation") - Endif - Endfunction + Else + UnlockActions() + EndIf + EndFunction - function activatePressed() - {updates the buildmode as necessary when the activation control has been pressed} + Function activateShortPressed() ObjectReference targetRef = Game.GetCurrentCrosshairRef() - if !(targetRef as _00E_Phasmalist_Workbench) && (targetRef as _00E_Playerhousing_Furniture) && (targetRef as _00E_Playerhousing_Furniture).shouldActivateBePossible() - targetRef.activate(player, true) - Endif - Endfunction - - function disableBuildmode() - {Disables the player to enter buildmode} - GoToState("null") - ENDfunction + If (targetRef as _00E_Playerhousing_Furniture) && (bLockActions == False) + If (targetRef as _00E_Playerhousing_FurnitureItem) + ; Activate() would mean "Take" for this misc. object, so do nothing + ElseIf (targetRef as _00E_Theriantrophist_BlockCraftingSC) || (targetRef as _00E_Playerhousing_MannequinControl) || (targetRef as _00E_BedScript) || (targetRef as _00E_Phasmalist_Workbench) || (targetRef as _00E_PlaceableGrammophonPlay) + ; These objects do activation themselves in OnActivate event + Else + targetRef.Activate(player, true) + EndIf + EndIf + EndFunction + + Function enableBuildmode() + ; Do nothing + EndFunction + Function disableBuildmode() + GoToState("") + EndFunction + + Bool Function IsNormalActivationEnabled() + Return ((bDisableNormalActivation == False) && (bLockActions == False)) + EndFunction + ENDSTATE -;==================================================================== STATE Translation =================================================================================================== + +;===================================================================================== +; STATE Translation +;===================================================================================== + STATE Translation -;the selected housing object is moved with the player + ; The selected housing object is moved with the player - Event onBeginState() - Game.DisablePlayerControls(abMovement = false, abFighting = true, abCamSwitch = false, abLooking = false, abSneaking = false, abMenu = false, abActivate = true) - - ((Self as Quest) as _00E_PlayerhousingTutorial).onTranslationMode() + Event OnBeginState() + Bool bEnteringPlacement = (bIsInPlacementMode == False) - continueTranslateToPlayerLoop.setValue(1) - currentHousingObjectInTranslation.forceRefTo(currentHousingObject) - currentHousingObject.disable() - currentHousingObject.enable() ;disable - enable reloads the 3d so onLoad of the object is invoked; this will start the translateToPlayer-loop - - RegisterForControl("activate") - while !currentHousingObject.is3DLoaded() - Utility.wait(0.1) - Endwhile - shaderActive.Play(currentHousingObject) + Game.DisablePlayerControls(abMovement = false, abFighting = true, abCamSwitch = false, abLooking = false, abSneaking = false, abMenu = true, abActivate = true) + EnterPlacementMode() + + If bEnteringPlacement && bDroppedFromInventory == False + ObjectReference housingObjRef = currentHousingObject as ObjectReference + If (housingObjRef as _00E_PlaceableGrammophonPlay) + (housingObjRef as _00E_PlaceableGrammophonPlay).StopMusic() + EndIf + EndIf + + If bDroppedFromInventory == False + PlaySwitchSound() + Else + bDroppedFromInventory = False + EndIf + + _00E_Playerhousing_TranslationMode.Show() + + (currentHousingObjectInTranslation as _00E_PlayerhousingCurrentOTranslation).Setup(currentHousingObject, bEnteringPlacement, fStoredOffsetAngleZ, fStoredOffsetPositionZ) + + ShowTranslationModeTutorial() + + EnableBuildmodeControls() EndEvent - Event onEndState() - shaderActive.Stop(currentHousingObject) - continueTranslateToPlayerLoop.setValue(0) - - currentHousingObjectInTranslation.clear() - unRegisterForControl("activate") - + Event OnEndState() Game.EnablePlayerControls(abMovement = true, abFighting = true, abCamSwitch = true, abLooking = true, abSneaking = true, abMenu = true, abActivate = true) EndEvent - function activatePressed() - {updates the buildmode as necessary when the activation control has been pressed} - toggleMode() - Endfunction - - function activateLongPressed() - {updates the buildmode as necessary when the activation control has been pressed long} - pickUp() - leaveBuildmode() - Endfunction - - function toggleMode() - {Switches between tranlation and manipulation buildmode} + Function activateShortPressed() + DisableBuildmodeControls() + (currentHousingObjectInTranslation as _00E_PlayerhousingCurrentOTranslation).Shutdown() GoToState("Manipulation") - ENDfunction - - function disableBuildmode() - {Disables the player to enter buildmode} - GoToState("null") - ENDfunction + EndFunction - function leaveBuildmode() - {Disables the player to translate or manipulate a housing object; the player can still enter buildmode again} + Function activateLongPressed() + DisableBuildmodeControls() + (currentHousingObjectInTranslation as _00E_PlayerhousingCurrentOTranslation).Shutdown() + FinishPlacingHousingObject() + GoToState("Buildmode") + EndFunction + + Function pickUpPressed() + DisableBuildmodeControls() + (currentHousingObjectInTranslation as _00E_PlayerhousingCurrentOTranslation).Shutdown() + PickUpHousingObject() GoToState("Buildmode") - ENDfunction + EndFunction + + Function enableBuildmode() + ; Do nothing + EndFunction + + Function disableBuildmode() + DisableBuildmodeControls() + (currentHousingObjectInTranslation as _00E_PlayerhousingCurrentOTranslation).Shutdown() + If currentHousingObject + PickUpHousingObject() + EndIf + GoToState("") + EndFunction + + Bool Function IsNormalActivationEnabled() + Return False + EndFunction ENDSTATE -;==================================================================== STATE Manipulation =================================================================================================== + +;===================================================================================== +; STATE Manipulation +;===================================================================================== + STATE Manipulation -;the player can change orientation or height of the selected housing object by using the keys + ; The player can change orientation or altitude of the selected housing object by using the keys - Event onBeginState() - Game.DisablePlayerControls(abMovement = false, abFighting = true, abCamSwitch = false, abLooking = false, abSneaking = false, abMenu = false, abActivate = true) + Event OnBeginState() + Game.DisablePlayerControls(abMovement = false, abFighting = true, abCamSwitch = false, abLooking = false, abSneaking = false, abMenu = true, abActivate = true) Game.SetPlayerAIDriven(True) - ((Self as Quest) as _00E_PlayerhousingTutorial).onManipulationMode() - - currentHousingObjectInManipulation.forceRefTo(currentHousingObject) - currentHousingObjectInManipulation.RegisterForControl("forward") - currentHousingObjectInManipulation.RegisterForControl("back") - currentHousingObjectInManipulation.RegisterForControl("strafe left") - currentHousingObjectInManipulation.RegisterForControl("strafe right") - - RegisterForControl("activate") - - ;we do not have to wait until the 3d is loaded since the manipulation mode is only entered from the translation mode - shaderActive.Play(currentHousingObject) - EndEvent + PlaySwitchSound() - Event onEndState() - shaderActive.Stop(currentHousingObject) - unRegisterForControl("activate") + _00E_Playerhousing_ManipulationMode.Show() - currentHousingObjectInManipulation.unRegisterForControl("forward") - currentHousingObjectInManipulation.unRegisterForControl("back") - currentHousingObjectInManipulation.unRegisterForControl("strafe left") - currentHousingObjectInManipulation.unRegisterForControl("strafe right") - currentHousingObjectInManipulation.clear() + (currentHousingObjectInManipulation as _00E_PlayerhousingCurrentOManipulate).Setup(currentHousingObject) + + ShowManipulationModeTutorial() + + EnableBuildmodeControls() + EndEvent + Event OnEndState() Game.SetPlayerAIDriven(False) Game.EnablePlayerControls(abMovement = true, abFighting = true, abCamSwitch = true, abLooking = true, abSneaking = true, abMenu = true, abActivate = true) EndEvent - function activatePressed() - {updates the buildmode as necessary when the activation control has been pressed} - toggleMode() - Endfunction + Function activateShortPressed() + DisableBuildmodeControls() + (currentHousingObjectInManipulation as _00E_PlayerhousingCurrentOManipulate).Shutdown(True) + GoToState("Translation") + EndFunction - function activateLongPressed() - {updates the buildmode as necessary when the activation control has been pressed long} - currentHousingObject.finishPlacement() - leaveBuildmode() - Endfunction + Function activateLongPressed() + DisableBuildmodeControls() + (currentHousingObjectInManipulation as _00E_PlayerhousingCurrentOManipulate).Shutdown(False) + FinishPlacingHousingObject() + GoToState("Buildmode") + EndFunction - function toggleMode() - {Switches between tranlation and manipulation buildmode} - GoToState("Translation") - ENDfunction + Function pickUpPressed() + DisableBuildmodeControls() + (currentHousingObjectInManipulation as _00E_PlayerhousingCurrentOManipulate).Shutdown(False) + PickUpHousingObject() + GoToState("Buildmode") + EndFunction - function disableBuildmode() - {Disables the player to enter buildmode} - GoToState("null") - ENDfunction + Function enableBuildmode() + ; Do nothing + EndFunction - function leaveBuildmode() - {Disables the player to translate or manipulate a housing object; the player can still enter buildmode again} - GoToState("Buildmode") - ENDfunction + Function disableBuildmode() + DisableBuildmodeControls() + (currentHousingObjectInManipulation as _00E_PlayerhousingCurrentOManipulate).Shutdown(False) + If currentHousingObject + PickUpHousingObject() + EndIf + GoToState("") + EndFunction + + Bool Function IsNormalActivationEnabled() + Return False + EndFunction ENDSTATE diff --git a/source/scripts/_00e_playerhousingtutorial.psc b/source/scripts/_00e_playerhousingtutorial.psc index e1f2a013..308e38f8 100644 --- a/source/scripts/_00e_playerhousingtutorial.psc +++ b/source/scripts/_00e_playerhousingtutorial.psc @@ -1,48 +1,14 @@ Scriptname _00E_PlayerhousingTutorial extends Quest +{ OBSOLETE. Left for version update. } -Message Property buildmodeTutorial auto -Message Property translationModeTutorial auto -Message Property manipulationModeTutorial auto - -GlobalVariable Property _00E_DisableCraftingTutorials Auto - -function ShowTutorial() - int button = buildmodeTutorial.show() - if button == 0 - GotoState("") - else - GotoState("NoTutorial") - Endif -Endfunction - -function onStartBuildmode() - If _00E_DisableCraftingTutorials.GetValueInt() == 0 - ShowTutorial() - EndIf -Endfunction - -function onTranslationMode() - Debug.Notification(translationModeTutorial.getName()) - translationModeTutorial.show() -Endfunction - -function onManipulationMode() - Debug.Notification(manipulationModeTutorial.getName()) - manipulationModeTutorial.show() -Endfunction +Bool Function StartTutorialIsShown() + Return False +EndFunction STATE NoTutorial - function onStartBuildmode() - - Endfunction - - function onTranslationMode() - Debug.Notification(translationModeTutorial.getName()) - Endfunction - - function onManipulationMode() - Debug.Notification(manipulationModeTutorial.getName()) - Endfunction + Bool Function StartTutorialIsShown() + Return True + EndFunction Endstate diff --git a/source/scripts/_00e_playersetupscript.psc b/source/scripts/_00e_playersetupscript.psc index 037303cf..65452046 100644 --- a/source/scripts/_00e_playersetupscript.psc +++ b/source/scripts/_00e_playersetupscript.psc @@ -1,7 +1,7 @@ Scriptname _00E_PlayerSetUpScript extends ObjectReference {Initializes all the necessary Quests, maintains the player, contains various OnPlayerLoadGame() failsafes} -Float Property CURRENT_PATCH_VERSION = 2.08 AutoReadOnly +Float Property CURRENT_PATCH_VERSION = 2.09 AutoReadOnly ;===================================================================================== @@ -355,6 +355,25 @@ Function FillAnimTestPackages(Int idNPC, String esmNPC, Int idPackage, String es EndFunction +;===================================================================================== +; 2.0.9 +;===================================================================================== + +Function Update_209() + Spell abSoulcaller = Game.GetFormFromFile(0x002F0EA, "Enderal - Forgotten Stories.esm") as Spell + If PlayerREF.HasSpell(abSoulcaller) + PlayerREF.RemoveSpell(abSoulcaller) + Utility.Wait(1) + PlayerREF.AddSpell(abSoulcaller, False) + EndIf + + Perk perkBloodlust = Game.GetFormFromFile(0x00069D38, "Skyrim.esm") as Perk + _ResetPerk(perkBloodlust) + + _00E_PlayerhousingMaster.GetMaster().Update_209() +EndFunction + + ;===================================================================================== ; ALL UPDATES ;===================================================================================== @@ -406,10 +425,10 @@ Function RefreshMountNamesOnLoad() EndFunction -Function _ResetArmorWeightPerk(Perk weightPerk) - If PlayerREF.HasPerk(weightPerk) - PlayerREF.RemovePerk(weightPerk) - PlayerREF.AddPerk(weightPerk) +Function _ResetPerk(Perk p) + If PlayerREF.HasPerk(p) + PlayerREF.RemovePerk(p) + PlayerREF.AddPerk(p) EndIf EndFunction @@ -419,8 +438,8 @@ Function ResetArmorWeightPerks() ; The push is needed only if the player is over-encumbered on game load. ; If the player is not over-encumbered, the push is not needed because checking the inventory, picking up items, sheathing/drawing a weapon will reset the perks anyway. If PlayerREF.IsOverEncumbered() - _ResetArmorWeightPerk(_00E_Class_Keeper_P05_C_Conditioning) - _ResetArmorWeightPerk(_00E_Class_Vagrant_P05_B_Lightweight) + _ResetPerk(_00E_Class_Keeper_P05_C_Conditioning) + _ResetPerk(_00E_Class_Vagrant_P05_B_Lightweight) EndIf EndFunction @@ -543,7 +562,7 @@ Function Maintenance() bdoOnce = true EndIf EndIf - ElseIf fPatchVersion >= 1.5 + ElseIf fPatchVersion >= 1.5 && fPatchVersion < CURRENT_PATCH_VERSION ; only do this once when update 1.5.6.0 is applied If fPatchVersion < 1.56 @@ -584,6 +603,10 @@ Function Maintenance() If fPatchVersion < 2.08 Update_208() EndIf + ; only do this once when update 2.0.9 (SE) is applied + If fPatchVersion < 2.09 + Update_209() + EndIf fPatchVersion = CURRENT_PATCH_VERSION EndIf diff --git a/source/scripts/_00e_questfunctions.psc b/source/scripts/_00e_questfunctions.psc index f4edeab1..c3e906c3 100644 --- a/source/scripts/_00e_questfunctions.psc +++ b/source/scripts/_00e_questfunctions.psc @@ -134,14 +134,6 @@ endFunction Function DisableDialogueQuitting() Global {Disables the TAB Key during dialogue. Resets automatically upon dialogue exit via Goodbye.} - if UI.GetBool("Dialogue Menu", "_root.DialogueMenu_mc.bEnableTab") != true - ; Suspected non-Enderal dialoguemenu.swf replacer, rechecking value in order to be sure. - UI.InvokeBool("Dialogue Menu", "_root.DialogueMenu_mc.SetVariable", True) - if UI.GetBool("Dialogue Menu", "_root.DialogueMenu_mc.bEnableTab") != true - Debug.Notification("Detected incompatible dialoguemenu.swf!") - endif - endif - UI.InvokeBool("Dialogue Menu", "_root.DialogueMenu_mc.SetVariable", False) EndFunction @@ -288,6 +280,27 @@ Function DisableReferenceFormList(FormList referenceList) Global EndFunction +Float Function SetActorScale(Actor akActor, Float fNewScale) Global + + ; Sets the scale of akActor to fNewScale and returns the old scale. + ; This is a workaround for GetScale() returning the cumulative scale of Race.Height * Actor.Scale for actors. + ; So it results in a messed up scale if the value returned by GetScale() is used to revert the scale change for an actor whose race has a non-1.00 height (for example, HighElfRace) + + Float fOriginalScale = akActor.GetScale() + akActor.SetScale(fNewScale) + ; Now use the known fNewScale and the return of GetScale() to get the race height coeff, and apply that coeff to fOriginalScale to calculate the true actor's reference scale. + Return fOriginalScale * fNewScale / akActor.GetScale() + +EndFunction + +Float Function AdjustTimePeriodByEngineTimerError(Float fUnadjustedPeriod) Global + + ; In SE, the game time runs slower than the real time by about 2.5/60 second + + Return fUnadjustedPeriod - (2.5 * Math.Floor(fUnadjustedPeriod) / 60.0) + +EndFunction + Function PrintDebugMessage(String msg) Global ; Dummy to fix error messages in Papyrus.log about missing function EndFunction @@ -1215,7 +1228,7 @@ Message Property _00E_PleaseRemoveMoney Auto GlobalVariable Property GameHour Auto -;--------------------------------------VISION----------------------------------- +;--------------------------------------VISION-----------------------------------; float PlayerSpeed int VisionSound