Player solving the puzzle when they shouldn't be able to

27 views
Skip to first unread message

AcousticJamm

unread,
Oct 8, 2025, 11:52:48 PM (11 days ago) Oct 8
to PuzzleScript
I'm making a PuzzleScript Next game and I need help figuring out the rules.

```
[Flag] -> [FlagFake]

(start sliding)
[up PlayerLeft   ] -> [up    PSUL] again
[down PlayerLeft ] -> [down  PSDL] again
[up PlayerRight   ] -> [up    PSUR] again
[down PlayerRight ] -> [down  PSDR] again
[left Player ] -> [left  PSL] again
[right Player] -> [right PSR] again

(stop at obstacles)
up    [PSUL | wall] -> [PlayerLeft | wall]
down  [PSUR | wall] -> [PlayerRight | wall]
up    [PSDL | wall] -> [PlayerLeft | wall]
down  [PSDR | wall] -> [PlayerRight | wall]
left  [PSL | wall] -> [PlayerLeft | wall]
right [PSR | wall] -> [PlayerRight | wall]

(bump boxes)
up    [PSUL | crate | no wall] -> [PlayerLeft | | crate]
down  [PSUR | crate | no wall] -> [PlayerRight | | crate]
up    [PSDL | crate | no wall] -> [PlayerLeft | | crate]
down  [PSDR | crate | no wall] -> [PlayerRight | | crate]
left  [PSL | crate | no wall] -> [PlayerLeft | | crate]
right [PSR | crate | no wall] -> [PlayerRight | | crate]

(slide)
[PSUL] -> [up    PSUL] again
[PSUR] -> [up    PSUR] again
[PSDL] -> [down  PSDL] again
[PSDR] -> [down  PSDR] again
[PSL] -> [left  PSL] again
[PSR] -> [right PSR] again

(player falls in water)
[player no ice] -> [ ]
[mover no ice] -> [ ]

late [FlagFake Player] -> [Flag Player]
```

What I want to happen is that if the player doesn't stop on the flag, they don't win. However, the issue rises when the player starts the turn directly next to Flag or FakeFlag; they move onto it and win, even if there isn't some sort of blocker to stop them on the flag. What gives? (PlayerLeft and PlayerRight are considered player. PSUR, PSUL, PSR, PSL, PSDR, and PSDL are considered mover.)

Chris Pickel

unread,
Oct 9, 2025, 4:13:16 AM (11 days ago) Oct 9
to AcousticJamm, PuzzleScript
Win conditions are checked after all the rules are applied, even if “again” will apply. So, if the player is on the flag, your late rule will apply, and trigger the win condition before the player moves off.
Rather than modifying the flag, you could place/move a marker at the beginning of the rules:

[PlayerOrigin] -> []
[Player] -> [Player PlayerOrigin]

Then a win condition of “all Player on PlayerOrigin” will check that rule evaluation didn’t move the player.

--
You received this message because you are subscribed to the Google Groups "PuzzleScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puzzlescript...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/puzzlescript/ead92fce-5297-4d4e-947d-a1d57eadf18cn%40googlegroups.com.

AcousticJamm

unread,
Oct 9, 2025, 7:09:09 AM (11 days ago) Oct 9
to PuzzleScript
Alright, that solved the issue. But there's a new issue now; in that case the player is right next to the flag and moves to it, the player stops on the flag. Now, they don't spawn a PlayerOrigin, which is good, but they do stop there and get to make another move from that position (sort of as if the player never turns into PSUR or something), which I don't want.

Here is the current set of rules:

(start sliding)
[up PlayerLeft   ] -> [up    PSUL] again
[down PlayerLeft ] -> [down  PSDL] again
[up PlayerRight   ] -> [up    PSUR] again
[down PlayerRight ] -> [down  PSDR] again
[left Player ] -> [left  PSL] again
[right Player] -> [right PSR] again

(stop at obstacles)
up    [PSUL | wall] -> [PlayerLeft PlayerOrigin | wall]
down  [PSUR | wall] -> [PlayerRight PlayerOrigin | wall]
up    [PSDL | wall] -> [PlayerLeft PlayerOrigin | wall]
down  [PSDR | wall] -> [PlayerRight PlayerOrigin | wall]
left  [PSL | wall] -> [PlayerLeft PlayerOrigin | wall]
right [PSR | wall] -> [PlayerRight PlayerOrigin | wall]

(bump boxes)
up    [PSUL | crate | no wall] -> [PlayerLeft PlayerOrigin | | crate]
down  [PSUR | crate | no wall] -> [PlayerRight PlayerOrigin | | crate]
up    [PSDL | crate | no wall] -> [PlayerLeft PlayerOrigin | | crate]
down  [PSDR | crate | no wall] -> [PlayerRight PlayerOrigin | | crate]
left  [PSL | crate | no wall] -> [PlayerLeft PlayerOrigin | | crate]
right [PSR | crate | no wall] -> [PlayerRight PlayerOrigin | | crate]


(slide)
[PSUL] -> [up    PSUL] again
[PSUR] -> [up    PSUR] again
[PSDL] -> [down  PSDL] again
[PSDR] -> [down  PSDR] again
[PSL] -> [left  PSL] again
[PSR] -> [right PSR] again

(player falls in water)
[player no ice] -> [ ]
[mover no ice] -> [ ]

(remove markers)
[PlayerOrigin no Player] -> [ ]

Chris Pickel

unread,
Oct 9, 2025, 7:51:53 AM (11 days ago) Oct 9
to AcousticJamm, PuzzleScript
Er, that doesn’t look like what I was suggesting. I meant the following. But, without a full working example, it’s hard to provide a working fix.

By the way, assuming there is only one player, there’s an alternate version where instead of tracking the player’s origin, you track the destination, which takes fewer rules.

```
[PlayerOrigin] -> []
[Player] -> [Player PlayerOrigin]

=============
WINCONDITIONS
=============
all Player on Flag
all Player on PlayerOrigin
```

Reply all
Reply to author
Forward
0 new messages