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 [2017/10/16 07:19] – justin | script_syntax [2020/01/19 18:30] – justin | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- | ---- | ||
- | The scripting language in RPG in a Box is a simple imperative language designed specifically for the engine. It is based on the language described [[http:// | + | The scripting language in RPG in a Box is a simple imperative language designed specifically for the engine. It is loosely |
- | =====Statements====== | + | =====Statement Syntax===== |
- | Statements are the basic building blocks of the scripting language and represent a particular action to be taken. | + | Statements are the basic building blocks of the scripting language and represent a particular action to be taken. |
- | ====Function Calls==== | + | =====Function Calls===== |
Calling a function instructs the game to execute some piece of logic, for example to display a message to the player or to move the camera to a specific location. See [[Scripting Reference]] for a comprehensive list of built-in functions that can be called. | Calling a function instructs the game to execute some piece of logic, for example to display a message to the player or to move the camera to a specific location. See [[Scripting Reference]] for a comprehensive list of built-in functions that can be called. | ||
Line 20: | Line 20: | ||
</ | </ | ||
- | ====If/ | + | =====Control Statements===== |
- | The "if/ | + | Control statements affect the flow of your script, either by branching or looping through a set of statements multiple times. These include |
+ | |||
+ | ====If Statement==== | ||
+ | **If statements** | ||
**Examples: | **Examples: | ||
Line 30: | Line 33: | ||
</ | </ | ||
<code lua> | <code lua> | ||
- | if player.inventory contains "Gold Key" then | + | if player.inventory contains "ITEM_0001" then |
| | ||
| | ||
Line 38: | Line 41: | ||
end | end | ||
</ | </ | ||
+ | |||
+ | ====While Loop==== | ||
+ | **While loops** | ||
+ | |||
+ | ====For Loop==== | ||
+ | **For loops** | ||
=====Literals===== | =====Literals===== |