Well I figure I should show the documentation for the objectives plugin here. Spoiler'd for your convenience. Also basic screenshot of what is going on (keep in mind, I have no predefined graphics for this, so I just use in-game resources).
EDIT: Also please understand that because of the nature of Doom's renderer, the objective will never be 100% precise as to the location on the X OR Y axis. It'll be close enough at certain angles where it wont matter though.
http://imgur.com/a/gWkEP#0the objective system
Description:
The Objective system is a plugin that is meant to manage objectives and display them accordingly on a per player basis. You can have up to a maximum of 255 objectives per map. There are a number of predefined objectives that can be used, or you can define your own and have a specific script be called with special arguments to create your own objectives.
Usage:
Objectives are loaded on a per-map basis.
Objectives do not carry from map to map and must be defined explicitly for each map.
Objectives are defined initially in an OPEN script and therefore are loaded at map load.
Commands:
Code:
function int DefineObjective(int objid, str title, str description, int targetid, int objectivetype, int flags,int scriptid,int marker, int argument)
Defines objectives in the database. Returns the index of the objective definition.
- ObjID - Objective ID number. Similar to TID's except for objectives. This is the number that is used to reference objectives with other functions and commands. If two objectives use the same ID, the last one defined is the one that is saved.
- Title - Primary information to be displayed about the specified objective.
- Description - Secondary description of the objective (in case any extra information is needed to be shown).
- targetid - line id/TID of the objective. (If the type of objective is set to TIMER, then this parameter is the total time until failure in seconds. Decimals are rounded down.
- Type - type of objective.
- flags - Default flags. Used to set a default status of the objective (IE default to success until conditions cause it to fail)
- scriptid - script to be activated upon completion or failure. success has the first parameter passed as 1 failure as 0.
- Marker - TID to link the hud marker on the screen. You can use any actor you want, but if you dont want the player to be able to pick up the marker, it's best to set it as a map spot.
- Argument - Extra information to be used when using objective types.
This command is used to define objectives in the database. Once the objectives are defined, they are passed to the management loops and displayed accordingly. See the usage section for types and examples on how to use each type of objective.
This following segment is a list of commands dealing with setting the status of objectives. Since these all use basically the same parameters, I'll explain them first and then list the commands below.
- ObjectiveID - the index of the objective in question. You should already have this value stored in an integer variable before using any of these commands.
- Playernumber() - See Playernumber() in the Zdoom wiki
- All - Specifies that the changes are to be given to ALL the players.
Code:
Obj_CheckIfActive(int objectiveID,int playernumber, int all)
Returns if the selected objective is active or not and on which player. 0 is activator. Returns 1 if the specified objective is set Active; Otherwise returns 0.
Code:
OBJ_SetFailed(int ObjectiveID, int playernumber, int all)
Sets the status of an objective to fail. 0 for activator, -1 for all. Returns 1 if the specified objective is set correctly; Otherwise returns 0.
Code:
Obj_SetCleared(int ObjectiveID, int playernumber, int all)
Sets the status of an objective to cleared. 0 for activator, -1 for all. Returns 1 if the specified objective is set correctly; Otherwise returns 0.
Code:
Obj_ToggleActive(int ObjectiveID, int playernumber, int all)
Activates/Deactivates an objective. This basically is the control on if an objective is active. Active means that it can receive state changes (such as being set to failed or cleared) on players. When an objective is set to active the default state and properties of the objective are copied over to all currently connected players. If a player joins in the middle of the progress of an objective, the status of all currently active objectives is set to that player. Returns 1 if the specified objective is set correctly; Otherwise returns 0.
Code:
Obj_ShowMarker(int ObjectiveID, int playernumber, int all)
Displays a marker on the hud for the specified player that displays in the direction of the specified objective. Returns 1 if the specified objective is set correctly; Otherwise returns 0.
Code:
function int Obj_SetCompleted(int OID, int pnum, int all)
Sets the objective to FINISHED. This only applies if the flag ONLYENDONFINISH is set to the objective. Flags the objective to terminate.