trepleen Posted September 18, 2014 Posted September 18, 2014 So I made an MCM menu, but no where does it explain how to actually access the variables that get changed via the menu. How can you access int aOID from other scripts in another quest? The SkyUI MCM Menu tutorial shows you how to make a menu, but not how to access the variables for actual use in your scripts. scriptname kd_script_mcmmenu extends SKI_ConfigBaseint aOIDbool aVal = false int function GetVersion()return 1 ; Default versionendFunction event OnPageReset(string a_page) SetCursorFillMode(TOP_TO_BOTTOM) AddHeaderOption("Player") aOID = AddToggleOption("Nord Male Short", true)endEventevent OnOptionHighlight(int a_option) if (a_option == aOID) SetInfoText("Check this if you've made your Nord male shorter in Character Maker Extended by a value of -0.02, this will ensure a different set of animations are played for the height adjustment.\nDefault: false") endIfendEventevent OnOptionSelect(int a_option) if (a_option == aOID) aVal = !aVal SetToggleOptionValue(aOID, aVal) endIfendEventevent OnOptionDefault(int a_option) if (a_option == aOID) aVal = false SetToggleOptionValue(aOID, aVal) endIfendEvent
Srende Posted September 18, 2014 Posted September 18, 2014 The OID is internal to the menu, and only used to identify the shown button in the menu. In your example the actual value you want to use is aVal. That you can access like any other variable in scripts, it's nothing more special than any other variable. Make it a property so you can use myMCMscript.aVal, or write a getter function for it.
b3lisario Posted September 18, 2014 Posted September 18, 2014 declare aVal as a public variable bool property aval auto or make a function that serves the private variable Function getVal() return aVal EndFunction then in your other script: kd_script_mcmmenu property mcmScript auto --> needs to be filled and: debug.notification(mcmScript.aVal) // or debug.notification(mcmScript.getVal())
trepleen Posted September 18, 2014 Author Posted September 18, 2014 Thanks guys, I did exactly what you said. I over complicated the issue. I was just worried there was a special way to do it.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.