Page 1 of 1

EnhancedMH Scoreboard (would like to live)

Posted: Sun Apr 19, 2009 7:36 pm
by HornD
Hi
I found this nice mutator but it is a beta version. I want try editing this mutator. The Mutator is on my server. It have a better Scoreboard but suckt. look!

Image

http://www.smiling-monsters.com/communi ... .php?t=147

Posted: Mon Apr 20, 2009 12:06 pm
by Rob
I don't think it's a bug. 9999 must be the highest score that can be displayed in this part of the HUD.

Posted: Tue Apr 21, 2009 2:13 am
by nath2008uk
Unless you reduced the font size somehow

Posted: Tue Apr 21, 2009 1:21 pm
by HornD
hehe y es somehow :naughty:

Posted: Tue Apr 21, 2009 2:11 pm
by TheDane
Create a new HUD, look in challengeHUD for this section:

Code: Select all

simulated function DrawFragCount(Canvas Canvas)
{
	local float Whiten;
	local int X,Y;

	if ( PawnOwner.PlayerReplicationInfo == None )
		return;

	Canvas.Style = Style;
	if ( bHideAllWeapons || (HudScale * WeaponScale * Canvas.ClipX <= Canvas.ClipX - 256 * Scale) )
		Y = Canvas.ClipY - 63.5 * Scale;
	else
		Y = Canvas.ClipY - 127.5 * Scale;
	if ( bHideAllWeapons )
		X = 0.5 * Canvas.ClipX - 256 * Scale;
	Canvas.CurX = X;
	Canvas.CurY = Y;
	Canvas.DrawColor = HUDColor;
	Whiten = Level.TimeSeconds - ScoreTime;
	if ( Whiten < 3.0 )
	{
		if ( HudColor == GoldColor )
			Canvas.DrawColor = WhiteColor;
		else
			Canvas.DrawColor = GoldColor;
		if ( Level.bHighDetailMode )
		{
			Canvas.CurX = X - 64 * Scale;
			Canvas.CurY = Y - 32 * Scale;
			Canvas.Style = ERenderStyle.STY_Translucent;
			Canvas.DrawTile(Texture'BotPack.HUDWeapons', 256 * Scale, 128 * Scale, 0, 128, 256.0, 128.0);
		}
		Canvas.CurX = X;
		Canvas.CurY = Y;
		Whiten = 4 * Whiten - int(4 * Whiten);
		Canvas.DrawColor = Canvas.DrawColor + (HUDColor - Canvas.DrawColor) * Whiten;
	}

	Canvas.DrawTile(Texture'BotPack.HudElements1', 128*Scale, 64*Scale, 0, 128, 128.0, 64.0);
	Canvas.DrawColor = WhiteColor;
	DrawBigNum(Canvas, PawnOwner.PlayerReplicationInfo.Score, X + 40 * Scale, Y + 16 * Scale);
}
now that's what draws the frag count, the last function called (DrawBigNum) is the one that sets the size of the numbers, create a new function (e.g. MyDrawfrags) and call that function instead. MyDrawFrags should be a modified version of DrawBigNum that looks like this:

Code: Select all

simulated function DrawBigNum(Canvas Canvas, int Value, int X, int Y, optional float ScaleFactor)
{
	local int d, Mag, Step;
	local float UpScale;
	local byte bMinus;

	if ( ScaleFactor != 0 )
		UpScale = Scale * ScaleFactor;
	else
		UpScale = Scale;

	Canvas.CurX = X;
	Canvas.CurY = Y;
	Step = 16 * UpScale;
	if ( Value < 0 )
		bMinus = 1;
	Mag = FMin(9999, Abs(Value));

	if ( Mag >= 1000 )
	{
		Canvas.CurX -= Step;
		d = 0.001 * Mag;
		DrawDigit(Canvas, d, Step, UpScale, bMinus);
		Mag = Mag - 1000 * d;
		d = 0.01 * Mag;
		DrawDigit(Canvas, d, Step, UpScale, bMinus);
		Mag = Mag - 100 * d;
	}
	else if ( Mag >= 100 )
	{
		d = 0.01 * Mag;
		DrawDigit(Canvas, d, Step, UpScale, bMinus);
		Mag = Mag - 100 * d;
	}
	else
		Canvas.CurX += Step;

	if ( Mag >= 10 )
	{
		d = 0.1 * Mag;
		DrawDigit(Canvas, d, Step, UpScale, bMinus);
		Mag = Mag - 10 * d;
	}
	else if ( d > 0 )
		DrawDigit(Canvas, 0, Step, UpScale, bMinus);
	else
		Canvas.CurX += Step;

	DrawDigit(Canvas, Mag, Step, UpScale, bMinus);
}
just copy and rename the function to MyDrawFrags and change the size and lenght of the numbers to your needs.

Posted: Wed Apr 22, 2009 10:11 am
by HornD
Ok thx for coding :wiggle:

Posted: Sun May 31, 2009 8:22 am
by HornD
mhh question
How can i make the scorenumber smaller in this code?
She is to big for over 99999.

Posted: Mon Jun 01, 2009 2:28 am
by TheDane
easy, just don't use the default place for the scores, move the hunters numbers and monsters left up a bit, then add a line for the score? then you can let your players spam the spawn factories and go like 999999999999999999999999999999999999999+ depending on their screen resolution.

Added after 3 minutes:

also remove the text line "Monster Hunt with bla bla bla by zeal" .. it stings my eyes, and author doesn't need his name constantly to show up in game, a spawn text on the HUD would be eneough imo.