Guffel Posted November 16, 2013 Share Posted November 16, 2013 Hi everyone, i´m about to finish a mod, but i have a problem with the MCM i want to create. My mod adds a chance for the player to be raped after wakeing up and with the mcm the player can filter for possible rapists. I already seached the web for this topic and read the MCM guide (https://github.com/schlangster/skyui/wiki/MCM-Quickstart) for the last week, but i found only few information about how to link my actual mod script with my mcm. I was able to write the script for my menu, it shows up properly ingame and i can use the toggle options and slider like planned. How can i make my script access the variable of my mcm script? I tried to set them as properties, but my mod seems not to get their values. This is my mcm script: Scriptname SLSleepRapeConfigMenu extends SKI_ConfigBase SleepRapeScript02 Property ress auto ; OIDs int creatureOID int companionOID int housecarlsOID int rapeprobOID ; Toggle states bool creatures = false bool companions = false bool housecarls = true float rapeprob = 30.0 event OnConfigInit() Pages = new string[1] Pages[1] = "Settings" endevent event OnPageReset(string Settings) SetCursorFillMode(TOP_TO_BOTTOM) AddHeaderOption("SexLab Sleep Rape by Guffel") AddEmptyOption() creatureOID = AddToggleOption("Allow creatures", creatures) AddEmptyOption() companionOID = AddToggleOption("Allow companions", companions) housecarlsOID = AddToggleOption("No housecarls", housecarls) AddEmptyOption() rapeprobOID = addslideroption("Rape Proberbility", rapeprob, "{0} %") endEvent Event OnOptionSliderOpen(Int Option) if option == rapeprobOID SetSliderDialogStartValue(rapeprob) SetSliderDialogDefaultValue(30.0) SetSliderDialogRange(10.0, 100.0) SetSliderDialogInterval(10.0) endif endEvent Event OnOptionSliderAccept(Int Option, Float value) If Option == rapeprobOID rapeprob = value SetSliderOptionValue(rapeprobOID, rapeprob, "{0} %") endIf endEvent event OnOptionSelect(int option) if (option == creatureOID) creatures = !creatures SetToggleOptionValue(creatureOID, creatures) elseIf (option == companionOID) companions = !companions SetToggleOptionValue(companionOID, companions) elseIf (option == housecarlsOID) housecarls = !housecarls SetToggleOptionValue(housecarlsOID, housecarls) endIf endEvent event OnOptionHighlight(int option) if (option == creatureOID) SetInfoText("Allowes creatures as possible rapists. \nDefault: false") elseIf (option == companionOID) SetInfoText("Allowes your currend companions as possible rapists. \nDefault: false") elseIf (option == housecarlsOID) SetInfoText("Excludes your huscarls as possible rapists. \nDefault: true") elseIf (option == rapeprobOID) SetInfoText("The possebility of a rape to happen. \nDefault: 30%") endIf endEvent event OnOptionDefault(int option) if (option == creatureOID) creatures = false ; default value SetToggleOptionValue(creatureOID, creatures ) elseIf (option == companionOID) companions = false ; default value SetToggleOptionValue(companionOID, companions ) elseIf (option == housecarlsOID) housecarls= true ; default value SetToggleOptionValue(housecarlsOID, housecarls) endIf endEvent and this is the main part of my mods script: Scriptname SleepRapeScript02 extends ReferenceAlias SexLabFramework Property SexLab Auto Actor Property PlayerRef Auto SLSleepRapeConfigMenu Property mcmconfig auto bool Property creatures auto bool Property companions auto bool Property housecarls auto float Property rapeprob auto Event OnSleepStop(bool abInterrupted) int random = Utility.RandomInt(10, 100) debug.notification(random) if random <= 100 Actor Rapist = Game.FindRandomActorFromRef(PlayerRef, 6000.0) if Rapist.IsInFaction(SLSleepRapeFaction) != True && Rapist.IsInFaction(currentCompanionFaction) != True && (Rapist != none) && creatures == true && companions == false if (Rapist != PlayerRef) Rapist.AddToFaction(CWPlayerAlly) Rapist.MoveTo(PlayerRef, abMatchRotation = true) actor[] sexActors = new actor[2] sexActors[0] = PlayerRef sexActors[1] = Rapist sslBaseAnimation[] anims SexLab.StartSex(sexActors, anims, victim=PlayerRef, allowBed=true) Rapist.RemoveFromFaction(CWPlayerAlly) else debug.notification("You can´t rape yourself.") endif elseif Rapist.IsInFaction(SLSleepRapeFaction) != True && Rapist.IsInFaction(currentCompanionFaction) != True && (Rapist != none) && Rapist.IsInFaction(CreatureFaction) && creatures == false && companions == false if (Rapist != PlayerRef) Rapist.AddToFaction(CWPlayerAlly) Rapist.MoveTo(PlayerRef, abMatchRotation = true) actor[] sexActors = new actor[2] sexActors[0] = PlayerRef sexActors[1] = Rapist sslBaseAnimation[] anims SexLab.StartSex(sexActors, anims, victim=PlayerRef, allowBed=true) Rapist.RemoveFromFaction(CWPlayerAlly) else debug.notification("You can´t rape yourself.") endif ---cut--- else debug.notification("You can´t rape yourself.") endif else debug.Notification("No rapist around...") endif endif endEvent Faction Property CWPlayerAlly Auto Faction Property currentCompanionFaction Auto Faction Property SLSleepRapeFaction Auto Faction Property HousecarlRiften Auto Faction Property HousecarlSolitude Auto Faction Property HousecarlWhiterun Auto Faction Property HousecarlMarkarth Auto Faction Property HousecarlWindhelm Auto Faction Property CreatureFaction Auto I really have idea how to go on and helped my myself as far as i could, i appreciate every help and thank up in advance! And if you need more information just ask! Link to comment
Ashal Posted November 16, 2013 Share Posted November 16, 2013 you need to make the settings you want to access from your mcm properties in that script. remove this from your mod script: bool Property creatures auto bool Property companions auto bool Property housecarls auto float Property rapeprob auto and change the versions of them on the MCM script into properties, then you access them from the mod script via mcmconfig.creatures, mcmconfig.companions, and so on. Link to comment
Guffel Posted November 16, 2013 Author Share Posted November 16, 2013 Great! It works just like i always wanted! Thank you Ashal, thank you very much! Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.