UESP Forums http://forums.uesp.net/ |
|
Please help to create a multi-menu MessageBox http://forums.uesp.net/viewtopic.php?f=10&t=41552 |
Page 1 of 1 |
Author: | Sergeek [ Mon Aug 21, 2023 8:04 pm ] |
Post subject: | Please help to create a multi-menu MessageBox |
I am at loss. I read the Guide at wiki and another one at Nexus, but they are so complicated, and they only got me so far... I want to make a book that prompts a MessageBox (above its actual contents, like in Oghma Infinium) with four initial choices when you read it both from the floor and from the inventory (hence both Activate and Equip beginnings). These choices being the three skill specializations and "exit" button. Upon clicking the specializations, another menu should appear with seven respective skills plus the "back" button. Each skill button should increase the respective skill with ModPCSkill command by one, while keeping you inside the same specialization menu. The "back" button should return you to the initial menu where you select specializations. It is way beyond my understanding. I only managed to make a single-layer menu that keeps you inside of it, when you choose the first three options. Code: ScriptName MyBook short Choosing short Choice Begin OnActivate Activate Set Choosing to 1 End Begin OnEquip Set Choosing to 1 End Begin MenuMode If ( Choosing == 1 ) MessageBox "Select Specializations", "Combat", "Magic", "Stealth", "Exit" Set Choosing to 2 Set Choice to -1 ElseIf ( Choosing == 2 ) If ( Choice == -1 ) Set Choice to GetButtonPressed ElseIf ( Choice == 0 ) Set Choosing to 1 ElseIf ( Choice == 1 ) Set Choosing to 1 ElseIf ( Choice == 2 ) Set Choosing to 1 ElseIf ( Choice == 3 ) Set Choosing to 0 EndIf EndIf If ( Choosing == 0 ) return EndIf End Please, I have no background in coding and any feedback will be greatly appreciated. |
Author: | Balota [ Sat Aug 26, 2023 6:51 pm ] |
Post subject: | Re: Please help to create a multi-menu MessageBox |
I've been a VB6 programmer for about 35 years. This isn't that language, but the structure and function of If, ElseIf, EndIf is pretty universal. I think your problem may be pretty simple. Your first If block in MenuMode checks to see if Choosing = 1. If it does, it sets Choosing = 2 and Choice = -1. So far, so good. But then you use ElseIf. The problem is that after the program executes the If block, it skips over the ElseIf to the EndIf. Replace ElseIf ( Choosing == 2 ) with the following: EndIf If (Choosing == 2) Hope that helps. |
Author: | Lord Timster [ Sun Aug 27, 2023 10:58 pm ] |
Post subject: | Re: Please help to create a multi-menu MessageBox |
Firstly I would recommend starting with just one skill in your book. When the basic framework does what it's supposed to then expand it bit by bit checking it still works at every step. I haven't written any mods for Oblivion but I had a look at the cs wiki tutorials and I think that the code for the MenuMode section (for one skill) could look something like this... I am not 100% sure about some of the details... but I can't test it on the XBox. Code: Begin MenuMode
If ( Choosing == 0 ) return EndIf If ( Choosing == 1 ) MessageBox "Select Specialization", "Combat", "Exit" Set Choosing to -1 Set Choice to -1 ElseIf ( Choosing == -1 ) If ( Choice == -1 ) Set Choice to GetButtonPressed ElseIf ( Choice == 0 ) Set Choosing to 10 ElseIf ( Choice == 1 ) Set Choosing to 0 EndIf ElseIf ( Choosing == 10 ) MessageBox "Select Skill", "Blade", "Back" Set Choosing to -10 Set Choice to -1 ElseIf ( Choosing == -10 ) If ( Choice == -1 ) Set Choice to GetButtonPressed ElseIf ( Choice == 0 ) ModPCSkill Blade 1 Set Choosing to 10 ElseIf ( Choice == 1 ) Set Choosing to 1 EndIf EndIf End |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |