[x] I have searched the tracker for similar issues (including closed ones)
[x] I have provided a detailed example for how this feature should work
[x] I have provided a use case for this feature, e.g. short description/share link of a game you're making and how you'd use the feature in that game, other things you've tried, edge cases, etc. (if applicable)
I'm suggesting an optional argument to the link rules command
late [ Player links ] -> link
is the current implementation, and triggers the link, sending you to the level defined in the LEVELS section
late [ Player links ] -> link levelname
would trigger the link, sending you to the level called levelname even if the current level doesn't have any links defined in the LEVELS section
Use case: I made a game with PuzzleScript Next with lots of levels, many of which are quite hard. The ideal structure for this game would be a hub world which lets you play them in any order, but doing this in the LEVELS section would mean having 20 unique objects, which feels a bit unwieldy. Doing it in a rule would potentially be a bit simpler, i.e. I could put the level entrances in a line and do something like this:
right [ Level_A Player | Level_A | Level_A ] -> link A1
right [ Level_A | Level_A Player | Level_A ] -> link A2
right [ Level_A | Level_A | Level_A Player ] -> link A3
right [ Level_B Player | Level_B | Level_B | Level_B ] -> link B1
right [ Level_B | Level_B Player | Level_B | Level_B ] -> link B2
right [ Level_B | Level_B | Level_B Player | Level_B ] -> link B3
right [ Level_B | Level_B | Level_B | Level_B Player ] -> link B4
Nice idea. I actually started out going in this direction, but switched tracks to avoid having a rule for each possible level. Having both looks (a) useful and (b) easy.😁
I'm suggesting an optional argument to the
link
rules commandlate [ Player links ] -> link
is the current implementation, and triggers the link, sending you to the level defined in the LEVELS sectionlate [ Player links ] -> link levelname
would trigger the link, sending you to the level calledlevelname
even if the current level doesn't have any links defined in the LEVELS sectionUse case: I made a game with PuzzleScript Next with lots of levels, many of which are quite hard. The ideal structure for this game would be a hub world which lets you play them in any order, but doing this in the LEVELS section would mean having 20 unique objects, which feels a bit unwieldy. Doing it in a rule would potentially be a bit simpler, i.e. I could put the level entrances in a line and do something like this: