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")
 
(One intermediate revision by the same user 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 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 19: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!"