Guest GuyWhoAbruptlyDisappeared Posted July 6, 2014 Posted July 6, 2014 Hi, I am working on the MCM (finally) for Sexlab Mortality, and it's going well, except for one problem - My sliders, despite having set the range from -1.0 to 300 in the script, only go from 0 to 1. Does anyone know what I am doing wrong here? This is the relevant part of the code. GlobalVariable property dKG autoGlobalVariable property sOKG autoGlobalVariable property vKG autoGlobalVariable property uKG autofloat dKfloat sOKfloat vKfloat uKint dint soint vint u event OnPageReset(string JesusChrist) SetCursorFillMode(TOP_TO_BOTTOM) dK = dKG.GetValue() vK = vKG.GetValue() sOK = sOKG.GetValue() uK = uKG.GetValue() AddHeaderOption("Key Configuration") SetCursorPosition(2) d = AddSliderOption("Depression Key", 50) so = AddSliderOption("Strap-On Key", 20) v = AddSliderOption("Victim Key", 30) u = AddSliderOption("Untrusted Key", 50)endEvent event OnSliderOpen(int op) if op == d SetSliderDialogStartValue(dK) setSliderDialogDefaultValue(25) setSliderDialogRange(-1.0, 300.0) setSliderDialogInterval(1.0) elseIf op == so SetSliderDialogStartValue(sOK) setSliderDialogDefaultValue(20) setSliderDialogRange(-1.0, 300.0) setSliderDialogInterval(1.0) elseIf op == v SetSliderDialogStartValue(vK) setSliderDialogDefaultValue(30) setSliderDialogRange(-1.0, 300.0) setSliderDialogInterval(1.0) elseIf op == u SetSliderDialogStartValue(uK) SetSliderDialogDefaultValue(50) setSliderDialogRange(-1.0, 300.0) SetSliderDialogInterval(2) endIf endEvent event onOptionSliderAccept(int op, float val) if op == d dK = val SetSliderOptionValue(d, dK) dKG.SetValue(val) elseIf op == so sOK = val SetSliderOptionValue(so, sOK) sOKG.SetValue(val) elseIf op == v vK = val SetSliderOptionValue(v, vK) vKG.SetValue(val) elseIf op == u uK = val SetSliderOptionValue(u, uK) uKG.SetValue(val) endIf endEvent
rangedphoenix Posted July 6, 2014 Posted July 6, 2014 Yeah, I can see the problem right away. You are actually making things significantly more difficult on yourself. I suggest using states instead, it will make your life MUCH, MUCH easier. I'll be back in a second to show you how something like that would look. *Edit* Admittedly, my code is a lot more fragmented because of how I use functions for doing a lot of the heavy lifting, but this is the gist of how I populate MCM options. Function HandleOptionsMenuFemale()SetCursorFillMode(LEFT_TO_RIGHT)AddHeaderOption("Mod Status")AddEmptyOption()AddEmptyOption()AddEmptyOption()AddHeaderOption("Arousal Options")AddEmptyOption()AddSliderOptionST("ArousalEventRateSlider", "Arousal Event Polling:", ArousalEventRate, TimeRateFormatting)AddSliderOptionST("MinorArousalRateSlider", "Minor Arousal Event Chance:", MinorArousalEventChance, EventChanceFormatting)AddSliderOptionST("MajorArousalRateSlider", "Major Arousal Event Chance:", MajorArousalEventChance, EventChanceFormatting)AddEmptyOption()AddEmptyOption()AddEmptyOption()AddHeaderOption("Appearence (Debug)")AddEmptyOption()If(EarsActive)AddToggleOptionST("AddEarsState", "Add Ears:", false)ElseAddToggleOptionST("AddEarsState", "Add Ears:", false, OPTION_FLAG_DISABLED)EndIfIf(TailActive)AddToggleOptionST("AddTailState", "Add Tail:", false)ElseAddToggleOptionST("AddTailState", "Add Tail:", false, OPTION_FLAG_DISABLED)EndIfIf(HybridFurActive)AddToggleOptionST("AddHybridArmorState", "Add Hybrid Fur:", false)ElseAddToggleOptionST("AddHybridArmorState", "Add Hybrid Fur:", false, OPTION_FLAG_DISABLED)EndIfAddEmptyOption()AddHeaderOption("Uninstallation")AddEmptyOption()If(!cleanupTriggered)AddToggleOptionST("Cleanup", "Prepare for Uninstallation:", cleanupTriggered)ElseAddToggleOptionST("Cleanup", "Prepare for Uninstallation:", cleanupTriggered, OPTION_FLAG_DISABLED)EndIfAddEmptyOption()EndFunction Then, for actually handling a state option, you would use code like this. State ArousalEventRateSliderEvent OnHighlightST()SetInfoText("How often an arousal event has a chance to occur.")EndEventEvent OnDefaultST()ArousalEventRate = 1.0SetSliderOptionValueST(ArousalEventRate, TimeRateFormatting)EndEventEvent OnSliderOpenST()SetSliderDialogStartValue(ArousalEventRate)SetSliderDialogDefaultValue(1.0)SetSliderDialogRange(1.0, 24.0)SetSliderDialogInterval(0.1)EndEventEvent OnSliderAcceptST(float value)ArousalEventRate = valueSetSliderOptionValueST(ArousalEventRate, TimeRateFormatting)EndEventEndState Thats actually code from SLB's mcm.
b3lisario Posted July 6, 2014 Posted July 6, 2014 "event OnPageReset(string JesusChrist)" Clearly the JesusChrist argument is not enough. string JesusChristSuperStar, this might work I don't think it matters, but I'd also try OnOptionSliderOpen instead of OnSliderOpen
Guest GuyWhoAbruptlyDisappeared Posted July 6, 2014 Posted July 6, 2014 "event OnPageReset(string JesusChrist)" Clearly the JesusChrist argument is not enough. string JesusChristSuperStar, this might work I don't think it matters, but I'd also try OnOptionSliderOpen instead of OnSliderOpen Yep, that was the problem. Didn't see that. Thanks. I switched it to JesusChristSuperStar and it works fine. I should have read that OnOptionSliderOpen requires a holy bonus of 26 or higher.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.