Xena95 Posted April 15, 2016 Share Posted April 15, 2016 Hey guys, I'm doing some scripting in Fallout 3 for a mod I'm creating and I have run into some trouble. The script is for a "Terminal Sub-Menu - Menu Item" and is attached vir the 'Item result script' window found in the GECK 'Terminal' window. A quick run down on this scrips purpose.. When i activate the target terminal i select a Menu Item which takes me to a Sub-Menu, Within that Sub-Menu i can select a Menu Item (of which the script is attached) which will run the script and open a 'Message Box' with a Yes and No button, However i only want this 'Message Box' to be displayed once (only the first time i select this 'Menu Item'), the next time i select the same 'Menu Item' i want in to do something different. Short DoOnceIf ( DoOnce == 0 )ShowMessage TerminalMessage01Set DoOnce to 1endIf; Stop Script here.; Continue Script here next time the script runs.If ( DoOnce == 1 ); Do something different.endIf The problem is i cant get the "ShowOnce" Variable to workI can set "ShowOnce" to "1" before showing the 'Message Box' but for some reason i cant set it to "1" after showing the 'Message Box'. If anyone can help me with this script i would greatly appreciate it. Link to comment Share on other sites More sharing options...
FrankFamily Posted April 15, 2016 Share Posted April 15, 2016 Maybe this works better: Short DoOnce If ( DoOnce == 0 ) Set DoOnce to 1 ShowMessage TerminalMessage01 elseIf ( DoOnce == 1 ) ; Do something different. endIf Link to comment Share on other sites More sharing options...
Xena95 Posted April 15, 2016 Author Share Posted April 15, 2016 Cheers for the help man. Didn't work unfortunately.. completely ignores the 'if' statement for some reason. Link to comment Share on other sites More sharing options...
Xena95 Posted April 15, 2016 Author Share Posted April 15, 2016 Okay so i got the First Part to work.. Having trouble with the Second Part. Not sure what effect this has but it's seems to fix the initial problem: Set DoOnce to 1 1; orSet DoOnce to 1 DoOnce________________________________________________________________________________________________________________ ; So...Set DoOnce to 1 DoOnce; or Set DoOnce to 1 1; Returns the value of 1 meaning 'TRUE'________________________________________________________________________________________________________________ ; So... That means..Set DoOnce to 1 DoOnce; orSet DoOnce to 1 1; EqualsSet DoOnce to 1 "TRUE' Hope this helps for anyone else that runs into this problem.________________________________________________________________________________________________________________ Now for the Second Part of my Script.. Need some help. I'm trying to show a Different message after 'DoOnce' has been set to "TRUE"Having trouble however..________________________________________________________________________________________________________________; First Part Short DoOnceIf DoOnce == 0ShowMessage TerminalMessage01Set DoOnce to 1 1endIf ; Second PartIf DoOnce == 1ShowMessage TerminalMessage02endIf________________________________________________________________________________________________________________ Link to comment Share on other sites More sharing options...
Xena95 Posted April 16, 2016 Author Share Posted April 16, 2016 It works (: Thanks to some advice courtesy of uhmattbravo I still don't understand why i can only set a variable once in a terminal script, however this is no longer relevant. Solution... Scn TerminalSubMenu1SCRIIf getStage TerminalSubMenu1QUES == 20 ShowMessage TerminalMessage02endIfIf getStage TerminalSubMenu1QUES < 10 SetStage TerminalSubMenu1QUES 10endIf If getStage TerminalSubMenu1QUES == 10 ShowMessage TerminalMessage01 SetStage TerminalSubMenu1QUES 20endIf Cheers for your input FrankFamily (: Link to comment Share on other sites More sharing options...
Recommended Posts