cold steel Posted November 23, 2019 Posted November 23, 2019 Hello dear modders, can someone help me please to understand how to create MCM menu slider which affect my custom variable in papyrus script? I read this MCM menu guide https://github.com/Neanka/MCM_0.1_AS3/wiki/Setting-Types%2C-Storage-and-Persistence and used MCM_Demo modification to learn it, but still don't get it. In my papyrus script I have variable: int FirstTimer = 10 In my config.json file for MCM I created a slider: Â { Â Â Â Â Â Â Â Â Â "id": "fDiggestTime:Main", Â Â Â Â Â Â Â Â Â "text": "Diggestion time", Â Â Â Â Â Â Â Â Â "type": "slider", Â Â Â Â Â Â Â Â Â "help": "A slider to change diggestion time. Default = 120 sec.", Â Â Â Â Â Â Â Â Â "valueOptions": { Â Â Â Â Â Â Â Â Â Â Â "min": 10, Â Â Â Â Â Â Â Â Â Â Â "max": 240, Â Â Â Â Â Â Â Â Â Â Â "step": 1, Â Â Â Â Â Â Â Â Â Â Â "sourceType": "ModSettingFloat" Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â } Â Â Â }Â Â In settings.ini for MCM I stored default value for my custom slider: [Main] bEnabled=1 fDiggestTime=10 Now the question is how to make this slider affect my "FirstTimer" variable value every time when used user cahnge this slider in the game? I tried to use GetModSettingInt() function for that and wrote: Â FirstTimer = mcm.GetModSettingInt("WeightGain_SSBBW", "fDiggestTime:Main") Unfortunately GetModSettingsInt() return long string of numbers instead of current slider value. Can someone tell me please what I need to use? Â Â
mashup47 Posted November 23, 2019 Posted November 23, 2019 Hi @cold steel have you tried looking at other mods that use the MCM? a good one that springs to mind that uses a slider is Random shenanigans. @Flashy (JoeR) always keeps his code neat and tidy .
cold steel Posted November 23, 2019 Author Posted November 23, 2019 58 minutes ago, mashup47 said: Hi @cold steel have you tried looking at other mods that use the MCM? a good one that springs to mind that uses a slider is Random shenanigans. @Flashy (JoeR) always keeps his code neat and tidy . I downloaded this mod and checked how it works. Looks like I need to use custom global variables for that. I Just made some simple tests and looks like it works. Thank you for your help.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.