Skip to content

Examples for the experimental features. #7444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jan 15, 2025

Conversation

Moderocky
Copy link
Member

Description

To help give testers some initiative, I've created some example scripts for 2.10's experimental features (queues, for each loops, script reflection).

I've also tweaked an issue I noticed with queues (namely, you couldn't loop them as a variable since they looked like a single value). I think this issue is probably more widespread (any containerised value) but that will need investigating later.

I added a new structure specifically for examples: example!
Code in this structure is parsed (so examples would still report parse errors) but the code is discarded and never run.

example:
    kill the player
    teleport the player to {the moon}
    # Nothing here gets run

This can be used to set up little code snippet examples, without needing to create some involved structure.
The existing example scripts all have to be whole things (events, commands, etc.) and it can be quite complicated to make a clean example for some features. I'm hoping this will encourage some more introductory content to be made.

@Moderocky Moderocky added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. housekeeping Housekeeping-related issue or task. 2.10 Targeting a 2.10.X version release labels Jan 15, 2025
@Moderocky Moderocky marked this pull request as ready for review January 15, 2025 13:01
@Moderocky Moderocky requested a review from Efnilite January 15, 2025 13:43
@Moderocky Moderocky requested a review from Efnilite January 15, 2025 15:53
@Moderocky Moderocky force-pushed the new-feature-examples branch from 42b8280 to afc1fb1 Compare January 15, 2025 17:23
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes, a couple things

Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content seems okay. Seems like a few typos need fixed (test failures) (and Queue was throwing an assertion error? check logs)

@Moderocky Moderocky force-pushed the new-feature-examples branch from 73d9b0e to 9bcd43c Compare January 15, 2025 18:50
Copy link
Member

@cheeezburga cheeezburga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some indentation inconsistencies between files but looks good

@Efnilite Efnilite merged commit 1fab937 into SkriptLang:dev/feature Jan 15, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.10 Targeting a 2.10.X version release bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. housekeeping Housekeeping-related issue or task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants