Jump to content

Two scripting 'jobs' pending. Ideas on how to go...


antstubell

Recommended Posts

Back to the 'Pressing Buttons In Correct Sequence' thing. I'm kind of stuck. I am taking the approach of using Int Properties so the script looks for the expected value and checks it against the required value. Then sets a new value.

Button 1 - stores 1 in a global variable.

Button 2 - stores 2 in a global variable.

And so on up to 8

Buttons have to be pressed in order, simply Button 1, Button 2, Button 3... Button 8.

So for example-

Button 6 needs to check that the value stored in the Global variable is 5 then set it to 6

Button 7 needs to check that the value stored in the Global variable is 6 then set it to 7

 

What I've scripted so far, haven't compiled yet as it probably has syntax errors is this...

 

GlobalVariable Property StoredValue Auto; number stored when a button is pressed
Int Property InputValue Auto; Input the number of this button

Event OnActivate(ObjectReference akActionRef)

If (StoredValue.GetValue()) == (InputValue); check that the previously stored value matches the value that we input
debug.notification("This is the next correct button in the sequence")
StoredValue.SetValue(InputValue)

Else
StoredValue.SetValue(0)
debug.notification("Incorrect. Start Over.")

Endif
Endevent

 

I looked at arrays and although I understand what they are and what they do, I can't quite get my head around scripting them. haven't found any good examples to work from. But does my approach make sense?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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