Function; Objective_Addw
Novaras edited this page Feb 15, 2024
·
3 revisions
Objective_Add(<objective_name>, <objective_type>)
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
.
-- `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);
Param | Type | Description |
---|---|---|
objective_name |
userdata |
A userdata value containing a wide-char string. |
objective_type |
ObjectiveType (number ) |
The type of the objective. |
| Home | Search | Recent Changes | Revision History | About | User Help | Contributor Help | Discussion |