Function; Objective_Addw - HWRM/KarosGraveyard GitHub Wiki

Objective_Add(<objective_name>, <objective_type>)

Description

Adds a new objective. Returns the ID of the newly created objective.

There is an associated Objective_Add for naming an objective with a normal Lua 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

-- `kill_bc_wstr` is some wide-char string from an API call
local kill_cruiser_objective = Objective_Addw(kill_bc_wstr, 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 userdata A userdata value containing a wide-char string.
objective_type ObjectiveType(number) The type of the objective.

Related Pages