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 [2020/08/05 21:36] justinscript_syntax [2021/04/02 19:44] justin
Line 5: Line 5:
  
 =====Statement Syntax===== =====Statement Syntax=====
-Statements are the basic building blocks of the scripting language and represent a particular action to be taken. A statement can be either a function call, assignment of a value to a variable/property, or control statement (i.e. "If" statement, "While" loop, or "For" loop). Multiple statements must be separated from each other using semicolons (;). Whitespace between statements is ignored, although newlines and indentation are recommended for ease of reading.+Statements are the basic building blocks of Bauxite and represent a particular action to be taken. A statement can be either a function call, assignment of a value to a variable/property, or control statement (i.e. "If" statement, "While" loop, or "For" loop). Multiple statements must be separated from each other using semicolons (;). Whitespace between statements is ignored, although newlines and indentation are recommended for ease of reading.
  
 =====Function Calls===== =====Function Calls=====
Line 236: Line 236:
 </code> </code>
 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/Number Conversion====
 +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 an arithmetic expression using the **num** function.
  
 ~~NOTOC~~ ~~NOTOC~~
script_syntax.txt · Last modified: 2023/11/06 14:13 by justin