This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
script_syntax [2020/08/05 21:36] – justin | script_syntax [2021/04/02 19:47] – justin | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- | ---- | ||
- | Bauxite, the scripting language for RPG in a Box, is a simple imperative language designed specifically for the engine. The syntax for Bauxite is useful to know for creating [[quick script|quick scripts]] for tiles and objects in the [[Map Editor]] or for script nodes in the [[Dialogue Editor]]. | + | **Bauxite**, the scripting language for RPG in a Box, is a simple imperative language designed specifically for the engine. The syntax for Bauxite is useful to know for creating [[quick script|quick scripts]] for tiles and objects in the [[Map Editor]] or for script nodes in the [[Dialogue Editor]]. |
=====Statement Syntax===== | =====Statement Syntax===== | ||
- | Statements are the basic building blocks of the scripting language | + | Statements are the basic building blocks of Bauxite |
=====Function Calls===== | =====Function Calls===== | ||
Line 237: | Line 237: | ||
Rotates the player character to be facing in the opposite direction that the goblin is facing. | Rotates the player character to be facing in the opposite direction that the goblin is facing. | ||
+ | ====String/ | ||
+ | There are two functions available for converting between a [[string]] and a [[number]]: **str** and **num**. When a variable or property is known to contain a numeric value and you need to concatenate it with a [[string]], you can convert the [[number]] to a [[string]] using the **str** function. Similarly, if you have a [[string]] and you know it contains a valid numeric value, you can convert it to a [[number]] for use in arithmetic expressions using the **num** function. | ||
+ | |||
+ | **Examples: | ||
+ | <code bauxite> | ||
+ | $next_num += 1; | ||
+ | $new_tile_id = " | ||
+ | </ | ||
~~NOTOC~~ | ~~NOTOC~~ |