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
Save Kelgo
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");