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

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<div id="top"</div> 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 wi...")
 
Line 1: Line 1:
<div id="top"</div>
+
<div id="top"></div>
 
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!
 
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 ([[#top|<b>▲</b>]]) ==
 
== Basic Syntax ([[#top|<b>▲</b>]]) ==
  
{| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"
+
{| class="wikitable" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"
 
|-
 
|-
! <b>Syntax</b> !! <b>Description</b>
+
| <span style="color:#cdad00"><b>if</b></span> || <b>allows us to query if something: equals, does not equal, is less/more than x value etc ...</b>
 
|-
 
|-
| <span style="color:blue">if</span> || allows us to query if something: equals, does not equal, is less/more than x value etc ...
+
| colspan="2"|
 +
<syntaxhighlight>
 +
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!
 +
</syntaxhighlight>
 
|-
 
|-
 
| Example || Example
 
| Example || Example
Line 28: Line 34:
 
| Example || Example
 
| Example || Example
 
|}
 
|}
 +
 +
<syntaxhighlight>
 +
if
 +
else
 +
end
 +
</syntaxhighlight>
  
 
{{i18n|Manual}}
 
{{i18n|Manual}}

Revision as of 19:32, 23 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 ()

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
Example Example
Example Example
Example Example
Example Example
Example Example
Example Example
if
else
end