docs fixes
This commit is contained in:
1 parent
3f9556f9aa
commit
78ee80248b
2 files changed
+13
-9
No files matched your search
@@ -112,16 +112,17 @@ Or rather:
|
||||
|
||||
<pre>
|
||||
if
|
||||
(
|
||||
x<y+6,
|
||||
( x<y+6,
|
||||
(
|
||||
set(x,8+y,z,'air');
|
||||
plop(x,top('surface',x,z),z,'birch')
|
||||
),
|
||||
// else if
|
||||
sin(query(player(),'yaw'))>0.5,
|
||||
(
|
||||
plop(0,0,0,'boulder')
|
||||
),
|
||||
// else
|
||||
particle('fire',x,y,z)
|
||||
)
|
||||
</pre>
|
||||
@@ -134,8 +135,10 @@ have problems with them
|
||||
## Functions and scoping
|
||||
|
||||
Users can define functions in the form `fun(args....) -> expression` and they are compiled and saved for further
|
||||
execution in this but also subsequent calls of /script command. Functions can also be assigned to variables,
|
||||
passed as arguments, called with `call` function, but in most cases you would want to call them directly by
|
||||
execution in this, but also subsequent calls of /script command, added to events, etc. Functions can also be
|
||||
assigned to variables,
|
||||
passed as arguments, called with `call('fun', args...)` function, but in most cases you would want to
|
||||
call them directly by
|
||||
name, in the form of `fun(args...)`. This means that once defined functions are saved with the world for
|
||||
further use. For variables, there are two types of them, global - which are shared anywhere in the code,
|
||||
and those are all which name starts with 'global_', and local variables which is everything else and those
|
||||
|
||||
@@ -51,10 +51,10 @@ number('2')+number('2') => 4
|
||||
Returns a formatted string representing expression. Accepts formatting style accepted by `String.format`.
|
||||
Supported types (with `"%?"` syntax):
|
||||
|
||||
* d, o, x: integers
|
||||
* a, e, f, g: floats
|
||||
* b: booleans
|
||||
* s: strings
|
||||
* `d`, `o`, `x`: integers, octal, hex
|
||||
* `a`, `e`, `f`, `g`: floats
|
||||
* `b`: booleans
|
||||
* `s`: strings
|
||||
|
||||
<pre>
|
||||
str(null) => null
|
||||
@@ -81,7 +81,8 @@ the off-tick time in between ticks that didn't take 50ms. There are however bene
|
||||
like fine time control not relying on the tick clock, or running things independent on each other. You can still run
|
||||
your actions on tick-by-tick basis, either taking control of the execution using `game_tick()` API function
|
||||
(nasty solution), or scheduling tick using `schedule()` function (much nicer solution), but threading often gives
|
||||
the neatest solution to solve problems in parallel (see scarpet camera).
|
||||
the neatest solution to solve problems in parallel
|
||||
(see [scarpet camera](/src/main/resources/assets/carpet/scripts/camera.sc)).
|
||||
|
||||
Due to limitations with the game, there are some limits to the threading as well. You cannot for
|
||||
instance `join_task()` at all from the main script and server thread, because any use of Minecraft specific
|
||||
|
||||
Reference in new issue
Block a user