Difference between revisions of "An Introduction to Scripting with LUA"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Basic Syntax (▲))
Line 8: Line 8:
 
! colspan="2" | <b>Types</b>
 
! colspan="2" | <b>Types</b>
 
|-
 
|-
| <b>integer</b></ || an integer is a <span style="color:#CD8C95">number</span> value
+
| <b>integer</b> || an integer is a <span style="color:#CD8C95">number</span> value
 
|-
 
|-
| <b>boolean</b> || a <span style="color:#cdad00">boolean</span> is a value which equals <span style="color:#cdad00">true</span> or <span style="color:#cdad00">false</span>
+
| <b>boolean</b> || a boolean is a value which equals <span style="color:#cdad00">true</span> or <span style="color:#cdad00">false</span>
 
|-
 
|-
 
| <span style="color:blue"><b>string</b></span> || a <span style="color:blue">string</span> is a <span style="color:#FF8C69">"text message wrapped in quotation marks"</span> or <span style="color:#FF8C69">'apostrophes'</span>
 
| <span style="color:blue"><b>string</b></span> || a <span style="color:blue">string</span> is a <span style="color:#FF8C69">"text message wrapped in quotation marks"</span> or <span style="color:#FF8C69">'apostrophes'</span>

Revision as of 01:58, 24 February 2013

I have decided to write an introduction into the basics of LUA Script; so that you can get a better understanding of how it works & how you can apply it within the Visionaire Studio™ editor, to further enhance your games!

Basic Syntax ()

Types
integer an integer is a number value
boolean a boolean is a value which equals true or false
string a string is a "text message wrapped in quotation marks" or 'apostrophes'
Example Example
Example Example
Operators
if allows us to query if something: equals, does not equal, is less/more than x value etc ...
if condition then -- this queries if (boolean) condition equals true then do some action!
if condition == true then -- this is also a valid way for seeing if a (boolean) condition equals true!
if not condition then -- this checks if (boolean) condition equals false!
if condition == false then -- this is also valid for checking if a (boolean) condition equals false!
Example Example
Example Example
Example Example
bool
boolean
true
false
integer 1, 2
string "hello!"