Rewrite the Default Examples
Description
This replaces all of the original examples.
Examples are moved to a (disabled) sub-folder -examples/ to avoid cluttering the main directory.
Note: others may wish to add more examples, in which case they are welcome to edit the PR directly. I wouldn't mind having examples for conditions (if/else) and the built-in functions, but didn't feel these were necessary.
Motivation
The original examples were very old and did not cover a lot of Skript's feature-set (e.g. functions, local variables.) Personally, I felt they were also inappropriate as they encouraged users to simply use the example scripts rather than bothering to write their own.
We also needed examples to cover a range of features to test Skript Grammar and if we ever want to create a Language Tour.
Changes
The new examples are designed with three things in mind:
- To display most of Skript's feature set.
New users should be able to 'explore' the language with the examples to see what's possible. - To have a range of difficulties.
I have tried to include a very simple, moderate and intermediate example for each core feature.
New users shouldn't feel overwhelmed, but the examples aren't overly-simple and unhelpful. - To make the examples more abstract and 'ideas' based.
I'd rather encourage users to think and experiment rather than just copying and using the examples - I've tried to make them more focused on the idea.
Users should understand how to use the feature, rather than just pasting what's given to them.
The current features with examples are:
- Chest inventories
- Commands
- Events
- Functions
- Loops
- Meta (options/aliases/variables section)
- Text formatting
- Timings
- Variables
Some examples may need adjusting or replacing over time.
Target Minecraft Versions: any Requirements: none Related Issues: #2252
This PR has a related issue #2252
There is a million nitpicking that we could do, but at the end of the day, they're the example scripts. This should get merged soon.
We should require example scripts from big additions, like the effect section for spawning entities or what I want to add is an example for my pull requests. When this gets merged I can start adding scripts into the folder.
There is a million nitpicking that we could do, but at the end of the day, they're the example scripts. This should get merged soon.
We should require example scripts from big additions, like the effect section for spawning entities or what I want to add is an example for my pull requests. When this gets merged I can start adding scripts into the folder.
I think adding examples as skript grows would be something that's great to do and a great thing to encourage. The biggest issue with skript was how outdated/uninformed features/examples were and newer additions ended up overlooked or never even heard about. Sections especially were overlooked by the community with the fact most people I meet don't realize spawn is a section
or just don't even know what a section is. Tho partially due to the fact spawn section didn't keep temp variables.