Function; Objective_Add - HWRM/KarosGraveyard GitHub Wiki
<objective_type>)
Objective_Add(<objective_name>,Description
Adds a new objective. Returns the ID of the newly created objective.
- To create an object with a predefined ID, use
Objective_AddPresetID
. - There is an associated
Objective_Addw
for naming an objective with a 'wide string'.
💡 Objectives begin in the OS_Incomplete
ObjectiveState
, which displays them immediately in the 'OBJECTIVES' pane. To hide an objective, set its state to OS_Off
using Objective_SetState
.
Example
local kill_cruiser_objective = Objective_Add("kill-battlecruiser", OT_Primary); -- `kill_cruiser_objective` will be an integer (the objective's ID)
-- later, after the player blows up that battlecruiser:
Objective_SetState(kill_cruiser_objective, OS_Complete);
Arguments
Param | Type | Description |
---|---|---|
objective_name |
string |
The name of the new objective. |
objective_type |
ObjectiveType (number ) |
The type of the objective. |