ImpowerGames / impower

An all-in-one, community-powered indie development platform that gives creative people the tools they need to bring their ideas to life.
https://www.impower.app
2 stars 1 forks source link

variableName += 1 does not increment the value of variableName #164

Open Broderick-Colin opened 2 years ago

Broderick-Colin commented 2 years ago

Describe the bug variableName += 1 does not increment the value of variableName

# RootSection
var DoorsOpened = 0

## Puzzle

Pick a door to open!

You've opened {DoorsOpened} doors
_
- Open Door # 1 > Door1
- Open Door # 2 > Door2
- Open Door # 3 > Door3
+ I don't want to! > Continue
* if (DoorsOpened >= 3):
  - Open the secret door > secret_door

## Door1

Nothing.

* DoorsOpened += 1

> ^

## Door2

Yes! Here's the treasure!

* DoorsOpened += 1

> ^

## Door3

Nada.

* DoorsOpened += 1

> ^

## secret_door

Double treasure!

* DoorsOpened += 1

> ^

## Continue

* DoorsOpened += 1

And so I moved on through the dungeon... and discovered the true treasure was the {DoorsOpened} doors I opened along the way

Screenshots image

lovelle-cardoso commented 2 years ago

@LemBurnstein This appears to be user error. You are making the doors redirect to RootSection not Puzzle (that's why it's being reinitialized). I think you meant to write # Puzzle not ## Puzzle to make it a parent of the doors.