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...
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; orSet 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...
uhmattbravo Posted April 15, 2016 Share Posted April 15, 2016 You shouldn't need the second 1 after DoOnce. Also, couldn't you just use another terminal menu instead of a message box? Like just have options for both with a variable set up for the conditions? Link to comment Share on other sites More sharing options...
Xena95 Posted April 15, 2016 Author Share Posted April 15, 2016 Doesn't seem to work without the additional 1, In fact i think the only reason it dose work with the additional 1 is because the script is only valid unto DoOnce is set to 1 1.. After that nothing else runs before or after the "Set DoOnce 1 1" Command I'm not using any GameBlocks maybe that has something to do with it? The reason why I'm not using another terminal menu instead of a message box, is because i cant Set a DoOnce variable to a 'Terminal Menu Item' Link to comment Share on other sites More sharing options...
uhmattbravo Posted April 15, 2016 Share Posted April 15, 2016 (edited) First, you'll need a block of some sort probably Begin GameMode. That's probably what's breaking your script. Second, for the terminal, you could make a quest, with a script attached that reads "scn myquestscript Short do once" (This one doesn't need blocks) And tick the start game enabled box on the quest, and it'll store just your variable. From there, you could just set a condition on the terminal option to getquestvariable then choose your quest then your variable. Set the first option to check for 0 on the do once and put "set myquest.doonce to 1" in the result script. Then set the other to look for doonce to equal 1 Edited April 16, 2016 by uhmattbravo Link to comment Share on other sites More sharing options...
Xena95 Posted April 16, 2016 Author Share Posted April 16, 2016 Legend! Using Quest Stages to store variables works like a charm. 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 Thanks a million uhmattbravo Link to comment Share on other sites More sharing options...
Recommended Posts