⌂Starsiege: Tribes Community Archive

ObjectiveTrak v3.3

by Crunchy
⤓ Download · 63.1 KB
27th June 2000 As used by Objective HUD. This is a tool for scripters, Objective HUD is an example of its use. There is an alternative interface for ObjectiveTrak: VéKTöRHud. ObjectiveTrak isn't limited to HUDs, there could be many uses for it, check it out. Requirements Presto Pack v0.93 or later Writer's Support Pack v4.0.4 BETA or later Supports Poker's BWAdmin mod Description Scripting tool that tracks the status of the objectives in missions. The script can track objectives in any of the missions, either base or custom including CTF, C&H, D&D, F&R, Balanced, Open Call and Multiple Team. Take a look at the new events and functions ObjectiveTrak defines listed below. For an example of the use of the script check out my Objective HUD. The script has the ability to learn about objectives from the messages sent to the client you see in the chat box. The script also loads information about missions from the files created using ObjectiveExtract.exe. There is no other way to find out about the objectives from a script, rather than 20 scripts all having to do this hard work ObjectiveTrak does it all for you. The current implemetation assigns each objective an unique ID. The ID is an interger which is in the range from zero to one less than the number of objectives (see ObjectiveTrak_notes.txt). The script patches TeamTrak to bring it up to date. It lets TeamTrak know about the team names as soon as you are connected. Flag tracking has been extended to work with multiple teams. The interface for TeamTrak has not been changed in any way. The zip file has everything you need for ObjectiveTrak. ObjectiveTrak.cs has all the documentation you need to use it in your own scripts. Read the Readme_ObjectiveTrak.txt for installation instructions. Read the ObjectiveTrak_notes.txt for notes on how to use the ObjectiveTrak in your own scripts. Changes in v3.3 Autoloading volume. Uses Writers support pack. Updated the TAC mission info files for TAC v1.3. Changes in v3.2.1 Fixed problem with F&R timer going negative. Thanks (RSV)MassMedia for spotting it. Changes in v3.2 Gets the winning score from BWAdmin mod v4.2 properly. Parses server message to get the start value of the F&R flag timer. Fixed double CTF flag return problem, the flag status is only changed once now. Added new functions: Objective::GetFlagName() Objective::GetFlagID() Objective::GetTeamNameAbbreviated() Objective::GetFandRTimer() Objective::GetLocationX() Objective::GetLocationY() Changes in v3.1 Complete Team Aerial Combat score support. Changes in v3.0 Files are stored in Tribes\base\missions. No files are saved to the config dir now! Supports the latest BW Admin mod. If you join a server running the latest BW Admin mod the script will know the scores and the exact status of all the objectives on any mission! Woohoo :). ObjectiveExtract.exe, which can extract mission info from any mission files the user has. The guts have been rewritten to be lean and mean. It is more efficient and should be easier to find any potential bugs. Multiple team support, up to 8 teams if you wanted! Patches TeamTrak to support multiple team missions and updates TeamTrak to know the team names as soon as you join the server or an admin changes the name. Uses mission type to cut down on message parsing. Works out what type of mission a balanced or open call mission is from the objective list. Extended status and type functions: Objective::GetStatusExt() and Objective::GetTypeExt(). Moved the docs to ObjectiveTrak_notes.txt, also updated the docs. New functions (see ObjectiveTrak_notes.txt): Objective::GetMissionType() Objective::IsBWAdmin() Objective::IsMatchStarted() Objective::GetTeamNum() Objective::GetStatusExt() Objective::GetTypeExt() Objective::GetTypeNum() Objective::ConvertType() Removed key binding. Changes in v2.0 beta 7: Moved eventObjectiveLoaded so that scripts can avoid having to use eventObjectiveMadeNeutral as well. These events were very close together and so could cause problems. Changes in v2.0 beta 6: Added support for scores in the mission info files. Added score code to Objective::Set() and the plugins. Added support functions: Objective::GetTeamScore() Objective::GetScore() Objective::GetDeltaScore() Objective::GetTime() Objective::GetTimeScore() Objective::GetWinScore() Changed F&R tracking to work with Tribes v1.6's new 180sec timelimit for conveying a flag. Objective::InsertTeamName() returns the team name (if known) instead of "Enemy ..." when observing. Changes in v2.0 beta 5: Client message parser didn't check to see if the message was from the server. D'oh :) Changes in v2.0 beta 4: Added new events: eventObjectiveTaken eventObjectiveLost eventObjectiveFlagTaken eventObjectiveFlagDropped eventObjectiveFlagReturned eventObjectiveFlagCaptured eventObjectiveFlagHolds CTF flags support! Added support function Objective::InsertTeamSymbol(). Support function Objective::GetId() optimised. Now executes in constant rather than linear time. Flag (F&R and CTF) carry state was being stored fixed, now changes correctly if you change teams. Changes in v2.0 beta 3: Fixed another CTF / F&R flag clash. Fixed bug where abbreviated names for new objectives weren't being stripped. Moved abbreviations to the MissionInfo Pack. Changes in v2.0 beta 2: Added support function Objective::GetNameAbbreviated(%id). Abbreviations are stored in a table for efficiency. Had to add toggle key to distinguish between CTF and F&R flags, $ServerMissionType isn't always set. Changes in v2.0 beta: Compelete rewrite. Generalised the script so that it could track any objective. Beta version released to get bug reports as testing is difficult. Used the logic and messages from scripts.vol to derive the messages and parsing functions. Changes in v1.0.1: Fixed bug where Objective::GetNameStripped(%id) would return a null value if there was no "the" at the start of the name (don't rename variables ;). What happend to v1.0? I first wrote the script to track C&H mission objectives but Presto pointed out it could be generalised to track any objective. Thanks for the idea Presto :) http://www.planettribes.com/crunchy/scripts/ObjectiveTrak.shtml
Filename
ObjectiveTrak_v3.3.zip
Size
63.1 KB (listed 63.1KB)
Type
ZIP
Version
3.3
Developer
Crunchy
Date
2000-06-27 (newest file inside)
theexiled upload
Jan 14, 2009 - 19:45
Format
Zip archive data, at least v2.0 to extract, compression method=deflate
Readme — Readme_ObjectiveTrak.txt (from the archive itself)
ObjectiveTrak v3.3
==================
27th June 2000

Written by |HH|Crunchy (Jonathan Slark)
Web page: http://www.planetstarsiege.com/crunchy/
Email: [email redacted]

*** Requires the Presto Pack v0.93 or later ***  http://www.planetstarsiege.com/presto/
*** Requires Writer's Support Pack v4.0.4 BETA or later *** http://www.planetstarsiege.com/lorne/
*** Supports Poker's BWAdmin mod ***  http:www.pokerspockets.freeserve.co.uk/


Removing the MissionInfo pack
-----------------------------

The MissionInfo pack is no more, it is being replaced by ObjectiveExtract.exe.

Remove the folder Tribes\config\missions.  If you do not do this ObjectiveTrak will
not work!

Also remove any mission info files in your Tribes\config directory, from now on
files are only saved to the Tribes\base\missions directory so this will not happen
again.  Mission info files are called <mission name>.cs.  eg: Broadside.cs, Anthill.cs
etc.


Removing previous versions of ObjectiveTrak
-------------------------------------------

Remove the following files:
config\Crunchy\Events.cs
config\Crunchy\ObjectiveTrak.cs


Installation
------------

1. Unzip the files into the Tribes\config\ dir.

2. Move ObjectiveExtract.exe to your Tribes\base\missions dir.

2. [Optional] Run ObjectiveExtract.exe by double clicking it.  It builds the mission info files
   the script uses.  Note you could skip this step but the HUD will have to learn about
   the objectives as it goes along.

3. [Optional] Unzip the TAC.zip to the Tribes\ directory.  It contains mission info files for
   the TAC mod.  These mission info files must be in Tribes\TAC\missions.


Disclaimer
----------

I can't be held responsible if ObjectiveExtract.exe does or does not do harm to your
computer.  Do not use ObjectiveExtract.exe in life threatening situations or in medical
equipment.  Do not use ObjectiveExtract.exe in Air Traffic Control software. Do not
immerse ObjectiveExtract.exe in water.  Use a lint free cloth to clean ObjectiveExtract.exe.
Do not open the door whilst ObjectiveExtract.exe is running.  Never allow small children
near ObjectiveExtract.exe.  Seek advice if you read this far.


Scripting notes
---------------

See the document ObjectiveTrak_notes.txt for more details.
Readme — ObjectiveTrak_notes.txt (from the archive itself)
-- ObjectiveTrak -- v3.2.1 -- Scripters notes ------------------------------------------------------------------
Written by |HH|Crunchy (Jonathan Slark)
Web page: http:www.planetstarsiege.com/crunchy/
Email: [email redacted]

*** Requires the Presto Pack v0.93 or later ***  http:www.planetstarsiege.com/presto/
*** Supports Poker's BWAdmin mod ***  http:www.pokerspockets.freeserve.co.uk/

Scripting tool that tracks the status of the objectives in missions.  The script can track objectives in
any of the missions, either base or custom including CTF, C&H, D&D, F&R, Balanced, Open Call and Multiple
Team.  Take a look at the new events and functions ObjectiveTrak defines listed below.  For an example of
the use of the script check out my Objective HUD.

The script has the ability to learn about objectives from the messages sent to the client you see in the
chat box.  The script also loads information about missions from the files created using
ObjectiveExtract.exe.  There is no other way to find out about the objectives from a script, rather than 20
scripts all having to do this hard work ObjectiveTrak does it all for you.

The current implemetation assigns each objective an  unique ID.  The ID is an interger which is in the
range from zero to one less than the number of objectives (see below).

The script patches TeamTrak to bring it up to date.  It lets TeamTrak know about the team names as soon as
you are connected.  Flag tracking has been extended to work with multiple teams.  The interface for
TeamTrak has not been changed in any way.


-------------
---Example---
-------------

	To check the status of all the objectives you could use a simple loop to run through them:

		for(%id = 0; id < Objective::Number(); id++)
		{
			%status = Objective::GetStatus(%id);
			%type = Objective::GetType(%id);
			if(%type == $Objective::CandH)
			{
				if(%status == $Objective::Enemy)
				{
					(do something useful regarding enemy having the objective)
				}
				else
				{
					(etc)
				}
			}
		}

 For a working example take a look at Objective HUD.


------------------
--- New events ---
------------------

	eventObjectiveReset()

		Triggered when the script is reset.  There are no obectives at this point, we will either load info
		about them or find out about them during the game.

	eventObjectiveLoaded(%num)

		Called when the objectives are loaded off disk, the number loaded is returned.  If they can't be
		loaded the objectives will be added when they are taken or lost.  After each mission any new
		objectives will be saved to the config directory so that the next time you play that level the
		script will know about the objectives.  If only a partial list was saved out then the script will
		still learn about new objectives when they are claimed.

		Note: This event is triggered even if no objectives were loaded, %num == 0.

	eventObjectiveMadeNeutral()

		On a mission change or if you join a server just before the match starts the script knows that all
		the objectives are neutral.  It sets them neutral and then triggers this event.

	eventObjectiveNew(%client, %id, %status, %type)

		Just found about a new objective.  The event returns the client ID of the player that changed the
		state of the objective, the ID of the objective, the status of the objective and the type of the
		objective.  The client ID is 0 if it was the server that changed the status of the objective, for
		instance returning an F&R flag after it was dropped and no one picked it up.

	eventObjectiveUpdated(%client, %id, %status, %type)

		An objective already known about has changed state in some way.  The event returns the client ID of
		the player that took the objective, the ID of the objective, the new status of the objective and the
		type of the objective.  The client ID is 0 if it was the server that changed the status of the
		objective.


Events more specific than eventObjectiveUpdated:

	Use the following events instead of eventObjectiveUpdated if they provide what you need.  This ensures
	your script has to do little as possible.

	eventObjectiveTaken(%client, %id, %team, %type)

		Whenever an objective is taken by your team or if your in observer mode this is triggered.  It returns
		the client that took the objective and the objective name.  Objectives that can be taken are C&H
		towers and D&D objectives.  In the case of D&D objectives "take" means your team destroyed the enemy
		objective.

	eventObjectiveLost(%client, %id, %team, %type)

		Whenever an objective that your team was holding is lost this is triggered.  It returns the client
		that took the objective, the objective name and the team that took it.  Objectives that can be lost
		are C&H towers and D&D objectives.  In the case of D&D objectives "lost" means your team failed to
		defend one of your objectives.

	eventObjectiveFlagTaken(%client, %id, %team, %type)

		This event is triggered when a flag has been taken.  It returns the client that is now carrying the
		flag, the flag's ID and the team number.  The type can be a CTF flag or F&R flag.  In CTF missions
		the team is that of the flag, for F&R flags it is the team of the taker.

	eventObjectiveFlagDropped(%client, %id, %team, %type)

		A flag was dropped in the field.  The client that dropped the flag is returned.  Also the flag ID
		and team are returned.  The type can be a CTF flag or F&R flag.  In CTF missions the team is that of
		the flag, for F&R flags it is the team of the dropper.

	eventObjectiveFlagReturned(%client, %id, %team, %type)

		A flag was returned to it's initial position.  For F&R flags this only happens when a player left the
		mission area whilst carrying it or the flag was dropped in the field for a certain length of time.
		For CTF flags this can be either when a player left the mission area or an enemy returned it or the
		flag 
Contents — 8 files (inside the archive)
objectivetrak
Source: The Exiled — Tribes Repository
Original page: https://library.theexiled.pwnageservers.com/file.php?id=456
Archived source HTML: theexiled/mirror-html/file/456.html