[T2] Request: Objective Hud

G|ga
12-30-2002, 05:10 PM
I'm using objective hud by grinder and i find it quite nice, but the score limit will not be shown on every map. Anyone interested to improve it, so it shows the correct scorelimit on every map, because grinder doesn't play t2 since one year and won't update it.
Here's the link to the page: http://www.planettribes.com/grinder/

G|ga
12-30-2002, 05:38 PM
after checking the sourcecode a bit, i found out that he uses an array to store the scorelimit for the maps. the problem is, that this only is useful for known maps, maps that aren't listed in this array, won't get the scorelimit displayed. I don't know enough about the t2 scripting language to change it, so if anyone is interested it would be highly appreciated! ;)

UberGuy (FT)
12-30-2002, 07:10 PM
I've actually been planning this myself for exactly this reason, and this was the approach I was planning. I just checked this morning to make sure that the score line is generated in game and not in the map header. (And it is not in the header, which is a good thing).

Kaiten Commande
12-30-2002, 09:25 PM
I have a working copy atm, but you can wait for another Uber Release. Grinder is having a day of :(

G|ga
12-31-2002, 04:54 AM
i think i'll use uberguy's script as soon as it is available!

@Uberguy Are you planning to support the other gametypes also, like Grinder did it with his objective hud? Would be cool, but unlike Grinder try to get all the information dynamically, because eg. for CnH, Grinder also used that "array" to display the information about the objectives.

@Kaiten as long as the uberrelease isn't available, would you mind releasing your working copy of grinder's objective hud?

Kaiten Commande
12-31-2002, 05:05 AM
TBH the Oblectives are a pain in the ass & I don't know a way of doing it.. But Uber might work it out.

Anyhow... Modded ObjectiveHud (http://www.kaiten.barrysworld.ne t/download.php?op=download&id=27&url=files/zSCRIPT-ObjectiveHud.vl2) That's the version that I have running.

G|ga
12-31-2002, 05:10 AM
:D thanks!

G|ga
12-31-2002, 05:22 AM
hmmm...still doesn't work. Just joined a classic server with Dangerous Crossing running and the score limit wasn't displayed.

looked into the sourcecode again:
ObjectiveTrack.cs

function Objective::getMapScoreLim it(%map, %oldscore)
{
if(!%map)
%map = Objective::getMap();


// Support for Leagues played with Original MapScore Limit
if((%oldscore) && (Objective::getGametype() $= "CapturetheFlag"))
{
if(strlen($Objective::Map ScoreLimit[%map]) $= 4)
return getSubStr($Objective::Map ScoreLimit[%map], 1, 2);
else
return getSubStr($Objective::Map ScoreLimit[%map], 1, 1);
}
else
return $Objective::MapScoreLimit[%map];
}


i think this has to be changed, maybe i'm wrong.

G|ga
12-31-2002, 05:43 AM
on a classic server on dangerous crossing. The server is running pizza mod 1.1a.

Edit:
Now tried it on the same server with map confusco...same thing.

Kaiten Commande
12-31-2002, 05:59 AM
Updated it again. Same URL.

G|ga
12-31-2002, 07:05 AM
:D works...thanks!

UberGuy (FT)
12-31-2002, 10:45 AM
Here (http://scripts.tribalwar.com/uberguy/files/ObjHudFix.cs)'s an external fix that sets the score limit. I've tested it on xpack2 maps and the dynamix final map pack. It's not in a vl2 - just stick it in your autoexec folder. It doesn't need anything but Grinder's obj hud.

I've found out that my earlier assertion about score limits being not dependant on the map header was wrong. That said, this seems to work on all the xpack/xpack2 maps, since they have well formatted headers.

Basically Kaiten and I are using the same info to do this, so any custom maps that don't have the right "xxx points to win" line in the map header will cause these fixes to fail. :(

G|ga
12-31-2002, 11:38 AM
how is tribes itself going to know the scorelimit on those maps? I mean it knows when the scorelimit is reached on every map. No way to get the information where tribes gets it from?

Kaiten Commande
12-31-2002, 11:51 AM
The server gets the info from the mission header in the *mis file.. it then sends that info to the client in the LoadingGui & the LobbyGui. It all depends on what info the mapper has included in the header.

Example:
// DisplayName = Blastside
// MissionTypes = CTF DnD

//--- MISSION QUOTE BEGIN ---
//The BloodEagle and Diamond Sword battle each other at close range with their massive flying bases.
//--- MISSION QUOTE END ---

//--- MISSION STRING BEGIN ---
//[CTF]500 points to win
//No vehicle stations
//<color:008B8B>Map by Nefilim (assisted: Sparky, ToKrZ, z0dd)
//--- MISSION STRING END ---

The server sends that info to you on Loading.

G|ga
12-31-2002, 01:05 PM
i see...the server always knows the scorelimit, but it depends on which information it sends to you. If it doesn't sent you correct information about the scorelimit, you can't display it.

G|ga
12-31-2002, 02:23 PM
i searched a bit through scripts.vl2 and found something in CTFGame.cs:

function CTFGame::checkScoreLimit( %game, %team)
{
%scoreLimit = MissionGroup.CTF_scoreLim it * %game.SCORE_PER_TEAM_FLAG _CAP;
// default of 5 if scoreLimit not defined
if(%scoreLimit $= "")
%scoreLimit = 5 * %game.SCORE_PER_TEAM_FLAG _CAP;
if($TeamScore[%team] >= %scoreLimit)
%game.scoreLimitReached() ;
}

or in CnHGame.cs:

function CnHGame::getScoreLimit(%g ame)
{
%scoreLimit = MissionGroup.CnH_scoreLim it;
if(%scoreLimit $= "")
%scoreLimit = %game.getNumFlipFlops() * %game.SCORE_LIMIT_PER_TOW

return %scoreLimit;
}

don't know if this can be used in any way.

Kaiten Commande
12-31-2002, 03:41 PM
Server Side unfortunately.