DaylenTheMaleficar Posted June 14, 2014 Share Posted June 14, 2014 I'm have a couple of issues getting some message boxes to work. The first issue is with getting a GlobalVariable to display in the box. I've put the <Global=MyGlobal> into the message field, added them to the list on the Quest Data tab, and put UpdateCurrentInstanceGlobal() for the globals at the start of the script, yet the message box always displays [...] where the numbers should be. My second problem is that each message box pops up at least once immediately after I make a selection, which really screws me over given that the selections make permanent changes to the script and stack. Here's the gist of my menu script: Function SpendPoints(int aiButton = 0, int abMenu = 0) While abMenu == 0 if aiButton != -1 aiButton = LevelUp.show() if (aiButton == 0 && Endurance.GetValueInt() < 100) Endurance.mod(1 + ssEndInc.GetValueInt()) ssEndInc.SetValue(0) ssEndIncUsed.SetValue(1) abMenu = 1 elseif (aiButton == 1 && Agility.GetValueInt() < 100) Agility.mod(1 + ssAgiInc.GetValueInt()) ssAgiInc.SetValue(0) ssAgiIncUsed.SetValue(1) abMenu = 1 ; . ; . ; . And so on... ; . elseif (aiButton == 6 && Willpower.GetValueInt() < 100) Willpower.mod(1 + ssWilInc.GetValueInt()) ssWilInc.SetValue(0) ssWilIncUsed.SetValue(1) abMenu = 1 endif endif endWhile While abMenu == 1 if aiButton != -1 aiButton = LevelUp2.show() if (aiButton == 0 && Endurance.GetValueInt() < 100) Endurance.mod(1 + ssEndInc.GetValueInt()) ssEndInc.SetValue(0) ssEndIncUsed.SetValue(1) abMenu = 2 ; . ; . ; . And so on... ; . elseif (aiButton == 6 && Willpower.GetValueInt() < 100) Willpower.mod(1 + ssWilInc.GetValueInt()) ssWilInc.SetValue(0) ssWilIncUsed.SetValue(1) abMenu = 2 endif endif endWhile endFunction What causes these menus to pop up twice, and how do I stop it? (They're triggered when the Level Up menu opens, if that helps) Link to comment Share on other sites More sharing options...
DaylenTheMaleficar Posted June 14, 2014 Author Share Posted June 14, 2014 Okay, for testing purposes, I've simplified the code a great deal, yet the message continues to display multiple times even though I've set up a While that should end as soon as an input is returned. Can anyone tell what I'm doing wrong? Event OnInit() RegisterForMenu("LevelUp Menu") UpdateCurrentInstanceGlobal(ssEndInc) UpdateCurrentInstanceGlobal(ssWilInc) EndEvent Event OnMenuOpen(String MenuName) if MenuName == "LevelUp Menu" HasLeveled = True endif endEvent Event OnMenuClose(String MenuName) if MenuName == "LevelUp Menu" While HasLeveled == True Utility.Wait(1) Menu() Utility.Wait(1) CalcStats() HasLeveled = False endWhile endif endEvent Function Menu(Bool abMenu = True, Int aiButton = 0) While abMenu If aiButton != -1 aiButton = LevelUp.show() abMenu = False ; End the function if aiButton == 0 Endurance.mod(1 + ssEndInc.GetValueInt()) ssEndInc.SetValue(0) ssEndIncUsed.SetValue(1) elseif aiButton == 1 Agility.mod(1 + ssAgiInc.GetValueInt()) ssAgiInc.SetValue(0) ssAgiIncUsed.SetValue(1) elseif aiButton == 2 Strength.mod(1 + ssStrInc.GetValueInt()) ssStrInc.SetValue(0) ssStrIncUsed.SetValue(1) elseif aiButton == 3 Speed.mod(1 + ssSpeInc.GetValueInt()) ssSpeInc.SetValue(0) ssSpeIncUsed.SetValue(1) elseif aiButton == 4 Intelligence.mod(1 + ssIntInc.GetValueInt()) ssIntInc.SetValue(0) ssIntIncUsed.SetValue(1) elseif aiButton == 5 Personality.mod(1 + ssPerInc.GetValueInt()) ssPerInc.SetValue(0) ssPerIncUsed.SetValue(1) elseif aiButton == 6 Willpower.mod(1 + ssWilInc.GetValueInt()) ssWilInc.SetValue(0) ssWilIncUsed.SetValue(1) endif EndIf EndWhile Debug.Notification("While Ended") EndFunction Link to comment Share on other sites More sharing options...
lofgren Posted June 15, 2014 Share Posted June 15, 2014 I'm going to go out on a limb and guess that you've made mods for Oblivion. Link to comment Share on other sites More sharing options...
DaylenTheMaleficar Posted June 15, 2014 Author Share Posted June 15, 2014 I'm going to go out on a limb and guess that you've made mods for Oblivion.Nope ;) Fixed The double message box thing hours ago, but still have no Idea what's going on with the <Global=MyGlobal> not displaying a number... Link to comment Share on other sites More sharing options...
lofgren Posted June 15, 2014 Share Posted June 15, 2014 Did you just get rid of that useless "while" loop? Oblivion scripting required a loop for message boxes to display properly, but Skyrim doesn't. That's why I guessed you had been scripting for Oblivion. As for the issue with the global, are you testing on a new game or a save game? Link to comment Share on other sites More sharing options...
DaylenTheMaleficar Posted June 15, 2014 Author Share Posted June 15, 2014 Well, the While thing I got from a CK wiki page. Guess the guy who wrote that got it from Oblivion. I've been testing this mod using a vanilla save made just before the racesex menu opens. Link to comment Share on other sites More sharing options...
lofgren Posted June 15, 2014 Share Posted June 15, 2014 Vanilla save meaning your mod was not loaded when the save was made? Next question: Did you associate the message box with the quest? Link to comment Share on other sites More sharing options...
DaylenTheMaleficar Posted June 15, 2014 Author Share Posted June 15, 2014 (edited) Yes. EDIT: OH! I just forgot to define the quest as a property. Should be in order now. Thank you for being such a consistently helpful person! Edited June 15, 2014 by DaylenTheMaleficar Link to comment Share on other sites More sharing options...
DaylenTheMaleficar Posted June 15, 2014 Author Share Posted June 15, 2014 Oh ffs. Still not working. Link to comment Share on other sites More sharing options...
Recommended Posts