Mattiewagg Posted August 13, 2015 Share Posted August 13, 2015 Essentially, SkyUI has code written so that when you change the value in the slider, it will send an event to the script, telling you what the new value of the slider is (say you put slider at 0.58, then the event would send the float 0.58 and say "this is the slider's new value"). You then set the value of the variable in the other script to that value, so it's not just changing a slider but actually changing a variable. I think that should explain it, unless I misunderstood. Link to comment Share on other sites More sharing options...
SkjoldBjorn Posted August 13, 2015 Author Share Posted August 13, 2015 Thanks a lot!While reading up abit, i notice that the MCM script does not compile without errors in the creation kit, I usually find the lines and correct errors while compiling scripts, but since this is SKSE stuff I'm not sure if the CK compiler can compile it properly with more commands and all that, should i ignore them or infact correct them? As a reference for myself I'm going to list the error message below. EDIT: Uhm, these are errors due to my decritptions messages in the mod...embarrassing..oh well. Updated the error messages that are more relevant than the previous ones. Line 115,2 has nothing on it, not sure what the CK really means here. The error messages that the compiler produce are usually very informative though. Starting 1 compile threads for 1 files...Compiling "ICROL_MCM"...G:\Spill\steamapps\common\Skyrim\Data\Scripts\Source\temp\ICROL_MCM.psc(115,2): type mismatch while assigning to a int (cast missing or types unrelated)G:\Spill\steamapps\common\Skyrim\Data\Scripts\Source\temp\ICROL_MCM.psc(121,2): type mismatch while assigning to a int (cast missing or types unrelated)No output generated for ICROL_MCM, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on ICROL_MCM Link to comment Share on other sites More sharing options...
sLoPpYdOtBiGhOlE Posted August 13, 2015 Share Posted August 13, 2015 Without seeing your edited script, it makes it hard to say the exact problem. Your assigning a non Int value to an Int variable. example of this may be:Declared in the start of your script an int variable. int LightOnThen later in your script your trying to assign a float value to it: Event OnOptionSliderAccept(int option, float value) {Called when a new slider value has been accepted} If ( option == LightOn_OID_S ) LightOn = value ;<--- This is a float value your assigning to a declared int variable SetSliderOptionValue(LightOn_OID_S, LightOn, "Every {0}") Return EndIff Link to comment Share on other sites More sharing options...
SkjoldBjorn Posted August 14, 2015 Author Share Posted August 14, 2015 Oh yeah, i see that, well that is a problem, the lightscript I'm running will be running non-whole numbers as it uses the clock to determine when to go off and on. like having the slider be for off lights to be something like 04:00 (04) - 12:00(12). I used something called a Menu Designer and just filled inn the information. i did expect i had to correct some stuff manually since it has not been updated in a very long time.But i can just call the float instead of the integer can't I? The Menu Designer does by default choose integer as far as i can see. EDIT: Forgot to link the menu designer, just in case, here it is: http://www.nexusmods.com/skyrim/mods/29821/? Link to comment Share on other sites More sharing options...
sLoPpYdOtBiGhOlE Posted August 14, 2015 Share Posted August 14, 2015 Sorry, I really can't help with using a mcm designer. For me that just adds confusion and blurs what's really going on in the menu script. Myself I prefer to read the MCM API documentation, this way I know what the data type each control parameter expects. eg: a slider would expect a string for the name/description for the first parameter, then it expects a float value for what is displayed as the current value for the second parameter, then expects a string to format the the float value for the way it should display, and lastly an int value for a state flag in the fourth parameter. Understanding the data types you are using and casting as needed and what not is not a MCM only thing.This is the same across the whole of the papyrus scripting language. Link to comment Share on other sites More sharing options...
SkjoldBjorn Posted August 15, 2015 Author Share Posted August 15, 2015 I've read the documentation and made my own script using it, i just thought i could simplify the process with the menu designer a bit. :)I understand some of it, i know the difference between integer, float values, strings, booleans are and where they are used, but it's the topology and architecture of a script i do not understand. I do understand how a script calls a function and so on, but not everything. Enough to let me make quests for my mods and make NPC's do stuff. It's weird that getting a script to adjust a simple slider and talking to another script that i know like my back pocket is supposed to be so intricate, it's obvious that my knowledge of scripting is so much worse than i thought. Link to comment Share on other sites More sharing options...
SkjoldBjorn Posted August 19, 2015 Author Share Posted August 19, 2015 One thing i do not understand yet. The variable LightsScript that keep popping up here, what are you refering too? I keep getting a feeling that you use LightsScript as a placeholder for something i should know what is, but i don't. I only have one Script and that is"ImmersiveContentLightMasterParent". Are you refering to a ScriptEvent Quest that I am supposed to have? This script is run from an Xmarker in a neutral position in skyrim, no ScriptEvent quests made for it. also LightsOffScript, but i guess this is refered to the variable LightsOffTime in the main script. I got the menu working in game, been trying a few things to get two scripts talking, so far i have come far compared to where i was, but still a little bit to go. Making the MCM menu from scratch without editors was better for understanding statments and variables at least. Been through most of Darkfox127's scripting tutorials now, learned a lot, thanks for the tip Mattiewagg. :) here's an example of the menu i made: ScriptName ICROL_SkiConfigMenu Extends SKI_ConfigBase ImmersiveContentLightMasterParent Property LightsScript Auto ; OID int LightsOnOID_S ; _S for slider int LightsOffOID_S ; _S for slider ; State float LightsOnTime = 19.0 float LightsOffTime = 7.0 event OnPageReset(string page) LightsOnOID_S = AddSliderOption("Lights turning on around", LightsOnTime, "{0} o'clock") LightsOffOID_S = AddSliderOption("Lights will turn off around", LightsOffTime, "{1} o'clock") endEvent event OnOptionSliderOpen(int option) if (option == LightsOnOID_S) SetSliderDialogStartValue(LightsOnTime) SetSliderDialogDefaultValue(19.0) SetSliderDialogRange(17.0, 21.0) SetSliderDialogInterval(1.0) elseIf (option == LightsOffOID_S) SetSliderDialogStartValue(LightsOffTime) SetSliderDialogDefaultValue(7.0) SetSliderDialogRange(4.0, 12.0) SetSliderDialogInterval(1.0) endIf endEvent event OnOptionSliderAccept(int option, float value) if (option == LightsOnOID_S) LightsOnTime = value SetSliderOptionValue(LightsOnOID_S, LightsOnTime, "{0} o'clock") elseIf (option == LightsOffOID_S) LightsOffTime = value SetSliderOptionValue(LightsOffOID_S, LightsOffTime, "{0} o'clock") endIf endEvent Link to comment Share on other sites More sharing options...
Mattiewagg Posted August 19, 2015 Share Posted August 19, 2015 LightScript is the name of the property that refers to your script. Go back a page, I showed it a few times. Link to comment Share on other sites More sharing options...
SkjoldBjorn Posted August 20, 2015 Author Share Posted August 20, 2015 Alright, tried to implement those to point as suggested, but autofill does not work here.tried copy/pasting the name just to be sure there was no spelling error, but same thing.Thanks! Link to comment Share on other sites More sharing options...
scrivener07 Posted August 20, 2015 Share Posted August 20, 2015 Properties that reference other scripts do not "auto fill". Use the combobox to select the Form the script is attached to. For example, if you trying to reference a script that is attached to a quest you would select the name of the quest the script is attached to. If the script is attached to an alias on a quest, select the Quest in the first combobox and pick the alias the script is attached to in the second combobox. Same thing for other types you can attach a script to. edit: forgot the palmface :facepalm: :D Link to comment Share on other sites More sharing options...
Recommended Posts