Auroriax / PuzzleScriptPlus

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

Goto command on rule with variants causes silently failing builds #105

Closed Auroriax closed 1 year ago

Auroriax commented 1 year ago

Describe the bug If you use a goto command in a rule with variations (e.g. horizontal, or even something as simple as a block pushing rule) then when running the game the app wi

Reproduction Steps

  1. Add section S1 in your levels
  2. Add rule horizontal [ > Player | Crate ] -> [ > Player | > Crate ] goto S1
  3. Attempt to run the game.

What did you expect would happen? The game should compile. (If not possible: throw a proper error message)

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

Screenshots, example projects, other relevant issues, etc. Originally reported here: https://groups.google.com/g/puzzlescript/c/jq-GNn-6-R4

Auroriax commented 1 year ago

Slightly different compared to how I originally reported it, see edits to the message above.

Test case for this issue:

title PS+#105 Unit Test

debug

========
OBJECTS
========

Background
LIGHTGREEN

Target
DarkBlue

Wall
BROWN

Player
Black

Crate
Orange

=======
LEGEND
=======

. = Background
# = Wall
P = Player
* = Crate
@ = Crate and Target
O = Target

=======
SOUNDS
=======

================
COLLISIONLAYERS
================

Background
Target
Player, Wall, Crate

======
RULES
======

horizontal [ >  Player | Crate ] -> [  >  Player | > Crate  ] goto S1
vertical [ >  Player | Crate ] -> [  >  Player | > Crate  ] goto S2

==============
WINCONDITIONS
==============

All Target on Crate

=======
LEVELS
=======

section S1
####..
#.O#..
#..###
#@P..#
#..*.#
#..###
####..

section S2
######
#....#
#.#P.#
#.*@.#
#.O@.#
#....#
######