The Dwarves of Glistenveld Wiki
No edit summary
Tags: Visual edit apiedit
Tags: Visual edit apiedit
Line 9: Line 9:
   
 
== Parameters: ==
 
== Parameters: ==
  +
setObjective(id, shorttext, longtext);
+
==== setObjective(id, shorttext, longtext); ====
 
{| class="article-table"
 
{| class="article-table"
 
!Param
 
!Param
Line 27: Line 28:
 
|The text in the textbox when the objective is clicked, to give a more detailed explanation of what to do.
 
|The text in the textbox when the objective is clicked, to give a more detailed explanation of what to do.
 
|}
 
|}
  +
completeObjective(id, ticked, alert);
+
==== completeObjective(id, ticked, alert); ====
 
{| class="article-table"
 
{| class="article-table"
 
!Param
 
!Param
Line 45: Line 47:
 
|(requires something for this, but need further discussion as to what)
 
|(requires something for this, but need further discussion as to what)
 
|}
 
|}
  +
failObjective(id, crossed, alert);
+
==== failObjective(id, crossed, alert); ====
 
{| class="article-table"
 
{| class="article-table"
 
!Param
 
!Param

Revision as of 20:43, 13 June 2017

Objectives are relatively simple to create and maintain from within Map Events scripts or GameScripts.

Commands you need to know are:

setObjective(id, shorttext, longtext);

completeObjective(id, ticked, alert);

failObjective(id, crossed, alert);

Parameters:

setObjective(id, shorttext, longtext);

Param Required Description
id Yes Not visible to the player. Must be unique for each objective in the map. You can overwrite an objective by calling setObjective with the same id.
shorttext Yes The text displayed on-screen at all times, next to the checkbox.
longtext No The text in the textbox when the objective is clicked, to give a more detailed explanation of what to do.

completeObjective(id, ticked, alert);

Param Required Description
id Yes Not visible to the player. Must be unique for each objective in the map. You can overwrite an objective by calling setObjective with the same id.
ticked No Whether or not the objective should be ticked or unticked. If omitted, will tick the objective.
alert No (requires something for this, but need further discussion as to what)

failObjective(id, crossed, alert);

Param Required Description
id Yes Not visible to the player. Must be unique for each objective in the map. You can overwrite an objective by calling setObjective with the same id.
crossed No Whether or not the objective is crossed out or not. If omitted, will cross out the objective.
alert No (requires something for this, but need further discussion as to what)

Examples

In the below example, an objective is added that is un-clickable, since it has no longtext assigned to it.

setObjective("saveKelgo", "Save Kelgo from the Goblins!");

In the event of Kelgo being saved, the following code should be called:

completeObjective("saveKelgo");

In the event of Kelgo dying, the following code should be called:

failObjective("saveKelgo");