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

Mid-line comments in Legend - incompatible from Vanilla to PS+ #120

Open ryanmberry opened 11 months ago

ryanmberry commented 11 months ago

I am exploring moving my vanilla PuzzleScript game to PS+. Everything mostly works, but I discovered an incompatibility. I can work around it no problem, but it seems like it has the potential to cause some sneaky bugs for other folks who are porting over.

Describe the bug In vanilla, I can use comments in the middle of lines in the legend section. For example, consider the code Pusher = Player1 (or Player2) or Player3. This code comments out the inclusion of Player2 in the definition of Pusher. This results in Player1 and Player3 being pushers, but not Player2. This is what I expected.

If I include the same code in PS+, everything in the line after the open parenthesis is excluded. In this case, only Player1 is defined as a Pusher, and Player2 and Player3 are not.

Reproduction Steps I've included sample code at the bottom of this issue that can be run on either Vanilla or PS+. Run the game and move your players up. Observe that in vanilla, both Player1 and Player3 can push the crate, while on PS+, only Player1 can push the crate. The relevant line of code is line 79, the last line in the legend.

title PS Plus Comment Bug Demo
author wryandbeary
homepage https://wryandbeary.itch.io/

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

Background
lightgreen green
11111
01111
11101
11111
10111

Target
darkblue
.....
.000.
.0.0.
.000.
.....

Wall
brown darkbrown
00010
11111
01000
11111
00010

Player1
black orange white blue
.000.
.111.
22222
.333.
.3.3.

Player2
black orange white red
.000.
.111.
22222
.333.
.3.3.

Player3
black orange white yellow
.000.
.111.
22222
.333.
.3.3.

Crate
orange
00000
0...0
0...0
0...0
00000

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

. = Background
# = Wall
1 = Player1
2 = Player2
3 = Player3
* = Crate
@ = Crate and Target
O = Target

Player = Player1 or Player2 or Player3
Pusher = Player1 (or Player2) or Player3
=======
SOUNDS
=======

Crate move 36772507

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

Background
Target
Player1, Player2, Player3, Wall, Crate

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

[> Pusher | Crate | ] -> [ | Pusher | Crate]

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

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

######
#....#
#....#
#.***#
#.123#
#....#
######
ryanmberry commented 11 months ago

Windows 10, Chrome.

david-pfx commented 8 months ago

This bug is fixed in PS Next.