Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Combination Lock Puzzle

Hi, I'm kind of stumped here, hoping someone can help me -
I've trying to do a bit where the player has to enter the correct code into a combination lock and then open it.  The way I've done it is to have each of the dials set their own $Dial# variable, and then create a variable for the lock as a whole with
<<set $Combination to "<<print $Dial1>> <<print $Dial2>> <<print $Dial3>> <<print $Dial4>> <<print $Dial5>>">>
That seems to work, and changing the individual $Dial variables seems to work fine.  However, when I use
<<if $Combination is "1 2 3 4 5">>Success!<<endif>>
It doesn't seem to work, even if <<print $Combination>> shows the result 1 2 3 4 5 in the same passage.
Does this make any sense at all?
Cheers.

Comments

  • Your &lt;&lt;set&gt;&gt; is not doing what you think it's doing.  Try the following instead:
    <<set $Combination to $Dial1 + " " + $Dial2 + " " + $Dial3 + " " + $Dial4 + " " + $Dial5>>
  • That seems to have done it - thanks!
Sign In or Register to comment.