greenmango12 Posted January 27, 2022 Posted January 27, 2022 Thanks,, I could solve this issue already... ==== If someone see same issue. for MCM open menu function...not generate list... (list type).. check if you set first index array value as array[0] = "None" , it cause miss generate your list in the menu option to avoid it, eg , you may set array[0] = "<<None>>" then it work. I think I should avoid to use "None" for string array. -======== I try to make simple list menu, which just have 10 animation tags, for my custom mod in MCM menu. most of menu worked for me,, but I can not find reason, only about String Array which I set, not shown in MCM, So I tried many things, just show tag list (I limit it as 10) but everytime I up-date, compile, and load clean save game.. The function not show list... I confirmed, by debug, there is already list, but not shown .. like this pic.. So many sexlab mod may use MCM menu, and I hope if some modder who already use MCM list often, teach me where is wrong. .I took many hours already about this issue. then I feel.. (almost give up..now) My goal is show 5 menu option, (tag1, tag2. tag3, tag4, tag5) then select each tag.. then store the index for Global variables.. then use it in dialogue sex.... I suppose I could set global variable correctly... but when I select tags, it never show list... but if I use Debug.Messagebox.. actually I can see, my describe tags are shown as string... Though I use function just to generate list,, it is because,, where I set String [] mytags.. (OnInt or OnConfigInt etc).. after all I can not find tag list,, in the menu, when I open the Option menu.... (btw there is no compile error,, so it generate pex from this source) I confirm I correctly install SKY UI SDK 5.1 (though I think 5.2 SE already have source,, but anyway I follow tutorial) Scriptname myAggressiveMCM extends SKI_ConfigBase int YieldSet_S float HealthLimit int id_0 int id_1 int id_2 int id_3 int id_4 int sid int Atags1om int Atags2om int Atags3om int Atags4om int Atags5om String[] mytags String[] function SetAnimTags() ; I try to make tag list here,,, string[] AtagList AtagList = new string[10] AtagList[0] = "NONE" AtagList[1] = "aggressive" AtagList[2] = "bound" AtagList[3] = "Missionary" AtagList[4] = "DoggyStyle" AtagList[5] = "Cowgirl" AtagList[6] = "Pillory" AtagList[7] = "Xcross" AtagList[8] = "Bed" AtagList[9] = "animobject" return AtagList EndFunction Event OnConfigInit() ModName = "MyAggressiveSex" Pages = new string[1] Pages[0] = "Settings" mytags = SetAnimTags() id_0 = anim1n_pm.GetValue() as int id_1 = anim2n_pm.GetValue() as int id_2 = anim3n_pm.GetValue() as int id_3 = anim4n_pm.GetValue() as int id_4 = anim5n_pm.GetValue() as int EndEvent Event OnPageReset(string page) if page == "Settings" SetCursorFillMode(TOP_TO_BOTTOM) HealthLimit = SetHealth_p.GetValue() mytags = SetAnimTags() AddHeaderOption("Yield to me setting") YieldSet_S = AddSliderOption("Yield Health limit ratio", HealthLimit, "{2}") AddHeaderOption("set animation tags") Atags1om = AddMenuOption("Select 1stTag", mytags[1]) EndIf EndEvent event OnOptionSliderOpen(int option) if (option == YieldSet_S) SetSliderDialogStartValue(HealthLimit) SetSliderDialogDefaultValue(0.15) SetSliderDialogRange(0.00, 0.90) SetSliderDialogInterval(0.01) EndIf EndEvent event OnOptionMenuOpen(int option) if (option == atags1om) mytags = SetAnimTags() SetMenuDialogOptions(mytags) SetMenuDialogStartIndex(id_0) SetMenuDialogDefaultIndex(1) endIf endEvent event OnOptionSliderAccept(int option, float value) if (option == YieldSet_S) SetSliderOptionValue(YieldSet_S, value, "{2}") SetHealth_p.SetValue(value) Debug.MessageBox("Set Condition as " + value*100 + " %") endIf endEvent event OnOptionMenuAccept(int option, int index) if (option == Atags1om) SetMenuOptionValue(Atags1om, mytags[index]) anim1n_pm.SetValue(index) endIf endEvent GlobalVariable Property SetHealth_p auto GlobalVariable Property anim1n_pm auto GlobalVariable Property anim2n_pm auto GlobalVariable Property anim3n_pm auto GlobalVariable Property anim4n_pm auto GlobalVariable Property anim5n then when I load data, (which is clean save data = not activated this mod, so my MCM menu can load easy..) and open the animation 1st tag menu. (I only add one to test it work), it not show any string (tag) which I set.. any help or advice, I really apreciate... (SKY SU 5.2 SE,, ... skyrim runtime = 1.5.97 SKSE 2.0.20) I can not go foward ?
Sailing Rebel Posted January 27, 2022 Posted January 27, 2022 Check your papyrus log. 2 hours ago, greenmango12 said: Though I use function just to generate list,, it is because,, where I set String [] mytags.. (OnInt or OnConfigInt etc).. after all I can not find tag list,, in the menu, when I open the Option menu.... (btw there is no compile error,, so it generate pex from this source) OnInit and OnConfigInit are only called once when the engine first loads the script and never again. So either test in a clean save or better yet take measures to handle Script Versioning. There is also the OnConfigOpen event. There shouldn't be any reason to continuously redefine the same array to the exact same values so many times. The variable scope is global; set it once, and it will stay that way for as long as the mod is installed or until you deliberately change it (i.e. mytags[0] = "SomethingElse").
greenmango12 Posted January 28, 2022 Author Posted January 28, 2022 4 hours ago, Sailing Rebel said: Check your papyrus log. OnInit and OnConfigInit are only called once when the engine first loads the script and never again. So either test in a clean save or better yet take measures to handle Script Versioning. There is also the OnConfigOpen event. There shouldn't be any reason to continuously redefine the same array to the exact same values so many times. The variable scope is global; set it once, and it will stay that way for as long as the mod is installed or until you deliberately change it (i.e. mytags[0] = "SomethingElse"). Thanks advice..? So I just start to make MCM menu , then I actually up-date my mods again and again,,with use same data,, , (which was patch to add slider menu for yiled to me + my custom dialogue test mod to change animation with tags , I self merged for my prupose) then I could not confirm my issue was caused broken data...or not clear... Yes,,, as you said,, I might only need to set array one time.. When I first test, to confirm list, I tried to use OnInt (parent) method. >> failed >> OnConfiginit >> failed.. then tried to call function to set Array >> failed... about all case,,, when Open the menu.. there is no list.. (but Debug.messagebox (Myarray) show the list.. as string when open ^^; about clean save data,,, I just remove and apply falrim tool.. so if it was reason... return array in ConfigInt event , and try with new save data... which have not installed this patch... If my save data already corrupted,(un-activate + falrim tools and save) even though I add new version check,, I afraid it may hot work.. if you can find another reason, in the code.. where I miss use array. or MCM scripts,, teach me please...
Sailing Rebel Posted January 28, 2022 Posted January 28, 2022 2 hours ago, greenmango12 said: about clean save data,,, I just remove and apply falrim tool.. so if it was reason... return array in ConfigInt event , and try with new save data... which have not installed this patch... If my save data already corrupted,(un-activate + falrim tools and save) even though I add new version check,, I afraid it may hot work.. if you can find another reason, in the code.. where I miss use array. or MCM scripts,, teach me please... OnInit and ConfigInit will only be called once, cleaning will not change this. If you are only going to use those events, then test in a new game every time: at the main menu, open the console and enter coc qasmoke. This will spawn a default character in a test cell. Wait until the MCMs are registered, then check your menu. Otherwise: Event OnConfigOpen() mytags = new string[10] mytags[0] = "NONE" mytags[1] = "aggressive" mytags[2] = "bound" mytags[3] = "Missionary" mytags[4] = "DoggyStyle" mytags[5] = "Cowgirl" mytags[6] = "Pillory" mytags[7] = "Xcross" mytags[8] = "Bed" mytags[9] = "animobject" EndEvent And remove the SetAnimTags function.
greenmango12 Posted January 28, 2022 Author Posted January 28, 2022 @Sailing Rebel I found stack in papyrusl log, with change code. and set tag array only when Event OnConfigOpen. but still not show list... when I open the menu... . and it did not change even though I use start save game data... (clean save mod. save data) when click my setting page... current set = "Agrressive". then untill open it, mytags seems correctly loaded. but when OnOptionMenuOpen... it seems miss generate myittem in the Menu.... so I add Debug.messagebox().. then it show my list like this...to check mytags{0}, mytags[1], mytags[2]... but not show it in menu... Scriptname myAggressiveMCM extends SKI_ConfigBase int YieldSet_S float HealthLimit int id_0 int id_1 int id_2 int id_3 int id_4 int sid int Atags1om int Atags2om int Atags3om int Atags4om int Atags5om String[] mytags String[] function SetAnimTags() string[] AtagList AtagList = new string[10] AtagList[0] = "NONE" AtagList[1] = "aggressive" AtagList[2] = "bound" AtagList[3] = "Missionary" AtagList[4] = "DoggyStyle" AtagList[5] = "Cowgirl" AtagList[6] = "Pillory" AtagList[7] = "Xcross" AtagList[8] = "Bed" AtagList[9] = "animobject" return AtagList EndFunction Event OnConfigInit() ModName = "MyAggressiveSex" Pages = new string[1] Pages[0] = "Settings" EndEvent Event OnConfigOpen() mytags=SetAnimTags() id_0 = anim1n_pm.GetValue() as int id_1 = anim2n_pm.GetValue() as int id_2 = anim3n_pm.GetValue() as int id_3 = anim4n_pm.GetValue() as int id_4 = anim5n_pm.GetValue() as Int EndEvent Event OnPageReset(string page) if page == "Settings" SetCursorFillMode(TOP_TO_BOTTOM) HealthLimit = SetHealth_p.GetValue() AddHeaderOption("Yield to me setting") YieldSet_S = AddSliderOption("Yield Health limit ratio", HealthLimit, "{2}") AddHeaderOption("set animation tags") Atags1om = AddMenuOption("Select 1stTag", mytags[1]) EndIf EndEvent event OnOptionSliderOpen(int option) if (option == YieldSet_S) SetSliderDialogStartValue(HealthLimit) SetSliderDialogDefaultValue(0.15) SetSliderDialogRange(0.00, 0.90) SetSliderDialogInterval(0.01) EndIf EndEvent event OnOptionMenuOpen(int option) if (option == atags1om) SetMenuDialogOptions(mytags) SetMenuDialogStartIndex(id_0) SetMenuDialogDefaultIndex(1) Debug.messagebox("mytags >>" + mytags[0] + "," + mytags[1] +"," + mytags[2] +"...." + mytags[9]) endIf endEvent event OnOptionSliderAccept(int option, float value) if (option == YieldSet_S) SetSliderOptionValue(YieldSet_S, value, "{2}") SetHealth_p.SetValue(value) Debug.MessageBox("Set Condition as " + value*100 + " %") endIf endEvent event OnOptionMenuAccept(int option, int index) if (option == Atags1om) SetMenuOptionValue(Atags1om, mytags[index]) anim1n_pm.SetValue(index) endIf endEvent GlobalVariable Property SetHealth_p auto GlobalVariable Property anim1n_pm auto GlobalVariable Property anim2n_pm auto GlobalVariable Property anim3n_pm auto GlobalVariable Property anim4n_pm auto GlobalVariable Property anim5n_pm auto do you know why it generate Array index -1 out of range Error,, in my log? [01/28/2022 - 11:50:28AM] ERROR: Array index -1 is out of range (0-9) stack: [myAgressivelQuest (FE021D62)].myAggressiveMCM.OnOptionMenuAccept() - "myAggressiveMCM.psc" Line ? [myAgressivelQuest (FE021D62)].myAggressiveMCM.SetMenuIndex() - "SKI_ConfigBase.psc" Line ? [SKI_ConfigManagerInstance (FE005802)].SKI_ConfigManager.OnMenuAccept() - "SKI_ConfigManager.psc" Line ? [01/28/2022 - 11:50:33AM] WARNING: Passing NONE to non-object argument 12. stack: [myAgressivelQuest (FE021D62)].myAggressiveMCM.SetSliderValue() - "SKI_ConfigBase.psc" Line ? [SKI_ConfigManagerInstance (FE005802)].SKI_ConfigManager.OnSliderAccept() - "SKI_ConfigManager.psc" Line ? [01/28/2022 - 11:50:40AM] ERROR: Array index -1 is out of range (0-9) stack: [myAgressivelQuest (FE021D62)].myAggressiveMCM.OnOptionMenuAccept() - "myAggressiveMCM.psc" Line ? [myAgressivelQuest (FE021D62)].myAggressiveMCM.SetMenuIndex() - "SKI_ConfigBase.psc" Line ? [SKI_ConfigManagerInstance (FE005802)].SKI_ConfigManager.OnMenuAccept() - "SKI_ConfigManager.psc" Line ? [01/28/2022 - 11:50:49AM] [McmRecorderMCM <McmRecorder (FE036800)>]: Registered MCM Recorder at MCM.
greenmango12 Posted January 28, 2022 Author Posted January 28, 2022 20 minutes ago, Sailing Rebel said: OnInit and ConfigInit will only be called once, cleaning will not change this. If you are only going to use those events, then test in a new game every time: at the main menu, open the console and enter coc qasmoke. This will spawn a default character in a test cell. Wait until the MCMs are registered, then check your menu. Otherwise: Event OnConfigOpen() mytags = new string[10] mytags[0] = "NONE" mytags[1] = "aggressive" mytags[2] = "bound" mytags[3] = "Missionary" mytags[4] = "DoggyStyle" mytags[5] = "Cowgirl" mytags[6] = "Pillory" mytags[7] = "Xcross" mytags[8] = "Bed" mytags[9] = "animobject" EndEvent And remove the SetAnimTags function. Ok I seems reply first.. I will test without use function.. (I understand,, it need not ^^; ) and is there way to clean up mytag as empty... once..(initialize?),,, so to avoid it try to set new item over 0 to 9 ... And untill change script (remove function), as you know.. so there is mytags array... but not shown in list..
greenmango12 Posted January 28, 2022 Author Posted January 28, 2022 Ah... thanks...,, there seems one mod which may effect MCM loading way... so I remove it,,.. now it finally work...? (so my mod need some master mods.. then I do not hope to make new profile for this specific issue.. (to keep each mod master relation and confirm ^^;) I may report, which mod stop to load / update list .... after confirm it... (at current just guess .. so do not hope to miss report and blame the mod) And really thanks you take time.. @Sailing Rebel without your help.. I never plan to use onConfigload...and may be give up easy ^^;
Sailing Rebel Posted January 28, 2022 Posted January 28, 2022 Spoiler Only test in a new game, every time. Make sure all properties have been set on the script in CK. Ensure that the GlobalVariable anim1n_pm has an appropriate value defined in CK (or set a default value in the script). Remove SetAnimTags, define the mytags array in OnConfigOpen. Use these settings to get line numbers in the Papyrus log: [Papyrus] bEnableLogging=1 bEnableTrace=1 bLoadDebugInformation = 1 Didn't see you reply before posting. Glad you got it sorted.
greenmango12 Posted January 28, 2022 Author Posted January 28, 2022 I found what cause issue.. it is not other MCM related mod,, The reason was, I set first value of the Array ... eg Array[0} ="None" or "NONE" etc.. (do not know reason though.. but I need option non set tag.. then I set so for first index value.. "" or "None" or "NONE" everytime." Then I happend to change it as "--None--" or other word.. If I use "None" for the list[0] , MCM seems miss consider.. the Array is None.. only when MCM generate list (in menu)... I now try same thing... then when I set mytag[0} == "None" it show same issue again. it seems only happen when open menu.. but I return mytag[0] == "--None--" ... it can generate list for same save data..
Recommended Posts
Archived
This topic is now archived and is closed to further replies.