Difference between revisions of "Expression"

From Castle Wiki
(Add list of expression types)
(Add links to all expression pages)
Line 6: Line 6:
=== Values ===
=== Values ===


* The value of a counter
* [[The value of a variable expression|The value of a variable]]
* The value of a behavior property
*[[A constant number expression|A constant number]]
* The value of a variable
* A constant number


=== Choices ===
=== Choices===


* Weighted choose
* [[Weighted choose expression|Weighted choose]]
* Choose
*[[Choose expression|Choose]]
* Maximum
*[[Maximum expression|Maximum]]
* Minimum
*[[Minimum expression|Minimum]]


=== Randomness ===
===Randomness===


* A random number with a Gaussian distribution
*[[A random number with a Gaussian distribution expression|A random number with a Gaussian distribution]]
* Perlin noise in 2 dimensions
*[[Perlin noise in 2 dimensions expression|Perlin noise in 2 dimensions]]
* A random number in a range
*[[A random number in a range expression|A random number in a range]]


=== Spacial relationships ===
===Spacial relationships===  


* The speed of an actor
*[[The speed of an actor expression|The speed of an actor]]
* The angle of motion of an actor
*[[The angle of motion of an actor expression|The angle of motion of an actor]]
* The angle from one actor to another (degrees)
*
* The distance between two actors
[[The angle from one actor to another (degrees) expression|The angle from one actor to another (degrees)]]
*[[The distance between two actors expression|The distance between two actors]]


=== Arithmetic ===
=== Arithmetic ===


* The number of repeats finished
*[[The number of repeats finished expression|The number of repeats finished]]
* Logarithm
*[[Logarithm expression|Logarithm]]
* Power
*[[Power expression|Power]]
* Modulo
* [[Modulo expression|Modulo]]
* Divide
*[[Divide expression|Divide]]
* Multiply
* [[Multiply expression|Multiply]]
* Subtract
* [[Subtract expression|Subtract]]
* Add
* [[Add expression|Add]]


=== Clock ===
===Clock===


* Time elapsed since the card started
*[[Time elapsed since the card started expression|Time elapsed since the card started]]
* The clock tempo
* [[The clock tempo expression|The clock tempo]]
* Time since the last beat
*[[Time since the last beat expression|Time since the last beat]]
* The current bar
* [[The current bar expression|The current bar]]
* The current beat in the current bar
*[[The current beat in the current bar expression|The current beat in the current bar]]
* Beats elapsed since the card started
*[[Beats elapsed since the card started expression|Beats elapsed since the card started]]


=== Functions ===
=== Functions===


* The number of actors with a tag
*[[The number of actors with a tag expression|The number of actors with a tag]]
* Degrees to radians
*[[Degrees to radians expression|Degrees to radians]]
* Sine
*[[Sine expression|Sine]]
* Clamp a value between two bounds
*[[Clamp a value between two bounds expression|Clamp a value between two bounds]]
* Mix two values
*[[Mix two values expression|Mix two values]]
* Round
*[[Round expression|Round]]
* Round down
* [[Round down expression|Round down]]
* Absolute value
*[[Absolute value expression|Absolute value]]

Revision as of 07:40, 10 May 2022

Expressions in Castle are used for many things, including calculating health for characters, crafting procedural games and animations, and even making generative artwork. Expressions sometimes take in some values as arguments and always return a result value.

List of Expression Types

The following is a list of expression types in the order that they are listed when viewed in the Castle "Choose expression type" sheet

Values

Choices

Randomness

Spacial relationships

The angle from one actor to another (degrees)

Arithmetic

Clock

Functions