Difference between revisions of "Conditions and Values"

From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: Line 1:
<strong>Conditions & Values</strong> are a fundamental necessity when it comes to game development, as they are used to control what events have taken place or have yet to take place; from actions, dialog choices, to puzzles & so forth.
 
 
 
<strong>Conditions</strong>: only have two options of a Boolean nature, which are: <span class="green bold">true</span> or <span class="red bold">false</span>. Conditions are the simplest form of determining if an event has passed or has yet to come to pass. Conditions unlike values serve 2 purposes in Visionaire Studio: they can be used in if else queries & they can also be directly linked inside of an objects, dialogs or interface buttons properties tab to determine if the aforementioned object, dialog choice or interface button should be active (shown) or disabled (hidden). If disabled then the any images or animations linked to the object will be hidden & all actions associated with the object will also be unavailable.
 
 
 
You can create 2 types of conditions:<br/>
 
1. Variable: this is a single condition which contains a boolean value of true or false.<br/>
 
2. Combined: this allows you to link 2 single conditions & set "and", "or" query to link to an object.
 
 
 
<gallery widths=70px heights=70px perrow=4>
 
File:cond_000.png
 
File:cond_001.png
 
File:cond_002.png
 
</gallery>
 
 
 
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
 
<span class="bold">Additional Info</span>
 
<div class="mw-collapsible-content">
 
<div>
 
Combined conditions can be useful, but I find Values are a lot more flexible when it comes to multiple conditions needing to met for certain events to be performed. The in editor if query system is not as flexible as writing if queries with Lua mind as there is no method for creating the "and" or "or" operators. Also there is no "elseif" which means that for each <span class="green">if</span> you create that there should also be the same amount of <span class="red">end if</span>.
 
</div>
 
</div></div>
 
 
 
<strong>Values</strong> on the other hand are a lot more flexible than conditions as they support both "string" & integer values as well as randomly generated integer values. Values can also be included inside of displayed text via like so:
 
<strong>Values</strong> on the other hand are a lot more flexible than conditions as they support both "string" & integer values as well as randomly generated integer values. Values can also be included inside of displayed text via like so:
  
Line 47: Line 21:
 
getObject("Values[insert value name here]"):setValue(VValueString, "insert new string text here")
 
getObject("Values[insert value name here]"):setValue(VValueString, "insert new string text here")
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 +
<strong>Conditions & Values</strong> are a fundamental necessity when it comes to game development as they allow you to dictate the <span class="italic bold">events</span> that can take place, have taken place or have yet to take place. They can also be used in <span class="green italic">if else</span> queries to determine if an event, or multiple events should be allowed to happen based on a conditions value or the integer (number) value of a Value.
 +
 +
 +
<strong>Conditions</strong> are boolean based & contain either the value of <span class="green">true</span> or <span class="red">false</span>. Besides the obvious use of them in an <span class="green italic">if else</span> query, they can also be linked directly to objects, dialogs & interface buttons via the properties tab for the aforementioned objects, to quickly determine if the object is active (shown) or disabled (hidden); if disabled then all images & animations for the object will be hidden & all actions associated with the object will also be disabled - this is very useful for quickly changing the environment of the scene or any other scenes for that matter, regardless of whether they are a playable scene, cut-scene or a menu.
 +
 +
 +
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
 +
<span class="bold">Additional Info</span>
 +
<div class="mw-collapsible-content">
 +
<div>
 +
You can create 2 types of conditions:<br/>
 +
1. Variable: this is a single condition which contains a boolean value of true or false.<br/>
 +
2. Combined: this allows you to link 2 single conditions & set "and", "or" query to link to an object.
 +
 +
Combined conditions can be useful, but I find Values are a lot more flexible when it comes to multiple conditions needing to met for certain events to be performed. The in editor if query system is not as flexible as writing if queries with Lua mind as there is no method for creating the "and" or "or" operators. Also there is no "elseif" which means that for each <span class="green">if</span> you create that there should also be the same amount of <span class="red">end if</span>.
 +
</div>
 +
</div></div>
 +
 +
 +
<gallery widths=70px heights=70px perrow=4>
 +
File:cond_000.png
 +
File:cond_001.png
 +
File:cond_002.png
 +
</gallery>

Revision as of 19:16, 26 August 2013

Values on the other hand are a lot more flexible than conditions as they support both "string" & integer values as well as randomly generated integer values. Values can also be included inside of displayed text via like so:

Example 1: including an integer value into a displayed text; value name: money_total

I currently have $<v=money_total>.

Example 2: including a string value into a displayed text; value name: player_name

You have decided to call your protagonist <vs=player_name>.


Value strings are probably not really much use at the current time due to Visionaire Studio currently lacking true key input methods for text based input & text based puzzles.


Although you can set an initial string value for values you can not edit them via the "set value" action part (I'm not sure why) instead you will need to edit them via a simple bit of Lua scripting inside of an "execute a script" action part.


getObject("Values[insert value name here]"):setValue(VValueString, "insert new string text here")


Conditions & Values are a fundamental necessity when it comes to game development as they allow you to dictate the events that can take place, have taken place or have yet to take place. They can also be used in if else queries to determine if an event, or multiple events should be allowed to happen based on a conditions value or the integer (number) value of a Value.


Conditions are boolean based & contain either the value of true or false. Besides the obvious use of them in an if else query, they can also be linked directly to objects, dialogs & interface buttons via the properties tab for the aforementioned objects, to quickly determine if the object is active (shown) or disabled (hidden); if disabled then all images & animations for the object will be hidden & all actions associated with the object will also be disabled - this is very useful for quickly changing the environment of the scene or any other scenes for that matter, regardless of whether they are a playable scene, cut-scene or a menu.


Additional Info

You can create 2 types of conditions:
1. Variable: this is a single condition which contains a boolean value of true or false.
2. Combined: this allows you to link 2 single conditions & set "and", "or" query to link to an object.

Combined conditions can be useful, but I find Values are a lot more flexible when it comes to multiple conditions needing to met for certain events to be performed. The in editor if query system is not as flexible as writing if queries with Lua mind as there is no method for creating the "and" or "or" operators. Also there is no "elseif" which means that for each if you create that there should also be the same amount of end if.