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 revisionBoth sides next revision
script_syntax [2020/02/16 21:28] justinscript_syntax [2020/02/17 10:51] justin
Line 120: Line 120:
 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. 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.
 ^Type^Description^Example^ ^Type^Description^Example^
 +|User-Defined|List of custom values declared with the "array" syntax.|array["A", "B", "C"]|
 +|Range|List of integers based on a set of parameters.|range(1, 5)|
 |Entities in a Group|List of all [[entity|entities]] assigned to a map [[groups|group]].|group["slimes"], group["trap_tiles"]| |Entities in a Group|List of all [[entity|entities]] assigned to a map [[groups|group]].|group["slimes"], group["trap_tiles"]|
 |Groups for an Entity|List of all [[groups|group]] to which an [[entity]] belongs.|self.groups, entity["some_id"].groups| |Groups for an Entity|List of all [[groups|group]] to which an [[entity]] belongs.|self.groups, entity["some_id"].groups|
 |Tags for an Entity|List of tags assigned to an [[entity|entity's]] model (see [[Model Properties]]).|player.tags, initiator.tags| |Tags for an Entity|List of tags assigned to an [[entity|entity's]] model (see [[Model Properties]]).|player.tags, initiator.tags|
-|User-Defined|List of custom values declared with the "array" syntax.|array["A", "B", "C"]| 
  
 The values in an array can be iterated through using a "For" loop. You can also check to see if a particular value exists within an array using the "contains" operator in a [[conditional expression]]. See below for some example script usages. The values in an array can be iterated through using a "For" loop. You can also check to see if a particular value exists within an array using the "contains" operator in a [[conditional expression]]. See below for some example script usages.
script_syntax.txt · Last modified: 2023/11/06 14:13 by justin