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

Changes to variables inside of choices are not preserved. #166

Open Broderick-Colin opened 2 years ago

Broderick-Colin commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

Steps To Reproduce select any choice but "I don't want to!" in the menu below. DoorsOpened should increment, but gets reset to 3 every time you return to the Puzzle header.

# RootSection
var DoorsOpened = 3

## 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 = DoorsOpened + 1

> ^

## Door2

Yes! Here's the treasure!

* DoorsOpened = DoorsOpened + 1

> ^

## Door3

Nada.

* DoorsOpened = DoorsOpened + 1

> ^

## secret_door

Double treasure!

* DoorsOpened = DoorsOpened + 1

> ^

## Continue

* DoorsOpened = 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.