dizietemblesssma Posted November 3, 2020 Share Posted November 3, 2020 Is there a way to disable an MCM menu without uninstalling or disabling the esp that has the mcm quest in it? perhaps through some global variable that turns the quest on/off. I know nothing about quests except how to make an MCM menu:) I can't see anywhere in the MCM script that would prevent it from showing in the Mod Configuration, so I was wondering if the quest setup might be a route? diziet Link to comment Share on other sites More sharing options...
dylbill Posted November 3, 2020 Share Posted November 3, 2020 You can try stopping the mcm quest with MyMcmQuest.Stop() I'm not sure if that will make the mcm disappear though. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 3, 2020 Share Posted November 3, 2020 You can stop the quest and it will remove it from the menu system. However, please be aware that the instructions for creating an MCM menu has one use the Run Once and Start Game Enabled options. Thus most MCM menus if stopped will never re-appear even if the console is used to "start" the quest. The only way to work around this then would be a "clean save". That said, in theory, one could create a separate controlling quest for the MCM. The separate quest would be Run Once and Start Game Enabled instead while the MCM quest would not have those checked. In the OnInit() event register for a very brief update, then start the actual MCM quest for the mod. Use a global variable whose value would allow the MCM quest to be started and stopped as desired. Here is an idea for the controlling quest script: It should be noted that this uses SKSE but it should already be present for the MCM. ScriptName myMCMControllerQuest Extends Quest Quest Property myMCMQuest Auto GlobalVariable Property myMCMgv Auto ;set the GV to a start value of 1 Event OnInit() RegisterForSingleUpdate(0.25) RegisterForMenu("Console") EndEvent Event OnUpdate() If myMCMgv.Value == 1 ; a value of 1 will allow the quest to be started If !myMCMQuest.IsStarted() myMCMQuest.Start() EndIf Else ; any other value will stop the quest If myMCMQuest.IsStarted() myMCMQuest.Stop() EndIf EndIf EndEvent Event OnMenuClose(String MenuName) If MenuName == "Console" OnUpdate() ; call the OnUpdate event to turn on or off the quest as needed EndIf EndEvent The above would allow the user to open the console, change the global variable value from 1 to anything else to stop the quest or change it back to 1 to re-start the quest.In testing you may find that you will need to also use setstage SKI_ConfigManagerInstance 1 in the console to get the newly started / stopped quest to show up / disappear Link to comment Share on other sites More sharing options...
dizietemblesssma Posted November 3, 2020 Author Share Posted November 3, 2020 Thanks for this, I shall test it out:) diziet edit: I had to change IsStarted() to Start(), I tried IsRunning() but that didn't work. Otherwise the menu disappeared after using setstage SKI_ConfigManagerInstance 1 in the console. Not sure if the menu is behaving properly after re-enabling though, more testing needed. Question: why does RegisterForSingleUpdate(0.25) work? If OnInit() occurs just once when the controller quest starts? Or have I got that wrong? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 3, 2020 Share Posted November 3, 2020 For start game enabled quests, OnInit() can run twice. By using the update if it does run twice it just bumps the timer slightly rather than try to run the same code twice. Link to comment Share on other sites More sharing options...
Recommended Posts