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

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

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 by uhmattbravo
Link to comment
Share on other sites

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

 

Thanks a million uhmattbravo

Link to comment
Share on other sites

  • Recently Browsing   0 members

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