Slikpik Posted March 4, 2013 Share Posted March 4, 2013 So, I've seen the Begin MenuMode function and then numbers after that. What I think they are is just a random number that you put in. Like the script would be: scn MessageScript Short Button Begin MenuMode 124557 Set Button to GetButtonPressed If (Button == 3) (script goes here) endif end That number would be the one for the message that appears, would I use that for every other script I use that uses the same message? I hope I make sense. If not, explain to me what the number is after MenuMode please. Link to comment Share on other sites More sharing options...
llamaRCA Posted March 4, 2013 Share Posted March 4, 2013 You need the wiki link here. MenuMode can be a block type or a function. The different numbers represent what kind of menu you are looking for. Here's the link for the block type. Link to comment Share on other sites More sharing options...
Slikpik Posted March 4, 2013 Author Share Posted March 4, 2013 ?? Link to comment Share on other sites More sharing options...
llamaRCA Posted March 4, 2013 Share Posted March 4, 2013 ??Ya, sorry. At first I read what you wrote which is you were looking for the function, but what you have in your code is the menu mode. So I've now given you the link to the block type. Link to comment Share on other sites More sharing options...
Xaranth Posted March 4, 2013 Share Posted March 4, 2013 (edited) Terminology: menuMode is a blocktype, not a function. menuMode itself: The 'begin menuMode' block executes when the game is in menu mode. Essentially, if the game is not in gameMode, it's in menu mode. Messages are menuModes, as are the PipBoy, dialog, companion wheel, etc. Each TYPE of menu has a specific designation. For example, the message box menu is 1001, that's the numeric code that appears after 'begin menuMode'. A full list of the numbers can be found here. Here's a script I use for handling message buttons in DARC:PH:scn DARC07scptTeleporterActiMobile ref rTarget short sCharge short sMenu short sMyButton short sFBs short sMessageFlag begin onActivate Set sCharge to DARC07qstTeleporterControl.sCharges Set sMessageFlag to 1 end begin GameMode if sMessageFlag == 1 Set sMenu to 1 Set sMessageFlag to 0 Set sCharge to DARC07qstTeleporterControl.sCharges ShowMessage DARC07msgFTUMenu01 sCharge elseIf sMessageFlag == 2 Set sMessageFlag to 0 Set sMenu to 2 Set sCharge to DARC07qstTeleporterControl.sCharges Set sFBs to Player.getItemCount FissionBattery ShowMessage DARC07msgFTUMenu02 sFBs sCharge elseIf sMessageFlag == 3 Set sMessageFlag to 0 Set sMenu to 3 ShowMessage DARC07msgFTUMenuError elseIf sMessageFlag == 4 Set sMessageFlag to 0 Autosave Set DARC07qstTeleporterControl.sCharges to DARC07qstTeleporterControl.sCharges - 1 Set sCharge to DARC07qstTeleporterControl.sCharges Set rTarget to DARC07refTeleportMarker DARC07refBunkerMainDoor.Lock 255 Set DARC07qstTeleporterControl.bTeleported to 1 player.moveTo rTarget ShowMessage DARC07msgFTUCUCnt sCharge endIf end begin MenuMode 1001 Set sMyButton to GetButtonPressed if sMenu == 1 if sMyButton == 0 if sCharge > 0 Set sMessageFlag to 4 else Set sMessageFlag to 3 endIf elseIf sMyButton == 1 player.addItem DARC07tokenTeleClean 1 1 elseIf sMyButton == 2 Set sMessageFlag to 2 endIf elseIf sMenu == 2 if sMyButton == 0 player.removeItem FissionBattery 2 Set DARC07qstTeleporterControl.sCharges to DARC07qstTeleporterControl.sCharges + 1 Set sCharge to DARC07qstTeleporterControl.sCharges ShowMessage DARC07msgFTUCUCnt sCharge elseIf sMyButton == 1 player.removeItem FissionBattery 4 Set DARC07qstTeleporterControl.sCharges to DARC07qstTeleporterControl.sCharges + 2 Set sCharge to DARC07qstTeleporterControl.sCharges ShowMessage DARC07msgFTUCUCnt sCharge elseIf sMyButton == 2 player.removeItem FissionBattery 6 Set DARC07qstTeleporterControl.sCharges to DARC07qstTeleporterControl.sCharges + 3 Set sCharge to DARC07qstTeleporterControl.sCharges ShowMessage DARC07msgFTUCUCnt sCharge elseIf sMyButton == 3 player.removeItem FissionBattery 8 Set DARC07qstTeleporterControl.sCharges to DARC07qstTeleporterControl.sCharges + 4 Set sCharge to DARC07qstTeleporterControl.sCharges ShowMessage DARC07msgFTUCUCnt sCharge elseIf sMyButton == 4 player.removeItem FissionBattery 10 Set DARC07qstTeleporterControl.sCharges to DARC07qstTeleporterControl.sCharges + 5 Set sCharge to DARC07qstTeleporterControl.sCharges ShowMessage DARC07msgFTUCUCnt sCharge endIf endIf endEdit: Hi Llama. :wink: Edited March 4, 2013 by Xaranth Link to comment Share on other sites More sharing options...
llamaRCA Posted March 4, 2013 Share Posted March 4, 2013 Terminology: menuMode is a blocktype, not a function. Edit: Hi Llama. :wink:Hi, Xaranth This is why it's confusing when a modder who isn't a RL programmer is first starting out: There's MenuMode and then there's MenuMode :smile: llama Link to comment Share on other sites More sharing options...
Xaranth Posted March 4, 2013 Share Posted March 4, 2013 ...Wow. That's funny. Used as an object condition, it doesn't work right, and if you use it in a script, it can only be used in a menuMode block making it mostly (I can think of a couple cases) redundant. I love this game. Really. Link to comment Share on other sites More sharing options...
Slikpik Posted March 4, 2013 Author Share Posted March 4, 2013 (edited) Thanks. While we're on messages, what's wrong with this? scn MISSING3QuestScript Short bMDoOnce Short MButton Begin GameMode if (bMDoOnce != 1) ShowMessage MISSING3Startup StartQuest Missing3 Set bMDoOnce to 1 If IsModLoaded "The Unlocker.esp" ShowMessage Missing3SlickUnlocker endif endif end Begin MenuMode 1001 Set MButton to GetButtonPressed if (MButton == 0) con_QuitGame endif end I want it to quit game but nothing happens when I press the button. What do I need to make it exit game? Edited March 4, 2013 by Slikpik Link to comment Share on other sites More sharing options...
Slikpik Posted March 4, 2013 Author Share Posted March 4, 2013 Hey? I know I shouldn't bump but I kinda think you think this has died because I don't need help. Just in case... Link to comment Share on other sites More sharing options...
Xaranth Posted March 4, 2013 Share Posted March 4, 2013 Uhm., I suspect your menumode is out of sync with the quest script; a quest script by default runs only once every five seconds. What you need to do is pass the menu handling code to a token or something else that will run constantly. The menuMode code in the questScript will only run if you happen to be in menumode with it on; you basically have a one-frame window to catch it. Link to comment Share on other sites More sharing options...
Recommended Posts