Skip to content

Commit cc7caa5

Browse files
sovdeethgitbook-bot
authored andcommitted
GITBOOK-60: No subject
1 parent ce0cf54 commit cc7caa5

25 files changed

+74
-43
lines changed

SUMMARY.md

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,37 @@
66
* [Syntax Overview](readme/syntax-overview.md)
77
* [Debugging](auxiliary-guides/debugging.md)
88
* [Useful Resources](introduction/useful-resources.md)
9-
* [Core Concepts](core-concepts/README.md)
10-
* [Indentation and Program Flow](core-concepts/indentation/README.md)
11-
* [Conditionals](core-concepts/indentation/conditionals.md)
12-
* [Loops](core-concepts/indentation/loops.md)
13-
* [Functions](core-concepts/indentation/functions.md)
14-
* [Variables](core-concepts/variables/README.md)
15-
* [Global and Local](core-concepts/variables/global-and-local.md)
16-
* [List Basics](core-concepts/variables/list-basics.md)
17-
* [Options and the Variables Section](core-concepts/variables/options-and-the-variables-section.md)
18-
* [Memory Variables, Metadata, and Alternatives](core-concepts/variables/memory-variables-metadata-and-alternatives.md)
19-
* [Lists](core-concepts/lists/README.md)
20-
* [Filters](core-concepts/lists/filters.md)
21-
* [Index Serialization](core-concepts/lists/indices-and-values.md)
22-
* [Text?](core-concepts/text.md)
23-
* [Custom Commands](core-concepts/commands.md)
24-
* [Vectors](core-concepts/vectors.md)
25-
* [Syntax Types](syntax-types/README.md)
26-
* [Reading Syntax](syntax-types/reading-syntax.md)
27-
* [Events](syntax-types/events.md)
28-
* [Conditions](syntax-types/conditions.md)
29-
* [Effects](syntax-types/effects.md)
30-
* [Literals and Aliases](syntax-types/literals-and-aliases.md)
31-
* [Expressions](syntax-types/expressions.md)
32-
* [Sections](syntax-types/sections.md)
33-
* [Auxiliary Guides](auxiliary-guides/README.md)
34-
* [Using Math](auxiliary-guides/using-math.md)
35-
* [Useful Config Options](auxiliary-guides/useful-config-options.md)
36-
* [Naming Conventions](auxiliary-guides/naming-conventions.md)
37-
* [Writing Good Code](auxiliary-guides/writing-good-code.md)
9+
10+
## Core Concepts
11+
12+
* [Indentation and Program Flow](core-concepts/indentation/README.md)
13+
* [Conditionals](core-concepts/indentation/conditionals.md)
14+
* [Loops](core-concepts/indentation/loops.md)
15+
* [Functions](core-concepts/indentation/functions.md)
16+
* [Variables](core-concepts/variables/README.md)
17+
* [Global and Local](core-concepts/variables/global-and-local.md)
18+
* [List Basics](core-concepts/variables/list-basics.md)
19+
* [Options and the Variables Section](core-concepts/variables/options-and-the-variables-section.md)
20+
* [Memory Variables, Metadata, and Alternatives](core-concepts/variables/memory-variables-metadata-and-alternatives.md)
21+
* [Lists](core-concepts/lists/README.md)
22+
* [Filters](core-concepts/lists/filters.md)
23+
* [Index Serialization](core-concepts/lists/indices-and-values.md)
24+
* [Text?](core-concepts/text.md)
25+
* [Custom Commands](core-concepts/commands.md)
26+
* [Vectors](core-concepts/vectors.md)
27+
28+
## Unfinished
29+
30+
* [Syntax Types](unfinished/syntax-types/README.md)
31+
* [Reading Syntax](unfinished/syntax-types/reading-syntax.md)
32+
* [Events](unfinished/syntax-types/events.md)
33+
* [Conditions](unfinished/syntax-types/conditions.md)
34+
* [Effects](unfinished/syntax-types/effects.md)
35+
* [Literals and Aliases](unfinished/syntax-types/literals-and-aliases.md)
36+
* [Expressions](unfinished/syntax-types/expressions.md)
37+
* [Sections](unfinished/syntax-types/sections.md)
38+
* [Auxiliary Guides](unfinished/auxiliary-guides/README.md)
39+
* [Using Math](unfinished/auxiliary-guides/using-math.md)
40+
* [Useful Config Options](unfinished/auxiliary-guides/useful-config-options.md)
41+
* [Naming Conventions](unfinished/auxiliary-guides/naming-conventions.md)
42+
* [Writing Good Code](unfinished/auxiliary-guides/writing-good-code.md)

core-concepts/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

core-concepts/indentation/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
description: In Progress
3+
---
4+
15
# Indentation and Program Flow
26

37
show examples for commands, for events, ifs, loops, sections

core-concepts/indentation/loops.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
description: In Progress
3+
---
4+
15
# Loops
26

37
## Types of Loops

core-concepts/lists/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
description: In Progress
3+
---
4+
15
# Lists
26

37
Skript has a very powerful variable variant called lists which allow you to store multiple values and access them as a group, loop through them, or just get them by themselves.

core-concepts/lists/filters.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
description: In Progress
3+
---
4+
15
# Filters
26

37
Filter syntax, how to use effectively, why it increases performance over loops
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
description: In Progress
3+
---
4+
15
# Index Serialization
26

37
Talk about the weird ways index serialization works, maybe talk about how to tie two values together with list index (block type/location, etc). eg: why you can't just assume `stone` and `%1 stone%` will be the same index, why locations can't be taken back out of indices, etc

core-concepts/text.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
description: In Progress
3+
---
4+
15
# Text?
26

37
Need to explain formatting, fancy tags, %%

core-concepts/variables/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Variables
22

3-
Variables are a key component in any useful programming language, and Skript is no exception. They allow you to store data, move data around, make code readable, and much more. 
3+
Variables are a key component in any useful programming language, and Skript is no exception. They allow you to store data, move data around, make code readable, and much more.
44

55
At their core, variables are a label for information. If you've taken algebra in math, you probably understand the concept. Instead of using an actual number, you use `x` or `y` as a stand-in for an unknown or changing number. This is the same concept as variables in programming. Variables are representations, or stand-ins, of unknown or changing data.
66

@@ -14,9 +14,9 @@ set {_variable} to 2
1414
set {hey, what's going on} to "not much, what about you?"
1515
```
1616

17-
Variables can have nearly any name you like. They have have spaces, dashes, symbols, whatever. You can put the whole Bee Movie script into a variable name, if you so choose. There are a few special ways to name variables though. 
17+
Variables can have nearly any name you like. They have have spaces, dashes, symbols, whatever. You can put the whole Bee Movie script into a variable name, if you so choose. There are a few special ways to name variables though.
1818

19-
By default, variables are `global`, which means they can be seen and changed by any part of your script. Often we want variables to exist only in a small section of script, which is achieved by `local` variables, with begin with `_`, like `{_variable}`. We'll get further into this difference in the [Global and Local page](global-and-local.md). 
19+
By default, variables are `global`, which means they can be seen and changed by any part of your script. Often we want variables to exist only in a small section of script, which is achieved by `local` variables, with begin with `_`, like `{_variable}`. We'll get further into this difference in the [Global and Local page](global-and-local.md).
2020

2121
### Using Variables
2222

@@ -33,7 +33,7 @@ command /math <number>:
3333
send "%10 * {_x}^2 + 3 * {_x} + 4%"
3434
```
3535

36-
&#x20;That's much easier to read! Plus, it means if we need {\_x} again later in the command, we have it ready to use, without having to retype it. And if we want to change `7` to `6`, we only have to change 1 number instead of 2 or more. Be careful with using too many variables, though. If overused, they can make code more cluttered and messy than necessary:
36+
That's much easier to read! Plus, it means if we need {\_x} again later in the command, we have it ready to use, without having to retype it. And if we want to change `7` to `6`, we only have to change 1 number instead of 2 or more. Be careful with using too many variables, though. If overused, they can make code more cluttered and messy than necessary:
3737

3838
```applescript
3939
# questionable overuse of variables
@@ -46,7 +46,7 @@ command /math <number>:
4646

4747
### Using Variables to Store Data
4848

49-
Global variables in particular are great for storing and transferring data. Here we'll use a very basic `/home` command system to demonstrate.&#x20;
49+
Global variables in particular are great for storing and transferring data. Here we'll use a very basic `/home` command system to demonstrate.
5050

5151
```applescript
5252
command /sethome:
@@ -58,11 +58,11 @@ command /home:
5858
teleport player to {home}
5959
```
6060

61-
Perfect, right? We save the player's location to a variable, and then when they want to go home, we can just use the variable to look up the current location the home is set to.&#x20;
61+
Perfect, right? We save the player's location to a variable, and then when they want to go home, we can just use the variable to look up the current location the home is set to.
6262

6363
Well, this is only partially correct. You see, since global variables are, in fact, global, there's only one of them at any time. So if someone else comes along and does `/sethome`, the `{home}` variable now has their home location, and if you use `/home`, you're getting teleported to their home instead!
6464

65-
To solve this, we need to make the variable unique for each player. The best method to do this is to use the player's uuid as part of the variable name. If you use just `player` or `player's name`, you run the risk of the data no longer being useful when the player changes their name. This is why it's always recommended to use uuids, or enable the config option `use player UUIDs in variable names`, which is explained [here](../../auxiliary-guides/useful-config-options.md).
65+
To solve this, we need to make the variable unique for each player. The best method to do this is to use the player's uuid as part of the variable name. If you use just `player` or `player's name`, you run the risk of the data no longer being useful when the player changes their name. This is why it's always recommended to use uuids, or enable the config option `use player UUIDs in variable names`, which is explained [here](../../unfinished/auxiliary-guides/useful-config-options.md).
6666

6767
```applescript
6868
command /sethome:
@@ -74,7 +74,7 @@ command /home:
7474
teleport player to {home::%player's uuid%}
7575
```
7676

77-
Now each player has a unique home variable that we can get using their uuid. Note the use of `::` in the variable name. This is used to create list variables, which are explained [here](list-basics.md), with a more in- depth explanation [here](../lists/). The main thing to understand is that using `::` means we have much more power over the variable. We can delete all homes at once, we can easily see all the homes that are set, and much more.&#x20;
77+
Now each player has a unique home variable that we can get using their uuid. Note the use of `::` in the variable name. This is used to create list variables, which are explained [here](list-basics.md), with a more in- depth explanation [here](../lists/). The main thing to understand is that using `::` means we have much more power over the variable. We can delete all homes at once, we can easily see all the homes that are set, and much more.
7878

7979
```applescript
8080
# clear all homes
@@ -84,4 +84,4 @@ clear {home::*}
8484
broadcast {home::*}
8585
```
8686

87-
That's all for the basics. The next section, [Global and Local](global-and-local.md), will explain more about the differences between global variables and local ones, when you should use them, and what benefits each has.&#x20;
87+
That's all for the basics. The next section, [Global and Local](global-and-local.md), will explain more about the differences between global variables and local ones, when you should use them, and what benefits each has.

core-concepts/vectors.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
description: In Progress
3+
---
4+
15
# Vectors
26

37
Vectors, components, vector math, rotation, vector offsets, vectors as directions (push)

introduction/the-basics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ We want a code that fills the player's hunger bar, but we don't know what to wri
3939
This may seem annoying, or frivolous, but please actually visit the docs. They're your best tool for finding what you need when you have questions.
4040
{% endhint %}
4141

42-
You should see one result, called Food Level. If you look at the patterns, you can see that `player`, `food`, and `level` all show up in there. It might be a bit hard to read, which is why we have a [syntax reading tutorial](../syntax-types/reading-syntax.md), but it's pretty simple once you know how. For now, we'll just look at the example.
42+
You should see one result, called Food Level. If you look at the patterns, you can see that `player`, `food`, and `level` all show up in there. It might be a bit hard to read, which is why we have a [syntax reading tutorial](../unfinished/syntax-types/reading-syntax.md), but it's pretty simple once you know how. For now, we'll just look at the example.
4343

4444
```applescript
4545
set the player's food level to 10
@@ -202,7 +202,7 @@ set {_tool-text} to "%player's tool%"
202202

203203
### Using Events
204204

205-
We've been using a command all this time, but events are another extremely useful way to trigger code in Skript. Events are things that happen when certain, well, events happen in the game. Say the player jumps. There's an event for that. Say a furnace burns a piece of coal. There's an event for that. Say a sheep regrows its wool. There's an event for that. You can see all the events at [https://docs.skriptlang.org/events.html](https://docs.skriptlang.org/events.html). You can also learn more about them in the[ Events page](../syntax-types/events.md).
205+
We've been using a command all this time, but events are another extremely useful way to trigger code in Skript. Events are things that happen when certain, well, events happen in the game. Say the player jumps. There's an event for that. Say a furnace burns a piece of coal. There's an event for that. Say a sheep regrows its wool. There's an event for that. You can see all the events at [https://docs.skriptlang.org/events.html](https://docs.skriptlang.org/events.html). You can also learn more about them in the[ Events page](../unfinished/syntax-types/events.md).
206206

207207
Events are kind of like commands in that they're never indented. Commands and events always start all the way to the left. Since we've been giving players food, let's use an `on consume` event:
208208

readme/syntax-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ I will warn you, this is a very long page. Feel free to use the right-side bar t
1414

1515
## Crash Course in Reading Syntax
1616

17-
You may have looked at the Skript docs and been very confused on how to turn that long string of words and symbols into actual code. The docs can be a bit daunting if you don't know the rules for how to read them. Here's a little crash course, but if you want more detail, head over to [Reading Syntax](../syntax-types/reading-syntax.md).
17+
You may have looked at the Skript docs and been very confused on how to turn that long string of words and symbols into actual code. The docs can be a bit daunting if you don't know the rules for how to read them. Here's a little crash course, but if you want more detail, head over to [Reading Syntax](../unfinished/syntax-types/reading-syntax.md).
1818

1919
```applescript
2020
(message|send [message[s]]) %objects% [to %players/console%] [from %player%]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)