User Tools

Site Tools


script_syntax

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
script_syntax [2021/11/04 19:33] justinscript_syntax [2022/01/08 11:51] justin
Line 125: Line 125:
 |Null|null| |Null|null|
  
-====Arrays====+====Array====
 An [[array]] is simply a list of values, such as the [[entity|entities]] belonging to a [[groups|group]], the tags assigned to a model, or even a custom set of values defined directly within a [[script]]. Refer to the [[Array]] documentation for more examples, as well as information about the available functions that can be used to manipulate an [[array|array's]] values. An [[array]] is simply a list of values, such as the [[entity|entities]] belonging to a [[groups|group]], the tags assigned to a model, or even a custom set of values defined directly within a [[script]]. Refer to the [[Array]] documentation for more examples, as well as information about the available functions that can be used to manipulate an [[array|array's]] values.
 ^Type^Description^Example^ ^Type^Description^Example^
Line 156: Line 156:
 </code> </code>
 Loads a random map from the "dungeon_map_list" array variable ("room1" through "room4"), then gives the player 5 of a random item from the "item_list" array variable. Loads a random map from the "dungeon_map_list" array variable ("room1" through "room4"), then gives the player 5 of a random item from the "item_list" array variable.
 +
 +====Codex====
 +(Coming soon)
  
 ====Null==== ====Null====
Line 258: Line 261:
 </code> </code>
  
 +====Math Functions====
 +^Name^^Description^Example^
 +|round|Rounds to the nearest whole integer.|round(16.8) will return 17|
 +|mod|Gives the remainder of a division.|mod(8, 3) will return 2|
 +|pow|Gives the result of one number raised to the power of another.|pow(2, 5) will return 32|
 +|sqrt|Gives the square root of a number.|sqrt(16) will return 4|
 ~~NOTOC~~ ~~NOTOC~~
script_syntax.txt · Last modified: 2023/11/06 14:13 by justin