Auroriax / PuzzleScriptPlus

Puzzlescript Plus: Open Source HTML5 Puzzle Game Engine (with lots of extra functionality)
https://auroriax.github.io/PuzzleScript/
35 stars 5 forks source link

Can't twiddle the same metadata more than once per turn #106

Closed Auroriax closed 1 year ago

Auroriax commented 1 year ago

Describe the bug If you change the same metadata two or more times per turn, only the first twiddle of that turn is actually enacted. (Seemingly because of an optimization that makes perfect sense in vanilla PS, but can cause some weird edge cases like this in PS+.)

There are use cases for twiddling multiple times per turn I think (the one that was reported had a "gameplay" time and a "victory" time, and if later in the turn you detect victory, you can just change it a second time instead of doing a weird workaround like saving it to an object or something, like I did for Sorting of Sorts).

Reproduction Steps

  1. Load the "Basic" PS example
  2. Replace the rules with:
    [ >  Player | Crate ] -> again_interval 0.5
    [ >  Player | Crate ] -> again_interval 0.8
  3. Run the game with verbose logging, then walk into a crate. You'll see that only the first command is reported and executed.

What did you expect would happen? Either a warning or simply being allowed to change the same metadata field multiple times per turn.

OS & Browser version, desktop/mobile Windows 10, Firefox

Screenshots, example projects, other relevant issues, etc. N/A