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

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Basic Syntax (▲))
m (Text replacement - "wikitable" to "ts")
 
(2 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
== Basic Syntax ([[#top|<b>▲</b>]]) ==
 
== Basic Syntax ([[#top|<b>▲</b>]]) ==
  
{| class="wikitable mw-collapsible" style="background: #f0f0f0" width="100%"
+
{| class="ts mw-collapsible" style="background: #f0f0f0" width="100%"
 
|-
 
|-
 
! colspan="2" | <b>Types</b>
 
! colspan="2" | <b>Types</b>
Line 12: Line 12:
 
| <b>boolean</b> || a boolean 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 text message <span style="color:#FF8C69">"wrapped in quotation marks"</span> or <span style="color:#FF8C69">'apostrophes'</span>
 
|-
 
|-
 
| Example || Example
 
| Example || Example
Line 19: Line 19:
 
|}
 
|}
  
{| class="wikitable mw-collapsible" style="background: #f0f0f0" width="100%"
+
{| class="ts mw-collapsible" style="background: #f0f0f0" width="100%"
 
|-
 
|-
 
! colspan="2" | <b>Operators</b>
 
! colspan="2" | <b>Operators</b>
Line 48: Line 48:
 
string "hello!"
 
string "hello!"
 
</syntaxhighlight>
 
</syntaxhighlight>
 
 
{{i18n|Manual}}
 

Latest revision as of 18:35, 19 August 2014

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!"