Function; Objective_AddPresetID - HWRM/KarosGraveyard GitHub Wiki

Objective_AddPresetID(<objective_ID>, <objective_name>, <objective_type>)

Description

Adds a new objective. Returns the ID of the newly created objective, which will just be the supplied ID.

  • For creating an objective without needing a predetermined ID, use Objective_Add.

💡 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 id = 123; -- must be an int or a string which can be interpolated into one, i.e "123"
local kill_cruiser_objective = Objective_AddPresetID(id, "kill-battlecruiser", OT_Primary); -- `my_objective` will be the int 123, its ID

-- later, after the player blows up that battlecruiser:
Objective_SetState(kill_cruiser_objective, OS_Complete);

Arguments

Param Type Description
objective_ID number|string* An integer which will be the new objective's ID. *This may be a string, but only if its convertable directly into an int, i.e "123" will work but "one_two_three" will not.
objective_name string The name of the new objective.
objective_type ObjectiveType(number) The type of the objective.

Related Pages