tamtastic Posted March 14, 2021 Share Posted March 14, 2021 (edited) Hello Fellow Modders, Big Picture: I have a lot of doors in my basement (connecting to player homes) and depending on what the user selects (through the MCM) for the status of each door Is It In Game (.i.e "No way do I want a door in my basement leading to the Dark Brotherhood Sanctuary, creepy" :ohmy: )Is It known by the player (i.e. "Have I ever been in the Dark Brotherhood Sanctuary? Yes but its not what you think. I was going door to door selling cookies and I asked to use their restroom..." :sick: )Is it On the Network to fast travel between places (i.e. "I like having access to my basement from the Dark Brotherhood Sanctuary, but I don't want them to follow me into my nice home, so it is off network" :ermm: )Which is the current Active Door ("Are you asking if I entered my basement just now from the Dark Brotherhood Sanctuary? Well, I could tell you but then... :devil: ") I want to update which doors are Enabled. I have a working version with the InGame and IsKnown. I am using global variables for each door and each status. While it works, it seems to be the wrong approach. I have started adding the OnNetwork, and the Event OnOptionSelect is starting to get ugly. Ugly code warning! You don't need to read this. This MCM is not complete and the Indentations did not transfer?? Scriptname dw01_MLB_MCM extends SKI_ConfigBase ObjectReference Property dw01DoorToBreezehome Auto ObjectReference Property dw01DoorFromBreezehome Auto ObjectReference Property dw01DoorToBYOH1 Auto ObjectReference Property dw01DoorFromBYOH1 Auto ObjectReference Property dw01DoorToBYOH2 Auto ObjectReference Property dw01DoorFromBYOH2 Auto ObjectReference Property dw01DoorToBYOH3 Auto ObjectReference Property dw01DoorFromBYOH3 Auto ObjectReference Property dw01DoorToHjerim Auto ObjectReference Property dw01DoorFromHjerim Auto ObjectReference Property dw01DoorToHoneyside Auto ObjectReference Property dw01DoorFromHoneyside Auto ObjectReference Property dw01DoorToProudspireManor Auto ObjectReference Property dw01DoorFromProudspireManor Auto ObjectReference Property dw01DoorToRiftenRaggedFlagon Auto ObjectReference Property dw01DoorFromRiftenRaggedFlagon Auto ObjectReference Property dw01DoorToVlindrelHall Auto ObjectReference Property dw01DoorFromVlindrelHall Auto ObjectReference Property dw01DoorToWinterholdCollegeHallofAttainment Auto ObjectReference Property dw01DoorFromWinterholdCollegeHallofAttainment Auto ObjectReference Property dw01DoorToSeverinHouse Auto ObjectReference Property dw01DoorFromSeverinHouse Auto ;|||| In Game |||| In Game |||| In Game |||| In Game |||| In Game |||| GlobalVariable Property dw01_giInGame_WhiterunBreezehome Auto GlobalVariable Property dw01_giInGame_RiftenHoneyside Auto GlobalVariable Property dw01_giInGame_SolitudeProudspireManor Auto GlobalVariable Property dw01_giInGame_MarkarthVlindrelHall Auto GlobalVariable Property dw01_giInGame_WindhelmHjierm Auto GlobalVariable Property dw01_giInGame_BY0H1 Auto ;Falkreath: Lakeview Manor GlobalVariable Property dw01_giInGame_BY0H2 Auto ;Hjaalmarch: Windstad Manor GlobalVariable Property dw01_giInGame_BY0H3 Auto ;Pale: Heljarchen Hall GlobalVariable Property dw01_giInGame_RRSeverinHouse Auto GlobalVariable Property dw01_giInGame_CollegeHallofAttainment Auto GlobalVariable Property dw01_giInGame_RiftenRaggedFlagon Auto ;|||| Is Known By Player |||| Is Known By Player |||| Is Known By Player |||| GlobalVariable Property dw01_giKnown_WhiterunBreezehome Auto GlobalVariable Property dw01_giKnown_RiftenHoneyside Auto GlobalVariable Property dw01_giKnown_SolitudeProudspireManor Auto GlobalVariable Property dw01_giKnown_MarkarthVlindrelHall Auto GlobalVariable Property dw01_giKnown_WindhelmHjierm Auto GlobalVariable Property dw01_giKnown_BY0H1 Auto ;Falkreath: Lakeview Manor GlobalVariable Property dw01_giKnown_BY0H2 Auto ;Hjaalmarch: Windstad Manor GlobalVariable Property dw01_giKnown_BY0H3 Auto ;Pale: Heljarchen Hall GlobalVariable Property dw01_giKnown_RRSeverinHouse Auto GlobalVariable Property dw01_giKnown_CollegeHallofAttainment Auto GlobalVariable Property dw01_giKnown_RiftenRaggedFlagon Auto ;|||| Is On Door Connection Network |||| Is On Door Connection Network |||| GlobalVariable Property dw01_gi_OnNetwork_00 Auto GlobalVariable Property dw01_gi_OnNetwork_01 Auto GlobalVariable Property dw01_gi_OnNetwork_02 Auto GlobalVariable Property dw01_gi_OnNetwork_03 Auto GlobalVariable Property dw01_gi_OnNetwork_04 Auto GlobalVariable Property dw01_gi_OnNetwork_05 Auto GlobalVariable Property dw01_gi_OnNetwork_06 Auto GlobalVariable Property dw01_gi_OnNetwork_07 Auto GlobalVariable Property dw01_gi_OnNetwork_08 Auto GlobalVariable Property dw01_gi_OnNetwork_09 Auto GlobalVariable Property dw01_gi_OnNetwork_10 Auto GlobalVariable Property dw01_gUserSetting Auto ;Either 0,1,2 GlobalVariable Property dw01_gcExit_SameDoor Auto ;0 GlobalVariable Property dw01_gcExit_AnyKnown Auto ;1 GlobalVariable Property dw01_gcExit_AnyInGame Auto ;2 Int OID_Toggle_WrBh_InGame Int OID_Toggle_WrBh_IsKnown Int OID_Toggle_WrBh_OnNetwork Int OID_Toggle_SoPM_InGame Int OID_Toggle_SoPM_IsKnown Int OID_Toggle_SoPM_OnNetwork Int OID_Toggle_RiHs_InGame Int OID_Toggle_RiHs_IsKnown Int OID_Toggle_RiHs_OnNetwork Int OID_Toggle_WhmHj_InGame Int OID_Toggle_WhmHj_IsKnown Int OID_Toggle_WhmHj_OnNetwork Int OID_Toggle_MaVH_InGame Int OID_Toggle_MaVH_IsKnown Int OID_Toggle_MaVH_OnNetwork Int OID_Toggle_BYOH1_InGame ;Falkreath: Lakeview Manor Int OID_Toggle_BYOH1_IsKnown ;Falkreath: Lakeview Manor Int OID_Toggle_BYOH1_OnNetwork Int OID_Toggle_BYOH2_InGame ;Hjaalmarch: Windstad Manor Int OID_Toggle_BYOH2_IsKnown ;Hjaalmarch: Windstad Manor Int OID_Toggle_BYOH2_OnNetwork Int OID_Toggle_BYOH3_InGame ;The Pale: Heljarchen Hall Int OID_Toggle_BYOH3_IsKnown ;The Pale: Heljarchen Hall Int OID_Toggle_BYOH3_OnNetwork Int OID_Toggle_RRSH_InGame Int OID_Toggle_RRSH_IsKnown Int OID_Toggle_RRSH_OnNetwork Int OID_Toggle_WiCHoA_InGame Int OID_Toggle_WiCHoA_IsKnown Int OID_Toggle_WiCHoA_OnNetwork Int OID_Toggle_RiRF_InGame Int OID_Toggle_RiRF_IsKnown Int OID_Toggle_RiRF_OnNetwork Event OnConfigInit() Pages = new string[4] Pages[0] = "Settings" Pages[1] = "Player Homes" Pages[2] = "Guild Halls" Pages[3] = "Apothecaries" EndEvent Event OnPageReset(string page) If(page=="") LoadCustomContent("My File Directory") Else UnloadCustomContent() EndIf ;================ ; Divider ;================ If (page == "Settings") SetCursorFillMode(TOP_TO_BOTTOM) AddHeaderOption("My Header") AddEmptyOption() AddToggleOption("Click me to toggle", TRUE) ElseIf(page == "Player Homes") ;SetCursorFillMode(TOP_TO_BOTTOM) SetCursorFillMode(LEFT_TO_RIGHT) AddHeaderOption("Whiterun: Breezehome") AddHeaderOption("Riften: Honeyside") OID_Toggle_WrBh_InGame = AddToggleOption("Breezehome MLB Door Is In Game", dw01_giInGame_WhiterunBreezehome.GetValue()) OID_Toggle_RiHs_InGame = AddToggleOption("Honeyside MLB Door Is In Game" , dw01_giInGame_RiftenHoneyside.GetValue()) OID_Toggle_WrBh_IsKnown = AddToggleOption("Breezehome MLB Door Is Known" , dw01_giKnown_WhiterunBreezehome.GetValue()) OID_Toggle_RiHs_IsKnown = AddToggleOption("Honeyside MLB Door Is Known" , dw01_giKnown_RiftenHoneyside.GetValue()) OID_Toggle_WrBh_OnNetwork = AddToggleOption("Breezehome MLB Door Is On Network" , dw01_gi_OnNetwork_00.GetValue()) OID_Toggle_RiHs_OnNetwork = AddToggleOption("Honeyside MLB Door Is On Network" , dw01_gi_OnNetwork_01.GetValue()) AddEmptyOption() AddEmptyOption() AddHeaderOption("Solitude: Proudspire Manor") AddHeaderOption("Markarath: Vlindrel Hall") OID_Toggle_SoPM_InGame = AddToggleOption("Proudspire Manor MLB Door Is In Game", dw01_giInGame_SolitudeProudspireManor.GetValue()) OID_Toggle_MaVH_InGame = AddToggleOption("Vlindrel Hall MLB Door Is In Game", dw01_giInGame_MarkarthVlindrelHall.GetValue()) OID_Toggle_SoPM_IsKnown = AddToggleOption("Proudspire Manor MLB Door Is Known", dw01_giKnown_SolitudeProudspireManor.GetValue()) OID_Toggle_MaVH_IsKnown = AddToggleOption("Vlindrel Hall MLB Door Is Known", dw01_giKnown_MarkarthVlindrelHall.GetValue()) OID_Toggle_SoPM_OnNetwork = AddToggleOption("Proudspire Manor MLB Door Is On Network", dw01_gi_OnNetwork_02.GetValue()) OID_Toggle_MaVH_OnNetwork = AddToggleOption("Vlindrel Hall MLB Door Is On Network", dw01_gi_OnNetwork_03.GetValue()) AddEmptyOption() AddEmptyOption() AddHeaderOption("Windhelm: Hjierm") AddHeaderOption("Falkreath: Lakeview Manor") OID_Toggle_WhmHj_InGame = AddToggleOption("Hjierm MLB Door Is In Game", dw01_giInGame_WindhelmHjierm.GetValue()) OID_Toggle_BYOH1_InGame = AddToggleOption("Lakeview Manor MLB Door Is In Game", dw01_giInGame_BY0H1.GetValue()) OID_Toggle_WhmHj_IsKnown = AddToggleOption("Hjierm MLB Door Is Known", dw01_giKnown_WindhelmHjierm.GetValue()) OID_Toggle_BYOH1_IsKnown = AddToggleOption("Lakeview Manor MLB Door Is Known", dw01_giKnown_BY0H1.GetValue()) OID_Toggle_WhmHj_OnNetwork = AddToggleOption("Hjierm MLB Door Is On Network", dw01_gi_OnNetwork_04.GetValue()) OID_Toggle_BYOH1_OnNetwork = AddToggleOption("Lakeview Manor MLB Door Is On Network", dw01_gi_OnNetwork_05.GetValue()) AddEmptyOption() AddEmptyOption() AddHeaderOption("Hjaalmarch: Windstad Manor") AddHeaderOption("The Pale: Heljarchen Hall") OID_Toggle_BYOH2_InGame = AddToggleOption("Windstad Manor MLB Door Is In Game", dw01_giInGame_BY0H2.GetValue()) OID_Toggle_BYOH3_InGame = AddToggleOption("Heljarchen Hall MLB Door Is In Game", dw01_giInGame_BY0H3.GetValue()) OID_Toggle_BYOH2_IsKnown = AddToggleOption("Windstad Manor MLB Door Is Known", dw01_giKnown_BY0H2.GetValue()) OID_Toggle_BYOH3_IsKnown = AddToggleOption("Heljarchen Hall MLB Door Is Known", dw01_giKnown_BY0H3.GetValue()) OID_Toggle_BYOH2_OnNetwork = AddToggleOption("Windstad Manor MLB Door Is On Network", dw01_gi_OnNetwork_06.GetValue()) OID_Toggle_BYOH3_OnNetwork = AddToggleOption("Heljarchen Hall MLB Door Is On Network", dw01_gi_OnNetwork_07.GetValue()) AddEmptyOption() AddEmptyOption() AddHeaderOption("Solstheim: Raven Rock") AddHeaderOption("") OID_Toggle_RRSH_InGame = AddToggleOption("Severin House MLB Door Is In Game", dw01_giInGame_RRSeverinHouse.GetValue()) AddEmptyOption() OID_Toggle_RRSH_IsKnown = AddToggleOption("Severin House MLB Door Is Known", dw01_giKnown_RRSeverinHouse.GetValue()) AddEmptyOption() OID_Toggle_RRSH_OnNetwork = AddToggleOption("Severin House MLB Door Is On Network", dw01_gi_OnNetwork_08.GetValue()) AddEmptyOption() ElseIf(page == "Guild Halls") SetCursorFillMode(TOP_TO_BOTTOM) AddEmptyOption() AddHeaderOption("Riften: The Ragged Flagon") OID_Toggle_RiRF_InGame = AddToggleOption("Hall of Attainment: Is In Game", dw01_giInGame_RiftenRaggedFlagon.GetValue()) OID_Toggle_RiRF_IsKnown = AddToggleOption("Hall of Attainment: Is Known", dw01_giKnown_RiftenRaggedFlagon.GetValue()) OID_Toggle_RiRF_OnNetwork = AddToggleOption("Hall of Attainment: Is On Network", dw01_gi_OnNetwork_09.GetValue()) AddEmptyOption() AddHeaderOption("Winterhold: College Hall of Attainment") OID_Toggle_WiCHoA_InGame = AddToggleOption("Hall of Attainment: Is In Game", dw01_giInGame_CollegeHallofAttainment.GetValue()) OID_Toggle_WiCHoA_IsKnown = AddToggleOption("Hall of Attainment: Is Known", dw01_giKnown_CollegeHallofAttainment.GetValue()) OID_Toggle_WiCHoA_OnNetwork = AddToggleOption("Hall of Attainment: Is On Network", dw01_gi_OnNetwork_10.GetValue()) AddEmptyOption() AddHeaderOption("Winterhold: Arch-Mage's Quarters") ;OID_Toggle_x_InGame = AddToggleOption("x: Is In Game", dw01_giInGame_x.GetValue()) ;OID_Toggle_x_IsKnown = AddToggleOption("x: Is Known", dw01_giKnown_x.GetValue()) AddEmptyOption() AddHeaderOption("Bards- Solitude: Bard's College") ;OID_Toggle_x_InGame = AddToggleOption("x: Is In Game", dw01_giInGame_x.GetValue()) ;OID_Toggle_x_IsKnown = AddToggleOption("x: Is Known", dw01_giKnown_x.GetValue()) AddEmptyOption() AddHeaderOption("Companions- Whiterun: Jorrvaskr Living Quarters") ;OID_Toggle_x_InGame = AddToggleOption("x: Is In Game", dw01_giInGame_x.GetValue()) ;OID_Toggle_x_IsKnown = AddToggleOption("x: Is Known", dw01_giKnown_x.GetValue()) AddEmptyOption() AddHeaderOption("Dark Brotherhood - Near Falreath: Dark Brotherhood Sanctuary") ;OID_Toggle_x_InGame = AddToggleOption("x: Is In Game", dw01_giInGame_x.GetValue()) ;OID_Toggle_x_IsKnown = AddToggleOption("x: Is Known", dw01_giKnown_x.GetValue()) AddEmptyOption() AddHeaderOption("Dark Brotherhood - Dawnstar: Dawnstar Sanctuary") ;OID_Toggle_x_InGame = AddToggleOption("x: Is In Game", dw01_giInGame_x.GetValue()) ;OID_Toggle_x_IsKnown = AddToggleOption("x: Is Known", dw01_giKnown_x.GetValue()) ElseIf(page == "Apothecaries") SetCursorFillMode(TOP_TO_BOTTOM) AddEmptyOption() AddHeaderOption("Alchemists") ;OID_Toggle_x_InGame = AddToggleOption("x: Is In Game", dw01_giInGame_x.GetValue()) ;OID_Toggle_x_IsKnown = AddToggleOption("x: Is Known", dw01_giKnown_x.GetValue()) EndIf EndEvent Event OnOptionSelect(int option) ;|||||||||||||| Whiterun Breezehome ||||||||||||||||||| if(option == OID_Toggle_WrBh_InGame) If dw01_giInGame_WhiterunBreezehome.GetValue()==1 dw01_giInGame_WhiterunBreezehome.SetValue(0) SetToggleOptionValue(OID_Toggle_WrBh_InGame, 0) dw01DoorFromBreezehome.Disable() dw01DoorToBreezehome.Disable() ElseIf dw01_giInGame_WhiterunBreezehome.GetValue()==0 dw01_giInGame_WhiterunBreezehome.SetValue(1) SetToggleOptionValue(OID_Toggle_WrBh_InGame, 1) dw01DoorFromBreezehome.Enable() If dw01_giKnown_WhiterunBreezehome.GetValue()==1 dw01DoorToBreezehome.Enable() EndIf EndIf ElseIf (option == OID_Toggle_WrBh_IsKnown) If dw01_giKnown_WhiterunBreezehome.GetValue()==1 dw01_giKnown_WhiterunBreezehome.SetValue(0) SetToggleOptionValue(OID_Toggle_WrBh_IsKnown, 0) dw01DoorToBreezehome.Disable() ElseIf dw01_giKnown_WhiterunBreezehome.GetValue()==0 dw01_giKnown_WhiterunBreezehome.SetValue(1) SetToggleOptionValue(OID_Toggle_WrBh_IsKnown, 1) If dw01_giInGame_WhiterunBreezehome.GetValue()==1 dw01DoorToBreezehome.Enable() EndIf EndIf ;|||||||||||||||||| Riften Honeyside ||||||||||||||||||| ElseIf (option == OID_Toggle_RiHs_InGame) If dw01_giInGame_RiftenHoneyside.GetValue()==1 dw01_giInGame_RiftenHoneyside.SetValue(0) SetToggleOptionValue(OID_Toggle_RiHs_InGame, 0) dw01DoorFromHoneyside.Disable() dw01DoorToHoneyside.Disable() ElseIf dw01_giInGame_RiftenHoneyside.GetValue()==0 dw01_giInGame_RiftenHoneyside.SetValue(1) SetToggleOptionValue(OID_Toggle_RiHs_InGame, 1) dw01DoorFromHoneyside.Enable() If dw01_giKnown_RiftenHoneyside.GetValue()==1 dw01DoorToHoneyside.Enable() EndIf EndIf ElseIf (option == OID_Toggle_RiHs_IsKnown) If dw01_giKnown_RiftenHoneyside.GetValue()==1 dw01_giKnown_RiftenHoneyside.SetValue(0) SetToggleOptionValue(OID_Toggle_RiHs_IsKnown, 0) dw01DoorToHoneyside.Disable() ElseIf dw01_giKnown_RiftenHoneyside.GetValue()==0 dw01_giKnown_RiftenHoneyside.SetValue(1) SetToggleOptionValue(OID_Toggle_RiHs_IsKnown, 1) If dw01_giInGame_RiftenHoneyside.GetValue()==1 dw01DoorToHoneyside.Enable() EndIf EndIf ;|||||||||||||||||| Solitude Proudspire Manor ||||||||||||||||||| ElseIf (option == OID_Toggle_SoPM_InGame) If dw01_giInGame_SolitudeProudspireManor.GetValue()==1 dw01_giInGame_SolitudeProudspireManor.SetValue(0) SetToggleOptionValue(OID_Toggle_SoPM_InGame, 0) dw01DoorFromProudspireManor.Disable() dw01DoorToProudspireManor.Disable() ElseIf dw01_giInGame_SolitudeProudspireManor.GetValue()==0 dw01_giInGame_SolitudeProudspireManor.SetValue(1) SetToggleOptionValue(OID_Toggle_SoPM_InGame, 1) dw01DoorFromProudspireManor.Enable() If dw01_giKnown_SolitudeProudspireManor.GetValue()==1 dw01DoorToProudspireManor.Enable() EndIf EndIf ElseIf (option == OID_Toggle_SoPM_IsKnown) If dw01_giKnown_SolitudeProudspireManor.GetValue()==1 dw01_giKnown_SolitudeProudspireManor.SetValue(0) SetToggleOptionValue(OID_Toggle_SoPM_IsKnown, 0) dw01DoorToProudspireManor.Disable() ElseIf dw01_giKnown_SolitudeProudspireManor.GetValue()==0 dw01_giKnown_SolitudeProudspireManor.SetValue(1) SetToggleOptionValue(OID_Toggle_SoPM_IsKnown, 1) If dw01_giInGame_SolitudeProudspireManor.GetValue()==1 dw01DoorToProudspireManor.Enable() EndIf EndIf ;|||||||||||||||||| Windhelm Hjierm ||||||||||||||||||| ElseIf (option == OID_Toggle_WhmHj_InGame) If dw01_giInGame_WindhelmHjierm.GetValue()==1 dw01_giInGame_WindhelmHjierm.SetValue(0) SetToggleOptionValue(OID_Toggle_WhmHj_InGame, 0) dw01DoorFromHjerim.Disable() dw01DoorToHjerim.Disable() ElseIf dw01_giInGame_WindhelmHjierm.GetValue()==0 dw01_giInGame_WindhelmHjierm.SetValue(1) SetToggleOptionValue(OID_Toggle_WhmHj_InGame, 1) dw01DoorFromHjerim.Enable() If dw01_giKnown_WindhelmHjierm.GetValue()==1 dw01DoorToHjerim.Enable() EndIf EndIf ElseIf (option == OID_Toggle_WhmHj_IsKnown) If dw01_giKnown_WindhelmHjierm.GetValue()==1 dw01_giKnown_WindhelmHjierm.SetValue(0) SetToggleOptionValue(OID_Toggle_WhmHj_IsKnown, 0) dw01DoorToHjerim.Disable() ElseIf dw01_giKnown_WindhelmHjierm.GetValue()==0 dw01_giKnown_WindhelmHjierm.SetValue(1) SetToggleOptionValue(OID_Toggle_WhmHj_IsKnown, 1) If dw01_giInGame_WindhelmHjierm.GetValue()==1 dw01DoorToHjerim.Enable() EndIf EndIf ;|||||||||||||||||| Markarath Vlindrel Hall ||||||||||||||||||| ElseIf (option == OID_Toggle_MaVH_InGame) If dw01_giInGame_MarkarthVlindrelHall.GetValue()==1 dw01_giInGame_MarkarthVlindrelHall.SetValue(0) SetToggleOptionValue(OID_Toggle_MaVH_InGame, 0) dw01DoorFromVlindrelHall.Disable() dw01DoorToVlindrelHall.Disable() ElseIf dw01_giInGame_MarkarthVlindrelHall.GetValue()==0 dw01_giInGame_MarkarthVlindrelHall.SetValue(1) SetToggleOptionValue(OID_Toggle_MaVH_InGame, 1) dw01DoorFromVlindrelHall.Enable() If dw01_giKnown_MarkarthVlindrelHall.GetValue()==1 dw01DoorToVlindrelHall.Enable() EndIf EndIf ElseIf (option == OID_Toggle_MaVH_IsKnown) If dw01_giKnown_MarkarthVlindrelHall.GetValue()==1 dw01_giKnown_MarkarthVlindrelHall.SetValue(0) SetToggleOptionValue(OID_Toggle_MaVH_IsKnown, 0) dw01DoorToVlindrelHall.Disable() ElseIf dw01_giKnown_MarkarthVlindrelHall.GetValue()==0 dw01_giKnown_MarkarthVlindrelHall.SetValue(1) SetToggleOptionValue(OID_Toggle_MaVH_IsKnown, 1) If dw01_giInGame_MarkarthVlindrelHall.GetValue()==1 dw01DoorToVlindrelHall.Enable() EndIf EndIf ;|||||||||||||||||| BYOH1 ||||||||||||||||||| ElseIf (option == OID_Toggle_BYOH1_InGame) If dw01_giInGame_BY0H1.GetValue()==1 dw01_giInGame_BY0H1.SetValue(0) SetToggleOptionValue(OID_Toggle_BYOH1_InGame, 0) dw01DoorFromBYOH1.Disable() dw01DoorToBYOH1.Disable() ElseIf dw01_giInGame_BY0H1.GetValue()==0 dw01_giInGame_BY0H1.SetValue(1) SetToggleOptionValue(OID_Toggle_BYOH1_InGame, 1) dw01DoorFromBYOH1.Enable() If dw01_giKnown_BY0H1.GetValue()==1 dw01DoorToBYOH1.Enable() EndIf EndIf ElseIf (option == OID_Toggle_BYOH1_IsKnown) If dw01_giKnown_BY0H1.GetValue()==1 dw01_giKnown_BY0H1.SetValue(0) SetToggleOptionValue(OID_Toggle_BYOH1_IsKnown, 0) dw01DoorToBYOH1.Disable() ElseIf dw01_giKnown_BY0H1.GetValue()==0 dw01_giKnown_BY0H1.SetValue(1) SetToggleOptionValue(OID_Toggle_BYOH1_IsKnown, 1) If dw01_giInGame_BY0H1.GetValue()==1 dw01DoorToBYOH1.Enable() EndIf EndIf ;|||||||||||||||||| BYOH2 ||||||||||||||||||| ElseIf (option == OID_Toggle_BYOH2_InGame) If dw01_giInGame_BY0H2.GetValue()==1 dw01_giInGame_BY0H2.SetValue(0) SetToggleOptionValue(OID_Toggle_BYOH2_InGame, 0) dw01DoorFromBYOH2.Disable() dw01DoorToBYOH2.Disable() ElseIf dw01_giInGame_BY0H2.GetValue()==0 dw01_giInGame_BY0H2.SetValue(1) SetToggleOptionValue(OID_Toggle_BYOH2_InGame, 1) dw01DoorFromBYOH2.Enable() If dw01_giKnown_BY0H2.GetValue()==1 dw01DoorToBYOH2.Enable() EndIf EndIf ElseIf (option == OID_Toggle_BYOH2_IsKnown) If dw01_giKnown_BY0H2.GetValue()==1 dw01_giKnown_BY0H2.SetValue(0) SetToggleOptionValue(OID_Toggle_BYOH2_IsKnown, 0) dw01DoorToBYOH2.Disable() ElseIf dw01_giKnown_BY0H2.GetValue()==0 dw01_giKnown_BY0H2.SetValue(1) SetToggleOptionValue(OID_Toggle_BYOH2_IsKnown, 1) If dw01_giInGame_BY0H2.GetValue()==1 dw01DoorToBYOH2.Enable() EndIf EndIf ;|||||||||||||||||| BYOH3 ||||||||||||||||||| ElseIf (option == OID_Toggle_BYOH3_InGame) If dw01_giInGame_BY0H3.GetValue()==1 dw01_giInGame_BY0H3.SetValue(0) SetToggleOptionValue(OID_Toggle_BYOH3_InGame, 0) dw01DoorFromBYOH3.Disable() dw01DoorToBYOH3.Disable() ElseIf dw01_giInGame_BY0H3.GetValue()==0 dw01_giInGame_BY0H3.SetValue(1) SetToggleOptionValue(OID_Toggle_BYOH3_InGame, 1) dw01DoorFromBYOH3.Enable() If dw01_giKnown_BY0H3.GetValue()==1 dw01DoorToBYOH3.Enable() EndIf EndIf ElseIf (option == OID_Toggle_BYOH3_IsKnown) If dw01_giKnown_BY0H3.GetValue()==1 dw01_giKnown_BY0H3.SetValue(0) SetToggleOptionValue(OID_Toggle_BYOH3_IsKnown, 0) dw01DoorToBYOH3.Disable() ElseIf dw01_giKnown_BY0H3.GetValue()==0 dw01_giKnown_BY0H3.SetValue(1) SetToggleOptionValue(OID_Toggle_BYOH3_IsKnown, 1) If dw01_giInGame_BY0H3.GetValue()==1 dw01DoorToBYOH3.Enable() EndIf EndIf ;|||||||||||||| Raven Rock Severin House ||||||||||||||||||| ElseIf (option == OID_Toggle_RRSH_InGame) If dw01_giInGame_RRSeverinHouse.GetValue()==1 dw01_giInGame_RRSeverinHouse.SetValue(0) SetToggleOptionValue(OID_Toggle_RRSH_InGame, 0) dw01DoorFromSeverinHouse.Disable() dw01DoorToSeverinHouse.Disable() ElseIf dw01_giInGame_RRSeverinHouse.GetValue()==0 dw01_giInGame_RRSeverinHouse.SetValue(1) SetToggleOptionValue(OID_Toggle_RRSH_InGame, 1) dw01DoorFromSeverinHouse.Enable() If dw01_giKnown_RRSeverinHouse.GetValue()==1 dw01DoorToSeverinHouse.Enable() EndIf EndIf ElseIf (option == OID_Toggle_RRSH_IsKnown) If dw01_giKnown_RRSeverinHouse.GetValue()==1 dw01_giKnown_RRSeverinHouse.SetValue(0) SetToggleOptionValue(OID_Toggle_RRSH_IsKnown, 0) dw01DoorToSeverinHouse.Disable() ElseIf dw01_giKnown_RRSeverinHouse.GetValue()==0 dw01_giKnown_RRSeverinHouse.SetValue(1) SetToggleOptionValue(OID_Toggle_RRSH_IsKnown, 1) If dw01_giInGame_RRSeverinHouse.GetValue()==1 dw01DoorToSeverinHouse.Enable() EndIf EndIf ;|||||||||||||| Riften Raggard Flaggon ||||||||||||||||||| ElseIf (option == OID_Toggle_RiRF_InGame) If dw01_giInGame_RiftenRaggedFlagon.GetValue()==1 dw01_giInGame_RiftenRaggedFlagon.SetValue(0) SetToggleOptionValue(OID_Toggle_RiRF_InGame, 0) dw01DoorFromRiftenRaggedFlagon.Disable() dw01DoorToRiftenRaggedFlagon.Disable() ElseIf dw01_giInGame_RiftenRaggedFlagon.GetValue()==0 dw01_giInGame_RiftenRaggedFlagon.SetValue(1) SetToggleOptionValue(OID_Toggle_RiRF_InGame, 1) dw01DoorFromRiftenRaggedFlagon.Enable() If dw01_giKnown_RiftenRaggedFlagon.GetValue()==1 dw01DoorToRiftenRaggedFlagon.Enable() EndIf EndIf ElseIf (option == OID_Toggle_RiRF_IsKnown) If dw01_giKnown_RiftenRaggedFlagon.GetValue()==1 dw01_giKnown_RiftenRaggedFlagon.SetValue(0) SetToggleOptionValue(OID_Toggle_RiRF_IsKnown, 0) dw01DoorToRiftenRaggedFlagon.Disable() ElseIf dw01_giKnown_RiftenRaggedFlagon.GetValue()==0 dw01_giKnown_RiftenRaggedFlagon.SetValue(1) SetToggleOptionValue(OID_Toggle_RiRF_IsKnown, 1) If dw01_giInGame_RiftenRaggedFlagon.GetValue()==1 dw01DoorToRiftenRaggedFlagon.Enable() EndIf EndIf ;|||||||||||||| Winterhold College Hall of Attainment ||||||||||||||||||| ElseIf (option == OID_Toggle_WiCHoA_InGame) If dw01_giInGame_CollegeHallofAttainment.GetValue()==1 dw01_giInGame_CollegeHallofAttainment.SetValue(0) SetToggleOptionValue(OID_Toggle_WiCHoA_InGame, 0) dw01DoorFromWinterholdCollegeHallofAttainment.Disable() dw01DoorToWinterholdCollegeHallofAttainment.Disable() ElseIf dw01_giInGame_CollegeHallofAttainment.GetValue()==0 dw01_giInGame_CollegeHallofAttainment.SetValue(1) SetToggleOptionValue(OID_Toggle_WiCHoA_InGame, 1) dw01DoorFromWinterholdCollegeHallofAttainment.Enable() If dw01_giKnown_CollegeHallofAttainment.GetValue()==1 dw01DoorToWinterholdCollegeHallofAttainment.Enable() EndIf EndIf ElseIf (option == OID_Toggle_WiCHoA_IsKnown) If dw01_giKnown_CollegeHallofAttainment.GetValue()==1 dw01_giKnown_CollegeHallofAttainment.SetValue(0) SetToggleOptionValue(OID_Toggle_WiCHoA_IsKnown, 0) dw01DoorToWinterholdCollegeHallofAttainment.Disable() ElseIf dw01_giKnown_CollegeHallofAttainment.GetValue()==0 dw01_giKnown_CollegeHallofAttainment.SetValue(1) SetToggleOptionValue(OID_Toggle_WiCHoA_IsKnown, 1) If dw01_giInGame_CollegeHallofAttainment.GetValue()==1 dw01DoorToWinterholdCollegeHallofAttainment.Enable() EndIf EndIf EndIf EndEvent So, I am thinking that using Global Variables is not ideal. It seems to me that it would be better if I could just add four properties to a base door, lets call it MyDoor MyDoor.IsKnownMyDoor.IsInGameMyDoor.IsOnNetworkMyDoor.Index Scriptname dw01_MLB_Door extends ObjectReference ;||||||||||||||||||||||| 1=TRUE 0=FALSE ||||||||||||||||||||||| Int Property Index Auto ;Used to track which door is the Active Door Int Property IsInGame Auto ;User decides if door is available in game Int Property IsKnown Auto ;Has Player Used the door yet Int Property IsOnNetwork Auto ;Does door into MLB allow other exit options through other doors Then I use this door as the Parent, and make 11 Child copiesMyDoor00 ... MyDoor11And they all have the properties. I can then add these doors to a FormList and loop through the list getting the properties (IsInGame, IsKnown, IsOnNetwork) on that door to decide if the door should be enabled. Is this how I should be doing this? Will I still need to use one global for each door and each of the properties to interact with the MCM? I appreciate any advice. Have a great day! Edited March 14, 2021 by tamtastic Link to comment Share on other sites More sharing options...
IsharaMeradin Posted March 14, 2021 Share Posted March 14, 2021 If you are putting the doors into a formlist, you just need the formlist property. Everything else can be referenced in arrays for the MCM to work with FormList Property DoorList Auto dw01_MLB_Door DoorScript Int[] DoorIndex ;do the same with the others Event OnConfigInit() DoorIndex = new Int[12] ;do the same with the others ;Then you can get the starting property values from each by doing the following: Int idx = 0 While idx < DoorList.GetSize() DoorScript = (DoorList.GetAt(idx) as ObjectReference) as dw01_MLB_Door DoorIndex[idx] = DoorScript.Index ;do the same with the others idx += 1 EndWhile EndEvent For the option selections you can change the array value as needed. To actually change the values of properties on the various doors Event OnConfigClose() RegisterForSingleUpdate(0.1) EndEvent Event OnUpdate() Int idx = 0 While idx < DoorList.GetSize() DoorScript = (DoorList.GetAt(idx) as ObjectReference) as dw01_MLB_Door DoorScript.Index = DoorIndex[idx] ;do the same with the others idx += 1 EndWhile EndEvent Link to comment Share on other sites More sharing options...
tamtastic Posted March 14, 2021 Author Share Posted March 14, 2021 Thank you IsharaMeradin. I appreciate your guidance. I will make this work. Cheers! Link to comment Share on other sites More sharing options...
IsharaMeradin Posted March 14, 2021 Share Posted March 14, 2021 Forgot to include that if you want / need to force the OnConfigInit event to run again after the mod has already been active you can do that with a bit of "versioning" Int function GetVersion() return 2 ; Default version endFunction Event OnVersionUpdate(int version) If version > 1 OnConfigInit() EndIf EndEvent Link to comment Share on other sites More sharing options...
tamtastic Posted March 15, 2021 Author Share Posted March 15, 2021 (edited) Wow. IsharaMeradin I truly appreciate your help. I have it working using formlists and arrays! Now I just have 40+ global variables I can release back into the wilds of Skyrim. Global Variables (Globs) will never again tremble in my presence. Your post is a coding lesson in itself. I am going to make sure I understand every part of it. The biggest help was demonstrating how to actually attach and use a Script (DoorScript). I am so elated to finally understand this. I posted the whole code (even though it is still not a finished MCM) incase anybody else is struggling with using arrays and formlists. Yes, there are still some gratitous global variables, sorry Globs looks like you are not completely safe after all. One other thing I learned, this forum editor does not like Tabs for indentation, so I did a mass convert of Tabs to spaces (Thanks Notepad++). Thank you again IsharaMeradin! Scriptname dw01_MLB_Door extends ObjectReference Int Property Index Auto ;Set Index for FormList Int Property InGame Auto ;User decides if door is available in game Int Property Known Auto ;Has Player Used the door yet Int Property OnNetwork Auto ;Does door into MLB allow other exit options through other doors ;Index ; 00 Breezehome ; 01 Honeyside ; 02 ProudspireManor ; 03 VlindrelHall ; 04 Hjierm ; 05 BYOH1 ; 06 BYOH2 ; 07 BYOH3 ; 08 SeverinHouse ; 09 RiftenRaggedFlagon ; 10 WinterholdCollegeHallofAttainment Scriptname dw01_MLB_MCM extends SKI_ConfigBase Int OID_Toggle_WrBh_InGame Int OID_Toggle_WrBh_IsKnown Int OID_Toggle_WrBh_OnNetwork Int OID_Toggle_SoPM_InGame Int OID_Toggle_SoPM_IsKnown Int OID_Toggle_SoPM_OnNetwork Int OID_Toggle_RiHs_InGame Int OID_Toggle_RiHs_IsKnown Int OID_Toggle_RiHs_OnNetwork Int OID_Toggle_WhmHj_InGame Int OID_Toggle_WhmHj_IsKnown Int OID_Toggle_WhmHj_OnNetwork Int OID_Toggle_MaVH_InGame Int OID_Toggle_MaVH_IsKnown Int OID_Toggle_MaVH_OnNetwork Int OID_Toggle_BYOH1_InGame ;Falkreath: Lakeview Manor Int OID_Toggle_BYOH1_IsKnown ;Falkreath: Lakeview Manor Int OID_Toggle_BYOH1_OnNetwork Int OID_Toggle_BYOH2_InGame ;Hjaalmarch: Windstad Manor Int OID_Toggle_BYOH2_IsKnown ;Hjaalmarch: Windstad Manor Int OID_Toggle_BYOH2_OnNetwork Int OID_Toggle_BYOH3_InGame ;The Pale: Heljarchen Hall Int OID_Toggle_BYOH3_IsKnown ;The Pale: Heljarchen Hall Int OID_Toggle_BYOH3_OnNetwork Int OID_Toggle_RRSH_InGame Int OID_Toggle_RRSH_IsKnown Int OID_Toggle_RRSH_OnNetwork Int OID_Toggle_WiCHoA_InGame Int OID_Toggle_WiCHoA_IsKnown Int OID_Toggle_WiCHoA_OnNetwork Int OID_Toggle_RiRF_InGame Int OID_Toggle_RiRF_IsKnown Int OID_Toggle_RiRF_OnNetwork GlobalVariable Property SliderA Auto Int OID_SliderA Int iSlider_max = 10 ;0 to 10 doors so far therefore 11 Int iSlider_default = 0 ;Breezehome GlobalVariable Property dw01_gi_CurrentDoor Auto FormList Property DoorList Auto ;dw01_MLB_DoorToList Auto FormList Property DoorFromList Auto dw01_MLB_Door DoorScript Int[] DoorIndex ;Index For Door Int[] aiInGame Int[] aiKnown Int[] aiOnNetwork GlobalVariable Property dw01_gci_00_Breezehome auto GlobalVariable Property dw01_gci_01_Honeyside auto GlobalVariable Property dw01_gci_02_ProudSpireManor auto GlobalVariable Property dw01_gci_03_VlindrelHall auto GlobalVariable Property dw01_gci_04_Hjerim auto GlobalVariable Property dw01_gci_05_BYOH1 auto GlobalVariable Property dw01_gci_06_BYOH2 auto GlobalVariable Property dw01_gci_07_BYOH3 auto GlobalVariable Property dw01_gci_08_SeverinHouse auto GlobalVariable Property dw01_gci_09_RiftenRaggedFlagon auto GlobalVariable Property dw01_gci_10_WinterholdCollegeHallofAttainment auto Int iWrBh Int iRiHs Int iSoPM Int iMaVH Int iWhmHj Int iBYOH1 Int iBYOH2 Int iBYOH3 Int iRRSH Int iRiRF Int iWiCHoA Event OnConfigInit() Pages = new string[4] Pages[0] = "Settings" Pages[1] = "Player Homes" Pages[2] = "Guild Halls" Pages[3] = "Apothecaries" DoorIndex = new Int[11] aiInGame = new Int[11] aiKnown = new Int[11] aiOnNetwork = new Int[11] iWrBh = dw01_gci_00_Breezehome.GetValueInt() iRiHs = dw01_gci_01_Honeyside.GetValueInt() iSoPM = dw01_gci_02_ProudSpireManor.GetValueInt() iMaVH = dw01_gci_03_VlindrelHall.GetValueInt() iWhmHj = dw01_gci_04_Hjerim.GetValueInt() iBYOH1 = dw01_gci_05_BYOH1.GetValueInt() iBYOH2 = dw01_gci_06_BYOH2.GetValueInt() iBYOH3 = dw01_gci_07_BYOH3.GetValueInt() iRRSH = dw01_gci_08_SeverinHouse.GetValueInt() iRiRF = dw01_gci_09_RiftenRaggedFlagon.GetValueInt() iWiCHoA = dw01_gci_10_WinterholdCollegeHallofAttainment.GetValueInt() ;Get Starting Properties Int idx = 0 debug.notification("3 DoorList.GetSize()=" + DoorList.GetSize()) While idx < DoorList.GetSize() DoorScript = (DoorList.GetAt(idx) as ObjectReference) as dw01_MLB_Door DoorIndex[idx] = DoorScript.Index aiInGame[idx] = DoorScript.InGame aiKnown[idx] = DoorScript.Known aiOnNetwork[idx] = DoorScript.OnNetwork idx += 1 EndWhile EndEvent Int function GetVersion() return 2 ; Default version endFunction Event OnVersionUpdate(int version) If version > 1 OnConfigInit() EndIf EndEvent Event OnPageReset(string page) If(page=="") LoadCustomContent("My File Directory") Else UnloadCustomContent() EndIf ;================ ; Divider ;================ If (page == "Settings") SetCursorFillMode(TOP_TO_BOTTOM) AddHeaderOption("My Header") AddEmptyOption() AddToggleOption("Click me to toggle", TRUE) ;iSlider_default=(dw01_gi_CurrentDoor.GetValue()) OID_SliderA = AddSliderOption("Current Active Door", SliderA.GetValue(), "{0}") ElseIf(page == "Player Homes") ;SetCursorFillMode(TOP_TO_BOTTOM) SetCursorFillMode(LEFT_TO_RIGHT) AddHeaderOption("Whiterun: Breezehome") AddHeaderOption("Riften: Honeyside") OID_Toggle_WrBh_InGame = AddToggleOption("Breezehome MLB Door Is In Game", aiInGame[iWrBh]) OID_Toggle_RiHs_InGame = AddToggleOption("Honeyside MLB Door Is In Game" , aiInGame[iRiHs]) OID_Toggle_WrBh_IsKnown = AddToggleOption("Breezehome MLB Door Is Known" , aiKnown[iWrBh]) OID_Toggle_RiHs_IsKnown = AddToggleOption("Honeyside MLB Door Is Known" , aiKnown[iRiHs]) OID_Toggle_WrBh_OnNetwork = AddToggleOption("Breezehome MLB Door Is On Network" , aiOnNetwork[iWrBh]) OID_Toggle_RiHs_OnNetwork = AddToggleOption("Honeyside MLB Door Is On Network" , aiOnNetwork[iRiHs]) AddEmptyOption() AddEmptyOption() AddHeaderOption("Solitude: Proudspire Manor") AddHeaderOption("Markarath: Vlindrel Hall") OID_Toggle_SoPM_InGame = AddToggleOption("Proudspire Manor MLB Door Is In Game", aiInGame[iSoPM]) OID_Toggle_MaVH_InGame = AddToggleOption("Vlindrel Hall MLB Door Is In Game", aiInGame[iMaVH]) OID_Toggle_SoPM_IsKnown = AddToggleOption("Proudspire Manor MLB Door Is Known", aiKnown[iSoPM]) OID_Toggle_MaVH_IsKnown = AddToggleOption("Vlindrel Hall MLB Door Is Known", aiKnown[iMaVH]) OID_Toggle_SoPM_OnNetwork = AddToggleOption("Proudspire Manor MLB Door Is On Network", aiOnNetwork[iSoPM]) OID_Toggle_MaVH_OnNetwork = AddToggleOption("Vlindrel Hall MLB Door Is On Network", aiOnNetwork[iMaVH]) AddEmptyOption() AddEmptyOption() AddHeaderOption("Windhelm: Hjierm") AddHeaderOption("Falkreath: Lakeview Manor") OID_Toggle_WhmHj_InGame = AddToggleOption("Hjierm MLB Door Is In Game", aiInGame[iWhmHj]) OID_Toggle_BYOH1_InGame = AddToggleOption("Lakeview Manor MLB Door Is In Game", aiInGame[iBYOH1]) OID_Toggle_WhmHj_IsKnown = AddToggleOption("Hjierm MLB Door Is Known", aiKnown[iWhmHj]) OID_Toggle_BYOH1_IsKnown = AddToggleOption("Lakeview Manor MLB Door Is Known", aiKnown[iBYOH1]) OID_Toggle_WhmHj_OnNetwork = AddToggleOption("Hjierm MLB Door Is On Network", aiOnNetwork[iWhmHj]) OID_Toggle_BYOH1_OnNetwork = AddToggleOption("Lakeview Manor MLB Door Is On Network", aiOnNetwork[iBYOH1]) AddEmptyOption() AddEmptyOption() AddHeaderOption("Hjaalmarch: Windstad Manor") AddHeaderOption("The Pale: Heljarchen Hall") OID_Toggle_BYOH2_InGame = AddToggleOption("Windstad Manor MLB Door Is In Game", aiInGame[iBYOH2]) OID_Toggle_BYOH3_InGame = AddToggleOption("Heljarchen Hall MLB Door Is In Game", aiInGame[iBYOH3]) OID_Toggle_BYOH2_IsKnown = AddToggleOption("Windstad Manor MLB Door Is Known", aiKnown[iBYOH2]) OID_Toggle_BYOH3_IsKnown = AddToggleOption("Heljarchen Hall MLB Door Is Known", aiKnown[iBYOH3]) OID_Toggle_BYOH2_OnNetwork = AddToggleOption("Windstad Manor MLB Door Is On Network", aiOnNetwork[iBYOH2]) OID_Toggle_BYOH3_OnNetwork = AddToggleOption("Heljarchen Hall MLB Door Is On Network", aiOnNetwork[iBYOH3]) AddEmptyOption() AddEmptyOption() AddHeaderOption("Solstheim: Raven Rock") AddHeaderOption("") OID_Toggle_RRSH_InGame = AddToggleOption("Severin House MLB Door Is In Game", aiInGame[iRRSH]) AddEmptyOption() OID_Toggle_RRSH_IsKnown = AddToggleOption("Severin House MLB Door Is Known", aiKnown[iRRSH]) AddEmptyOption() OID_Toggle_RRSH_OnNetwork = AddToggleOption("Severin House MLB Door Is On Network", aiOnNetwork[iRRSH]) AddEmptyOption() ElseIf(page == "Guild Halls") SetCursorFillMode(TOP_TO_BOTTOM) AddEmptyOption() AddHeaderOption("Riften: The Ragged Flagon") OID_Toggle_RiRF_InGame = AddToggleOption("Hall of Attainment: Is In Game", aiInGame[iRiRF]) OID_Toggle_RiRF_IsKnown = AddToggleOption("Hall of Attainment: Is Known", aiKnown[iRiRF]) OID_Toggle_RiRF_OnNetwork = AddToggleOption("Hall of Attainment: Is On Network", aiOnNetwork[iRiRF]) AddEmptyOption() AddHeaderOption("Winterhold: College Hall of Attainment") OID_Toggle_WiCHoA_InGame = AddToggleOption("Hall of Attainment: Is In Game", aiInGame[iWiCHoA]) OID_Toggle_WiCHoA_IsKnown = AddToggleOption("Hall of Attainment: Is Known", aiKnown[iWiCHoA]) OID_Toggle_WiCHoA_OnNetwork = AddToggleOption("Hall of Attainment: Is On Network", aiOnNetwork[iWiCHoA]) ElseIf(page == "Apothecaries") SetCursorFillMode(TOP_TO_BOTTOM) AddEmptyOption() AddHeaderOption("Alchemists") ;OID_Toggle_x_InGame = AddToggleOption("x: Is In Game", dw01_giInGame_x.GetValue()) ;OID_Toggle_x_IsKnown = AddToggleOption("x: Is Known", dw01_giKnown_x.GetValue()) EndIf EndEvent Event OnOptionSelect(int option) ;First Toggle/Update MCM display and respective globals UpdateMCMDisplay(option) EndEvent Event OnConfigClose() RegisterForSingleUpdate(0.1) EndEvent Event OnUpdate() Int iCurrentDoor = dw01_gi_CurrentDoor.GetValueInt() Int iCurrentDoorOnNetwork = aiOnNetwork[iCurrentDoor] Debug.Notification("Current Active Door=" + iCurrentDoor) Int idx = 0 While idx < DoorList.GetSize() DoorScript = (DoorList.GetAt(idx) as ObjectReference) as dw01_MLB_Door ;DoorScript.Index = DoorIndex[idx] ;This one does not change DoorScript.InGame = aiInGame[idx] DoorScript.Known = aiKnown[idx] DoorScript.OnNetwork = aiOnNetwork[idx] ObjectReference kRefDoorTo = DoorList.GetAt(idx) As ObjectReference ObjectReference kRefDoorFrom = DoorFromList.GetAt(idx) As ObjectReference ;do the same with the others If aiInGame[idx]*aiKnown[idx]*aiOnNetwork[idx]*iCurrentDoorOnNetwork>0 kRefDoorTo.Enable() ElseIf idx==iCurrentDoor ;Ignore if InGame or IsKnown cause you need a door to exit kRefDoorTo.Enable() else kRefDoorTo.Disable() EndIf ;The FromSkyrim Doors If InGame==1 are always Enabled If aiInGame[idx]==1 kRefDoorFrom.Enable() else kRefDoorFrom.Disable() EndIf idx += 1 EndWhile EndEvent Function UpdateMCMDisplay(int option) ;|||| 00 00 00 ||| WhiterunBreezehome ||| 00 00 00 ||| if(option == OID_Toggle_WrBh_InGame) If aiInGame[iWrBh]==1 aiInGame[iWrBh]=0 SetToggleOptionValue(OID_Toggle_WrBh_InGame, 0) Else aiInGame[iWrBh]=1 SetToggleOptionValue(OID_Toggle_WrBh_InGame, 1) EndIf ElseIf (option == OID_Toggle_WrBh_IsKnown) If aiKnown[iWrBh]==1 aiKnown[iWrBh]=0 SetToggleOptionValue(OID_Toggle_WrBh_IsKnown, 0) Else aiKnown[iWrBh]=1 SetToggleOptionValue(OID_Toggle_WrBh_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_WrBh_OnNetwork) If aiOnNetwork[iWrBh]==1 aiOnNetwork[iWrBh]=0 SetToggleOptionValue(OID_Toggle_WrBh_OnNetwork, 0) Else aiOnNetwork[iWrBh]=1 SetToggleOptionValue(OID_Toggle_WrBh_OnNetwork, 1) EndIf ; iRiHs |||| 01 01 01 ||| Honeyside ||| 01 01 01 ||| iRiHs ElseIf(option == OID_Toggle_RiHs_InGame) If aiInGame[iRiHs]==1 aiInGame[iRiHs]=0 SetToggleOptionValue(OID_Toggle_RiHs_InGame, 0) Else aiInGame[iRiHs]=1 SetToggleOptionValue(OID_Toggle_RiHs_InGame, 1) EndIf ElseIf (option == OID_Toggle_RiHs_IsKnown) If aiKnown[iRiHs]==1 aiKnown[iRiHs]=0 SetToggleOptionValue(OID_Toggle_RiHs_IsKnown, 0) Else aiKnown[iRiHs]=1 SetToggleOptionValue(OID_Toggle_RiHs_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_RiHs_OnNetwork) If aiOnNetwork[iRiHs]==1 aiOnNetwork[iRiHs]=0 SetToggleOptionValue(OID_Toggle_RiHs_OnNetwork, 0) Else aiOnNetwork[iRiHs]=1 SetToggleOptionValue(OID_Toggle_RiHs_OnNetwork, 1) EndIf ; iSoPM |||| 02 02 02 ||| Proudspire Manor ||| 02 02 02 ||| iSoPM ElseIf(option == OID_Toggle_SoPM_InGame) If aiInGame[iSoPM]==1 aiInGame[iSoPM]=0 SetToggleOptionValue(OID_Toggle_SoPM_InGame, 0) Else aiInGame[iSoPM]=1 SetToggleOptionValue(OID_Toggle_SoPM_InGame, 1) EndIf ElseIf (option == OID_Toggle_SoPM_IsKnown) If aiKnown[iSoPM]==1 aiKnown[iSoPM]=0 SetToggleOptionValue(OID_Toggle_SoPM_IsKnown, 0) Else aiKnown[iSoPM]=1 SetToggleOptionValue(OID_Toggle_SoPM_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_SoPM_OnNetwork) If aiOnNetwork[iSoPM]==1 aiOnNetwork[iSoPM]=0 SetToggleOptionValue(OID_Toggle_SoPM_OnNetwork, 0) Else aiOnNetwork[iSoPM]=1 SetToggleOptionValue(OID_Toggle_SoPM_OnNetwork, 1) EndIf ; iMaVH |||| 03 03 03 ||| Vlindrel Hall ||| 03 03 03 ||| iMaVH ElseIf(option == OID_Toggle_MaVH_InGame) If aiInGame[iMaVH]==1 aiInGame[iMaVH]=0 SetToggleOptionValue(OID_Toggle_MaVH_InGame, 0) Else aiInGame[iMaVH]=1 SetToggleOptionValue(OID_Toggle_MaVH_InGame, 1) EndIf ElseIf (option == OID_Toggle_MaVH_IsKnown) If aiKnown[iMaVH]==1 aiKnown[iMaVH]=0 SetToggleOptionValue(OID_Toggle_MaVH_IsKnown, 0) Else aiKnown[iMaVH]=1 SetToggleOptionValue(OID_Toggle_MaVH_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_MaVH_OnNetwork) If aiOnNetwork[iMaVH]==1 aiOnNetwork[iMaVH]=0 SetToggleOptionValue(OID_Toggle_MaVH_OnNetwork, 0) Else aiOnNetwork[iMaVH]=1 SetToggleOptionValue(OID_Toggle_MaVH_OnNetwork, 1) EndIf ; iWhmHj |||| 04 04 04 ||| Hjierm ||| 04 04 04 ||| iWhmHj ElseIf(option == OID_Toggle_WhmHj_InGame) If aiInGame[iWhmHj]==1 aiInGame[iWhmHj]=0 SetToggleOptionValue(OID_Toggle_WhmHj_InGame, 0) Else aiInGame[iWhmHj]=1 SetToggleOptionValue(OID_Toggle_WhmHj_InGame, 1) EndIf ElseIf (option == OID_Toggle_WhmHj_IsKnown) If aiKnown[iWhmHj]==1 aiKnown[iWhmHj]=0 SetToggleOptionValue(OID_Toggle_WhmHj_IsKnown, 0) Else aiKnown[iWhmHj]=1 SetToggleOptionValue(OID_Toggle_WhmHj_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_WhmHj_OnNetwork) If aiOnNetwork[iWhmHj]==1 aiOnNetwork[iWhmHj]=0 SetToggleOptionValue(OID_Toggle_WhmHj_OnNetwork, 0) Else aiOnNetwork[iWhmHj]=1 SetToggleOptionValue(OID_Toggle_WhmHj_OnNetwork, 1) EndIf ; iBYOH1 |||| 05 05 05 ||| BYOH1 ||| 05 05 05 ||| iBYOH1 ElseIf(option == OID_Toggle_BYOH1_InGame) If aiInGame[iBYOH1]==1 aiInGame[iBYOH1]=0 SetToggleOptionValue(OID_Toggle_BYOH1_InGame, 0) Else aiInGame[iBYOH1]=1 SetToggleOptionValue(OID_Toggle_BYOH1_InGame, 1) EndIf ElseIf (option == OID_Toggle_BYOH1_IsKnown) If aiKnown[iBYOH1]==1 aiKnown[iBYOH1]=0 SetToggleOptionValue(OID_Toggle_BYOH1_IsKnown, 0) Else aiKnown[iBYOH1]=1 SetToggleOptionValue(OID_Toggle_BYOH1_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_BYOH1_OnNetwork) If aiOnNetwork[iBYOH1]==1 aiOnNetwork[iBYOH1]=0 SetToggleOptionValue(OID_Toggle_BYOH1_OnNetwork, 0) Else aiOnNetwork[iBYOH1]=1 SetToggleOptionValue(OID_Toggle_BYOH1_OnNetwork, 1) EndIf ; iBYOH2 |||| 06 06 06 ||| BYOH2 ||| 06 06 06 ||| iBYOH2 ElseIf(option == OID_Toggle_BYOH2_InGame) If aiInGame[iBYOH2]==1 aiInGame[iBYOH2]=0 SetToggleOptionValue(OID_Toggle_BYOH2_InGame, 0) Else aiInGame[iBYOH2]=1 SetToggleOptionValue(OID_Toggle_BYOH2_InGame, 1) EndIf ElseIf (option == OID_Toggle_BYOH2_IsKnown) If aiKnown[iBYOH2]==1 aiKnown[iBYOH2]=0 SetToggleOptionValue(OID_Toggle_BYOH2_IsKnown, 0) Else aiKnown[iBYOH2]=1 SetToggleOptionValue(OID_Toggle_BYOH2_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_BYOH2_OnNetwork) If aiOnNetwork[iBYOH2]==1 aiOnNetwork[iBYOH2]=0 SetToggleOptionValue(OID_Toggle_BYOH2_OnNetwork, 0) Else aiOnNetwork[iBYOH2]=1 SetToggleOptionValue(OID_Toggle_BYOH2_OnNetwork, 1) EndIf ; iBYOH3 |||| 07 07 07 ||| BYOH3 ||| 07 07 07 ||| iBYOH3 ElseIf(option == OID_Toggle_BYOH3_InGame) If aiInGame[iBYOH3]==1 aiInGame[iBYOH3]=0 SetToggleOptionValue(OID_Toggle_BYOH3_InGame, 0) Else aiInGame[iBYOH3]=1 SetToggleOptionValue(OID_Toggle_BYOH3_InGame, 1) EndIf ElseIf (option == OID_Toggle_BYOH3_IsKnown) If aiKnown[iBYOH3]==1 aiKnown[iBYOH3]=0 SetToggleOptionValue(OID_Toggle_BYOH3_IsKnown, 0) Else aiKnown[iBYOH3]=1 SetToggleOptionValue(OID_Toggle_BYOH3_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_BYOH3_OnNetwork) If aiOnNetwork[iBYOH3]==1 aiOnNetwork[iBYOH3]=0 SetToggleOptionValue(OID_Toggle_BYOH3_OnNetwork, 0) Else aiOnNetwork[iBYOH3]=1 SetToggleOptionValue(OID_Toggle_BYOH3_OnNetwork, 1) EndIf ; iRRSH |||| 08 08 08 ||| Severin House ||| 08 08 08 ||| iRRSH ElseIf(option == OID_Toggle_RRSH_InGame) If aiInGame[iRRSH]==1 aiInGame[iRRSH]=0 SetToggleOptionValue(OID_Toggle_RRSH_InGame, 0) Else aiInGame[iRRSH]=1 SetToggleOptionValue(OID_Toggle_RRSH_InGame, 1) EndIf ElseIf (option == OID_Toggle_RRSH_IsKnown) If aiKnown[iRRSH]==1 aiKnown[iRRSH]=0 SetToggleOptionValue(OID_Toggle_RRSH_IsKnown, 0) Else aiKnown[iRRSH]=1 SetToggleOptionValue(OID_Toggle_RRSH_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_RRSH_OnNetwork) If aiOnNetwork[iRRSH]==1 aiOnNetwork[iRRSH]=0 SetToggleOptionValue(OID_Toggle_RRSH_OnNetwork, 0) Else aiOnNetwork[iRRSH]=1 SetToggleOptionValue(OID_Toggle_RRSH_OnNetwork, 1) EndIf ; iRiRF |||| 09 09 09 ||| Severin House ||| 09 09 09 ||| iRiRF ElseIf(option == OID_Toggle_RiRF_InGame) If aiInGame[iRiRF]==1 aiInGame[iRiRF]=0 SetToggleOptionValue(OID_Toggle_RiRF_InGame, 0) Else aiInGame[iRiRF]=1 SetToggleOptionValue(OID_Toggle_RiRF_InGame, 1) EndIf ElseIf (option == OID_Toggle_RiRF_IsKnown) If aiKnown[iRiRF]==1 aiKnown[iRiRF]=0 SetToggleOptionValue(OID_Toggle_RiRF_IsKnown, 0) Else aiKnown[iRiRF]=1 SetToggleOptionValue(OID_Toggle_RiRF_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_RiRF_OnNetwork) If aiOnNetwork[iRiRF]==1 aiOnNetwork[iRiRF]=0 SetToggleOptionValue(OID_Toggle_RiRF_OnNetwork, 0) Else aiOnNetwork[iRiRF]=1 SetToggleOptionValue(OID_Toggle_RiRF_OnNetwork, 1) EndIf ; iWiCHoA |||| 10 10 10 ||| Severin House ||| 10 10 10 ||| iWiCHoA ElseIf(option == OID_Toggle_WiCHoA_InGame) If aiInGame[iWiCHoA]==1 aiInGame[iWiCHoA]=0 SetToggleOptionValue(OID_Toggle_WiCHoA_InGame, 0) Else aiInGame[iWiCHoA]=1 SetToggleOptionValue(OID_Toggle_WiCHoA_InGame, 1) EndIf ElseIf (option == OID_Toggle_WiCHoA_IsKnown) If aiKnown[iWiCHoA]==1 aiKnown[iWiCHoA]=0 SetToggleOptionValue(OID_Toggle_WiCHoA_IsKnown, 0) Else aiKnown[iWiCHoA]=1 SetToggleOptionValue(OID_Toggle_WiCHoA_IsKnown, 1) EndIf ElseIf (option == OID_Toggle_WiCHoA_OnNetwork) If aiOnNetwork[iWiCHoA]==1 aiOnNetwork[iWiCHoA]=0 SetToggleOptionValue(OID_Toggle_WiCHoA_OnNetwork, 0) Else aiOnNetwork[iWiCHoA]=1 SetToggleOptionValue(OID_Toggle_WiCHoA_OnNetwork, 1) EndIf EndIf EndFunction ;Int iWrBh ;Int iRiHs ;Int iSoPM ;Int iMaVH ;Int iWhmHj ;Int iBYOH1 ;Int iBYOH2 ;Int iBYOH3 ;Int iRRSH ;Int iRiRF ;Int iWiCHoA Edited March 15, 2021 by tamtastic Link to comment Share on other sites More sharing options...
Recommended Posts