Jump to content

Recommended Posts

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 DoOnce

If ( DoOnce == 0 )
ShowMessage TerminalMessage01
Set DoOnce to 1
endIf

; 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 work

I 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

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

; or

Set 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

; or

Set DoOnce to 1 1

; Equals

Set 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 DoOnce

If DoOnce == 0
ShowMessage TerminalMessage01
Set DoOnce to 1 1
endIf

; Second Part

If DoOnce == 1
ShowMessage TerminalMessage02
endIf

________________________________________________________________________________________________________________

Link to comment
Share on other sites

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 TerminalSubMenu1SCRI

If getStage TerminalSubMenu1QUES == 20
ShowMessage TerminalMessage02
endIf

If getStage TerminalSubMenu1QUES < 10
SetStage TerminalSubMenu1QUES 10
endIf

If getStage TerminalSubMenu1QUES == 10
ShowMessage TerminalMessage01
SetStage TerminalSubMenu1QUES 20
endIf

 

Cheers for your input FrankFamily (:

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...