Scriptname wizMCMConfigDynamicThings extends SKI_ConfigBase
GlobalVariable Property wizDynamicThingsEnabled Auto
GlobalVariable Property wizOptionWoodPilesEnabled Auto
GlobalVariable Property wizOptionWoodPileRadius Auto
GlobalVariable Property wizOptionQuestupdate Auto
GlobalVariable Property wizOptionBarrelsEnabled Auto
GlobalVariable Property wizOptionCratesEnabled Auto
GlobalVariable Property wizOptionHayBalesEnabled Auto
GlobalVariable Property wizOptionMiscsEnabled Auto
;GlobalVariable Property wizOptionHarvestWoodEnabled Auto
GlobalVariable Property wizOptionDTResetTime Auto
GlobalVariable Property wizOptionSpiderFallsFromTree Auto
GlobalVariable Property wizOptionTimeToFellTree Auto
GlobalVariable Property wizOptionPlayCutsceneSounds Auto
GlobalVariable Property wizOptionHarvestWoodBushesEnabled Auto
GlobalVariable Property wizOptionHarvestWoodTreesEnabled Auto
GlobalVariable Property wizOptionHarvestDriftWood Auto
GlobalVariable Property wizOptionDynamicSafeContainersEnabled Auto
GlobalVariable Property wizOptionHarvestStumpsEnabled Auto
Message Property wizConfirmSafeContainerRemoval Auto
Formlist Property wizSafeContainerList Auto
Quest Property wizUpdateWoodPileAliasQuest Auto
Quest Property wizWoodPileAliasQuest Auto
Quest Property wizDTCompatibilityQuest Auto
; SCRIPT VERSION ----------------------------------------------------------------------------------
int function GetVersion()
;return 1 ;Everything v1.30 and under
return 2 ;v1.35
endFunction
; PRIVATE VARIABLES -------------------------------------------------------------------------------
; State
; ...
; Internal
; ...
; INITIALIZATION ----------------------------------------------------------------------------------
; @implements SKI_ConfigBase
event OnConfigInit()
{Called when this config menu is initialized}
;Need to initiate when first loaded
; ...
endEvent
; @implements SKI_QuestBase
event OnVersionUpdate(int a_version)
{Called when a version update of this script has been detected}
; a_version is the new version, CurrentVersion is the old version
if (a_version >= 2 && CurrentVersion < 2)
Pages = new string[3]
Pages[0] = "Containers/Activators"
Pages[1] = "Landscape Overhaul"
Pages[2] = "Misc/Util"
wizOptionDTResetTime.setValue(Game.GetGameSettingInt("iHoursToRespawnCell")/24)
endIf
; ...
endEvent
; EVENTS ------------------------------------------------------------------------------------------
; Toggle states
; @implements SKI_ConfigBase
event OnPageReset(string page)
{Called when a new page is selected, including the initial empty page}
SetCursorFillMode(TOP_TO_BOTTOM)
SetCursorPosition(0) ; Can be removed because it starts at 0 anyway
if (page == "")
; LoadCustomContent("skyui/skyui_splash.swf")
; return
else
; UnloadCustomContent()
endIf
if (page == "")
elseif (page == "Containers/Activators")
AddHeaderOption("Welcome to Dynamic Things")
AddToggleOptionST("ModEnabled", "Mod enabled", wizDynamicThingsEnabled.getValueInt())
AddSliderOptionST("QuestUpdate", "Run quest every", wizOptionQuestUpdate.getvalueint(), "{0} seconds")
AddSliderOptionST("QuestRadius", "Convert statics within", wizOptionWoodPileRadius.getvalueint(), "{0} units")
AddSliderOptionST("RespawnTime", "Respawn DT Containers Time", Game.GetGameSettingInt("iHoursToRespawnCell"), "{0} hours", OPTION_FLAG_DISABLED)
;Not sure how I want to handle this yet
wizOptionDTResetTime.SetValue(Game.GetGameSettingInt("iHoursToRespawnCell")/24)
AddHeaderOption("Dynamic Containers")
AddToggleOptionST("DynamicSafeContainers", "Dynamic Safe Containers", wizOptionDynamicSafeContainersEnabled.getValueInt())
AddToggleOptionST("DynamicWoodPiles", "Dynamic Woodpiles", wizOptionWoodPilesEnabled.getValueInt())
AddToggleOptionST("DynamicBarrels", "Dynamic Barrels", wizOptionBarrelsEnabled.getValueInt())
AddToggleOptionST("DynamicCrates", "Dynamic Crates", wizOptionCratesEnabled.getValueInt())
; AddToggleOptionST("DynamicHayBales", "Dynamic Hay Bales", wizOptionHayBalesEnabled.getValueInt())
SetCursorPosition(1)
AddHeaderOption("Other Dynamic Things")
AddToggleOptionST("DynamicMisc", "Enable Items Below", wizOptionMiscsEnabled.getValueInt())
AddTextOptionST("TrainingDummies", "Training Dummies/Archery Targets", "")
AddTextOptionST("MeadKegs", "Mead Kegs", "")
AddTextOptionST("HayBales", "Hay Bales", "")
AddTextOptionST("HagravenTaproots", "Hagraven Hanging Taproots", "")
AddTextOptionST("SmelterCoalPiles", "Smelter Coal Piles", "")
elseIf (page == "Landscape Overhaul")
AddHeaderOption("Trees, Bushes without Collision")
AddToggleOptionST("HarvestBushes", "Harvest Trees/Bushes without Collision", wizOptionHarvestWoodBushesEnabled.getValueInt())
AddHeaderOption("Trees, Bushes with Collision")
AddToggleOptionST("HarvestTrees", "Harvest Trees/Bushes with Collision", wizOptionHarvestWoodTreesEnabled.getValueInt())
AddToggleOptionST("PlayCutsceneSounds", "Play Cutscene Sounds When Felling a Tree", wizOptionPlayCutsceneSounds.getValueInt())
AddSliderOptionST("TreeFellTime", "Felling Tree Elapses", wizOptionTimeToFellTree.getvalueint(), "{0} minutes")
AddSliderOptionST("TreeProtectedChance", "Tree Protected Chance", wizOptionSpiderFallsFromTree.getvalueint(), "{0} % Chance")
AddHeaderOption("Driftwood/Branch Piles/Stumps")
AddToggleOptionST("HarvestDriftWood", "Harvest From Driftwood/Branch Piles", wizOptionHarvestDriftWood.getValueInt())
AddToggleOptionST("HarvestStumps", "Harvest From Stumps and Logs", wizOptionHarvestStumpsEnabled.getValueInt())
elseIf (page == "Misc/Util")
AddTextOptionST("LootSafeContainers", "Loot All Safe Containers", "")
endIf
; ...
endEvent
state DynamicSafeContainers
event OnSelectST()
toggle(wizOptionDynamicSafeContainersEnabled)
SetToggleOptionValueST(wizOptionDynamicSafeContainersEnabled.getValueInt())
endEvent
event OnDefaultST()
wizOptionDynamicSafeContainersEnabled.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Turn ANY Vanilla, ANY DLC and ANY Mod container into a perfectly safe-for-storage container simply by adding ANY item to it.\nDefault: true")
endEvent
endState
state HarvestStumps
event OnSelectST()
toggle(wizOptionHarvestStumpsEnabled)
SetToggleOptionValueST(wizOptionHarvestStumpsEnabled.getValueInt())
endEvent
event OnDefaultST()
wizOptionHarvestStumpsEnabled.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Harvest wood from stumps and logs from fallen trees. Logs will result in woodpiles being\ncreated. Cutscene sounds setting is inherited from tree felling. Time elapsed is half that of tree felling.\nDefault: true")
endEvent
endState
state HarvestDriftWood
event OnSelectST()
toggle(wizOptionHarvestDriftWood)
SetToggleOptionValueST(wizOptionHarvestDriftWood.getValueInt())
endEvent
event OnDefaultST()
wizOptionHarvestDriftWood.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Harvest wood from driftwood and branch piles. High concentration found along the northern coast but elsewhere as well.\nDefault: true")
endEvent
endState
state TreeProtectedChance
event OnSliderOpenST()
SetSliderDialogStartValue(wizOptionSpiderFallsFromTree.getValueInt())
SetSliderDialogDefaultValue(2.0)
SetSliderDialogRange(0.0, 100.0)
SetSliderDialogInterval(1.0)
endEvent
event OnSliderAcceptST(float value)
wizOptionSpiderFallsFromTree.setValueInt(value as int)
SetSliderOptionValueST(wizOptionSpiderFallsFromTree.getValueInt(), "{0} % Chance")
endEvent
event OnDefaultST()
wizOptionSpiderFallsFromTree.setValueInt(2)
SetSliderOptionValueST(wizOptionSpiderFallsFromTree.getValueInt(),"{0} % Chance")
endEvent
event OnHighlightST()
SetInfoText("This is the possibility that a tree could be infested with spiders or protected by a Spriggan.\nDefault: 2")
endEvent
endState
state PlayCutsceneSounds
event OnSelectST()
toggle(wizOptionPlayCutsceneSounds)
SetToggleOptionValueST(wizOptionPlayCutsceneSounds.getValueInt())
endEvent
event OnDefaultST()
wizOptionPlayCutsceneSounds.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Whether or not to play the custscene sounds of the tree falling and the player cutting the wood when felling a tree.\nDefault: true")
endEvent
endState
state TreeFellTime
event OnSliderOpenST()
SetSliderDialogStartValue(wizOptionTimeToFellTree.getValueInt())
SetSliderDialogDefaultValue(60.0)
SetSliderDialogRange(0.0, 180.0)
SetSliderDialogInterval(1.0)
endEvent
event OnSliderAcceptST(float value)
wizOptionTimeToFellTree.setValueInt(value as int)
SetSliderOptionValueST(wizOptionTimeToFellTree.getValueInt(), "{0} minutes")
endEvent
event OnDefaultST()
wizOptionTimeToFellTree.setValueInt(60)
SetSliderOptionValueST(wizOptionTimeToFellTree.getValueInt(),"{0} minutes")
endEvent
event OnHighlightST()
SetInfoText("This is the amount of game time that will pass during the cutscene if you fell a tree.\nDefault: 60")
endEvent
endState
state LootSafeContainers
event OnSelectST()
Empty_Containers()
; textVal = "PRESSED"
; SetTextOptionValueST(textVal)
endEvent
event OnDefaultST()
; textVal = "NOT PRESSED"
; SetTextOptionValueST(textVal)
endEvent
event OnHighlightST()
SetInfoText("Clicking this will remove all items from all Dynamic Things containers marked safe and place those items in the player's inventory")
endEvent
endState
state DynamicMisc
event OnSelectST()
toggle(wizOptionMiscsEnabled)
SetToggleOptionValueST(wizOptionMiscsEnabled.getValueInt())
; debug.messagebox(wizOptionMiscsEnabled.getValueInt())
; SetToggleOptionValueST(False)
endEvent
event OnDefaultST()
wizOptionMiscsEnabled.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Turn on all miscellaneous dynamic items listed below.\nDefault: true")
endEvent
endState
state DynamicHayBales
event OnSelectST()
toggle(wizOptionHayBalesEnabled)
SetToggleOptionValueST(wizOptionHayBalesEnabled.getValueInt())
endEvent
event OnDefaultST()
wizOptionHayBalesEnabled.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Turn static hay bales into usable containers. If toggling the option on and off, \nyou may need to enter a different cell before previously converted crates will function properly.\nDefault: true")
endEvent
endState
state DynamicCrates
event OnSelectST()
toggle(wizOptionCratesEnabled)
SetToggleOptionValueST(wizOptionCratesEnabled.getValueInt())
endEvent
event OnDefaultST()
wizOptionCratesEnabled.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Turn static crates into usable containers. If toggling the option on and off, \nyou may need to enter a different cell before previously converted crates will function properly.\nDefault: true")
endEvent
endState
state DynamicBarrels
event OnSelectST()
toggle(wizOptionBarrelsEnabled)
SetToggleOptionValueST(wizOptionBarrelsEnabled.getValueInt())
endEvent
event OnDefaultST()
wizOptionBarrelsEnabled.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Turn static barrels into usable containers. If toggling the option on and off, \nyou may need to enter a different cell before previously converted barrels will function properly.\nDefault: true")
endEvent
endState
state DynamicWoodPiles
event OnSelectST()
toggle(wizOptionWoodPilesEnabled)
SetToggleOptionValueST(wizOptionWoodPilesEnabled.getValueInt())
endEvent
event OnDefaultST()
wizOptionWoodPilesEnabled.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Turn static woodpiles into usable containers. If toggling the option on and off, \nyou may need to enter a different cell before previously converted woodpiles will function properly.\nDefault: true")
endEvent
endState
state RespawnTime
event OnSliderOpenST()
; SetSliderDialogStartValue(wizOptionWoodPileRadius.getValueInt())
; SetSliderDialogDefaultValue(2000.0)
; SetSliderDialogRange(50.0, 5000.0)
; SetSliderDialogInterval(10.0)
endEvent
event OnSliderAcceptST(float value)
; wizOptionWoodPileRadius.setValueInt(value as int)
; SetSliderOptionValueST(wizOptionWoodPileRadius.getValueInt(), "{0} units")
endEvent
event OnDefaultST()
; wizOptionWoodPileRadius.setValueInt(2000)
; SetSliderOptionValueST(wizOptionWoodPileRadius.getValueInt(),"{0} units")
endEvent
event OnHighlightST()
SetInfoText("This is the number of hours it will take to respawn/regrow Dynamic Things containers/changes.\nThis is currently loaded from the iHoursToRespawnCell game setting and is shown here for clarity.") ;\nDefault: true")
endEvent
endState
state QuestRadius
event OnSliderOpenST()
SetSliderDialogStartValue(wizOptionWoodPileRadius.getValueInt())
SetSliderDialogDefaultValue(2000.0)
SetSliderDialogRange(50.0, 5000.0)
SetSliderDialogInterval(10.0)
endEvent
event OnSliderAcceptST(float value)
wizOptionWoodPileRadius.setValueInt(value as int)
SetSliderOptionValueST(wizOptionWoodPileRadius.getValueInt(), "{0} units")
endEvent
event OnDefaultST()
wizOptionWoodPileRadius.setValueInt(2000)
SetSliderOptionValueST(wizOptionWoodPileRadius.getValueInt(),"{0} units")
endEvent
event OnHighlightST()
SetInfoText("This is how far from the player woodpiles will be converted to containers.\nAs a point of reference the player's height is approximately 250 units\nDefault: 2000")
endEvent
endState
state QuestUpdate
event OnSliderOpenST()
SetSliderDialogStartValue(wizOptionQuestUpdate.getValueInt())
SetSliderDialogDefaultValue(4.0)
SetSliderDialogRange(1.0, 10.0)
SetSliderDialogInterval(1.0)
endEvent
event OnSliderAcceptST(float value)
wizOptionQuestUpdate.setValueInt(value as int)
SetSliderOptionValueST(wizOptionQuestUpdate.getValueInt(), "{0} seconds")
endEvent
event OnDefaultST()
wizOptionQuestUpdate.setValueInt(4)
SetSliderOptionValueST(wizOptionQuestUpdate.getValueInt(),"{0} seconds")
endEvent
event OnHighlightST()
SetInfoText("This is how often the quest will run in the background\nDefault: 4")
endEvent
endState
state ModEnabled
event OnSelectST()
toggle(wizDynamicThingsEnabled)
SetToggleOptionValueST(wizDynamicThingsEnabled.getValueInt())
endEvent
event OnDefaultST()
wizDynamicThingsEnabled.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Turn the entire mod on and off. If toggling the mod on and off, \nyou may need to enter a different cell before previously converted items will function properly.\nDefault: true")
endEvent
endState
state HarvestTrees
event OnSelectST()
toggle(wizOptionHarvestWoodTreesEnabled)
SetToggleOptionValueST(wizOptionHarvestWoodTreesEnabled.getValueInt())
endEvent
event OnDefaultST()
wizOptionHarvestWoodTreesEnabled.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Harvest wood from bushes and trees WITH collision.\nDefault: true")
endEvent
endState
state HarvestBushes
event OnSelectST()
toggle(wizOptionHarvestWoodBushesEnabled)
SetToggleOptionValueST(wizOptionHarvestWoodBushesEnabled.getValueInt())
endEvent
event OnDefaultST()
wizOptionHarvestWoodBushesEnabled.SetValueInt(1)
SetToggleOptionValueST(True)
endEvent
event OnHighlightST()
SetInfoText("Harvest wood from bushes and trees WITHOUT collision.\nDefault: true")
endEvent
endState
Function toggle(GlobalVariable gVar)
if gVar.getValueInt() == 0
gVar.setValueInt(1)
else
gVar.setValueInt(0)
endif
EndFunction
Function Empty_Containers()
debug.messagebox("Please exit all MCM menus in order to complete the transfer")
int Confirm = wizConfirmSafeContainerRemoval.Show()
if Confirm == 0
int iIndex = wizSafeContainerList.GetSize()
actor playerRef = Game.GetPlayer()
while iIndex
iIndex = iIndex - 1
ObjectReference Cont = wizSafeContainerList.GetAt(iIndex) as ObjectReference
Cont.RemoveAllItems(playerREF, TRUE, TRUE)
endWhile
;Reset array now too?
; wizSafeContainerList.Revert()
debug.messagebox("All items removed from all Dynamic Things containers marked safe and placed in player's inventory")
endIf
endFunction