Challange Hud

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Lemoni

The Philosapher
Feb 17, 2001
628
0
0
members.lycos.co.uk
like this (prob too much code)//==============================================================================================
//
// GE HUD by Adam "Lemoni" Bryant.
// MAY HAVE THE CORRECT BIT(S)
//
//===============================================================================================
class GeHUD expands ChallengeHUD;

#exec TEXTURE IMPORT NAME=HudElements FILE=TEXTURES\HudElements.PCX GROUP="Icons" MIPS=OFF FLAGS=2
#exec TEXTURE IMPORT NAME=GEhudWeapons FILE=TEXTURES\GEhudWeapons.PCX GROUP="Icons" MIPS=OFF FLAGS=2

simulated function DrawWeapons(Canvas Canvas)

{
local Weapon W, WeaponSlot[11];
local inventory Inv;
local int i, j, BaseY, BaseX, Pending, WeapX, WeapY;
local float AmmoScale, WeaponOffset, WeapScale, WeaponX, TexX, TexY;

BaseX = 0.5 * (Canvas.ClipX - HudScale * WeaponScale * Canvas.ClipX);
WeapScale = WeaponScale * Scale;
Canvas.Style = Style;
BaseY = Canvas.ClipY - 63.5 * WeapScale;
WeaponOffset = 0.1 * HUDScale * WeaponScale * Canvas.ClipX;

if ( PawnOwner.Weapon != None )
{
W = PawnOwner.Weapon;
if ( (Opacity > 8) || !Level.bHighDetailMode )
Canvas.Style = ERenderStyle.STY_Normal;
WeaponX = BaseX + (W.InventoryGroup - 1) * WeaponOffset;
Canvas.CurX = WeaponX;
Canvas.CurY = BaseY;
Canvas.DrawColor = WhiteColor;
Canvas.DrawIcon(W.StatusIcon, WeapScale);
Canvas.DrawColor = WhiteColor;
Canvas.CurX = WeaponX + 4 * WeapScale;
Canvas.CurY = BaseY + 4 * WeapScale;
Canvas.Style = Style;
if ( W.InventoryGroup == 10 )
Canvas.DrawTile(Texture'GeHUD.HudElements', 0.75 * WeapScale * 25, 0.75 * WeapScale * 64, 0, 0, 25.0, 64.0);
else
Canvas.DrawTile(Texture'GeHUD.HudElements', 0.75 * WeapScale * 25, 0.75 * WeapScale * 64, 25*W.InventoryGroup, 0, 25.0, 64.0);

WeaponSlot[W.InventoryGroup] = W;
Canvas.CurX = WeaponX;
Canvas.CurY = BaseY;
Canvas.DrawTile(Texture'GeHUD.GEhudWeapons', 128 * WeapScale, 64 * WeapScale, 128, 64, 128, 64);
}
if ( Level.bHighDetailMode && (PawnOwner.PendingWeapon != None) )
{
Pending = PawnOwner.PendingWeapon.InventoryGroup;
Canvas.CurX = BaseX + (Pending - 1) * WeaponOffset - 64 * WeapScale;
Canvas.CurY = Canvas.ClipY - 96 * WeapScale;
Canvas.Style = ERenderStyle.STY_Translucent;
Canvas.DrawColor = WhiteColor;
Canvas.DrawTile(Texture'GeHUD.GEhudWeapons', 256 * WeapScale, 128 * WeapScale, 0, 128, 256.0, 128.0);
}
else
Pending = 100;

Canvas.Style = Style;
i = 0;
for ( Inv=PawnOwner.Inventory; Inv!=None; Inv=Inv.Inventory )
{
if ( Inv.IsA('Weapon') && (Inv != PawnOwner.Weapon) )
{
W = Weapon(Inv);
if ( WeaponSlot[W.InventoryGroup] == None )
WeaponSlot[W.InventoryGroup] = W;
else if ( (WeaponSlot[W.InventoryGroup] != PawnOwner.Weapon)
&& ((W == PawnOwner.PendingWeapon) || (WeaponSlot[W.InventoryGroup].AutoSwitchPriority < W.AutoSwitchPriority)) )
WeaponSlot[W.InventoryGroup] = W;
}
i++;
if ( i > 100 )
break; // can occasionally get temporary loops in netplay
}
W = PawnOwner.Weapon;

// draw weapon list
TexX = 128 * WeapScale;
TexY = 64 * WeapScale;
for ( i=1; i<11; i++ )
{
if ( WeaponSlot == None )
{
Canvas.Style = Style;
Canvas.DrawColor = WhiteColor;
Canvas.CurX = BaseX + (i - 1) * WeaponOffset;
Canvas.CurY = BaseY;

WeapX = ((i-1)%4) * 64;
WeapY = ((i-1)/4) * 32;
Canvas.DrawTile(Texture'GeHUD.GEhudWeapons',TexX,TexY,WeapX,WeapY,64.0,32.0);
}
else if ( WeaponSlot != W )
{
if ( Pending == i )
{
if ( (Opacity > 8) || !Level.bHighDetailMode )
Canvas.Style = ERenderStyle.STY_Normal;
Canvas.DrawColor = WhiteColor;
}
else
{
Canvas.Style = Style;
Canvas.DrawColor = WhiteColor;
}
Canvas.CurX = BaseX + (i - 1) * WeaponOffset;
Canvas.CurY = BaseY;

if ( WeaponSlot.bSpecialIcon )
Canvas.DrawIcon(WeaponSlot.StatusIcon, WeapScale);
else
{
WeapX = ((i-1)%4) * 64;
WeapY = ((i-1)/4) * 32;
Canvas.DrawTile(Texture'GeHUD.GEhudWeapons',TexX,TexY,WeapX,WeapY,64.0,32.0);
}
}
}

//draw weapon numbers and ammo
TexX = 0.75 * WeapScale * 25;
TexY = 0.75 * WeapScale * 64;
for ( i=1; i<11; i++ )
{
if ( WeaponSlot != None )
{
WeaponX = BaseX + (i - 1) * WeaponOffset + 4 * WeapScale;
if ( WeaponSlot != W )
{
Canvas.CurX = WeaponX;
Canvas.CurY = BaseY + 4 * WeapScale;
Canvas.DrawColor = WhiteColor;
if ( (Opacity > 8) || !Level.bHighDetailMode )
Canvas.Style = ERenderStyle.STY_Normal;
else
Canvas.Style = Style;
if ( i == 10 )
Canvas.DrawTile(Texture'GeHUD.HudElements', TexX, TexY, 0, 0, 25.0, 64.0);
else
Canvas.DrawTile(Texture'GeHUD.HudElements', TexX, TexY, 25*i, 0, 25.0, 64.0);
}
if ( WeaponSlot.AmmoType != None )
{
// Draw Ammo bar
Canvas.CurX = WeaponX;
Canvas.CurY = BaseY + 52 * WeapScale;
Canvas.DrawColor = WhiteColor;
AmmoScale = FClamp(88.0 * WeapScale * WeaponSlot.AmmoType.AmmoAmount/WeaponSlot.AmmoType.MaxAmmo, 0, 88);
Canvas.DrawTile(Texture'GeHUD.HudElements', AmmoScale, 8 * WeapScale,64,64,128.0,8.0);
}
}
}
}

paste into note pad to understand
Thanks to Chimeric/2cool any maany others in telling me were to edit it
 

2COOL4-U

New Member
Mar 17, 2001
505
0
0
37
dot NL
2cool.free.fr
Here comes a readable version
Code:
==============================================================================================
//
// GE HUD by Adam "Lemoni" Bryant.
// MAY HAVE THE CORRECT BIT(S)
//
//===============================================================================================
class GeHUD expands ChallengeHUD;

#exec TEXTURE IMPORT NAME=HudElements FILE=TEXTURES\HudElements.PCX GROUP="Icons" MIPS=OFF FLAGS=2
#exec TEXTURE IMPORT NAME=GEhudWeapons FILE=TEXTURES\GEhudWeapons.PCX GROUP="Icons" MIPS=OFF FLAGS=2

simulated function DrawWeapons(Canvas Canvas)

{
	local Weapon W, WeaponSlot[11];
	local inventory Inv;
	local int i, j, BaseY, BaseX, Pending, WeapX, WeapY;
	local float AmmoScale, WeaponOffset, WeapScale, WeaponX, TexX, TexY;

	BaseX = 0.5 * (Canvas.ClipX - HudScale * WeaponScale * Canvas.ClipX);
	WeapScale = WeaponScale * Scale;
	Canvas.Style = Style;
	BaseY = Canvas.ClipY - 63.5 * WeapScale;
	WeaponOffset = 0.1 * HUDScale * WeaponScale * Canvas.ClipX;

	if ( PawnOwner.Weapon != None )
	{
		W = PawnOwner.Weapon;
		if ( (Opacity > 8) || !Level.bHighDetailMode )
			Canvas.Style = ERenderStyle.STY_Normal;
		WeaponX = BaseX + (W.InventoryGroup - 1) * WeaponOffset;
		Canvas.CurX = WeaponX;
		Canvas.CurY = BaseY;
		Canvas.DrawColor = WhiteColor;
		Canvas.DrawIcon(W.StatusIcon, WeapScale);
		Canvas.DrawColor = WhiteColor;
		Canvas.CurX = WeaponX + 4 * WeapScale;
		Canvas.CurY = BaseY + 4 * WeapScale;
		Canvas.Style = Style;
		if ( W.InventoryGroup == 10 )
			Canvas.DrawTile(Texture'GeHUD.HudElements', 0.75 * WeapScale * 25, 0.75 * WeapScale * 64, 0, 0, 25.0, 64.0);
		else
			Canvas.DrawTile(Texture'GeHUD.HudElements', 0.75 * WeapScale * 25, 0.75 * WeapScale * 64, 25*W.InventoryGroup, 0, 25.0, 64.0);

		WeaponSlot[W.InventoryGroup] = W;  
		Canvas.CurX = WeaponX;
		Canvas.CurY = BaseY;
		Canvas.DrawTile(Texture'GeHUD.GEhudWeapons', 128 * WeapScale, 64 * WeapScale, 128, 64, 128, 64);
	}
	if ( Level.bHighDetailMode && (PawnOwner.PendingWeapon != None) )
	{
		Pending = PawnOwner.PendingWeapon.InventoryGroup;
		Canvas.CurX = BaseX + (Pending - 1) * WeaponOffset - 64 * WeapScale;
		Canvas.CurY = Canvas.ClipY - 96 * WeapScale; 
		Canvas.Style = ERenderStyle.STY_Translucent;
		Canvas.DrawColor = WhiteColor;
		Canvas.DrawTile(Texture'GeHUD.GEhudWeapons', 256 * WeapScale, 128 * WeapScale, 0, 128, 256.0, 128.0);
	}
	else
		Pending = 100;

	Canvas.Style = Style;
	i = 0;
	for ( Inv=PawnOwner.Inventory; Inv!=None; Inv=Inv.Inventory )
	{
		if ( Inv.IsA('Weapon') && (Inv != PawnOwner.Weapon) )
		{
			W = Weapon(Inv);
			if ( WeaponSlot[W.InventoryGroup] == None )
				WeaponSlot[W.InventoryGroup] = W;
			else if ( (WeaponSlot[W.InventoryGroup] != PawnOwner.Weapon)
					&& ((W == PawnOwner.PendingWeapon) || (WeaponSlot[W.InventoryGroup].AutoSwitchPriority < W.AutoSwitchPriority)) )
				WeaponSlot[W.InventoryGroup] = W;
		}
		i++;
		if ( i > 100 )
			break; // can occasionally get temporary loops in netplay
	}
	W = PawnOwner.Weapon;

	// draw weapon list
	TexX = 128 * WeapScale;
	TexY = 64 * WeapScale;
	for ( i=1; i<11; i++ )
	{
		if ( WeaponSlot[i] == None )
		{
			Canvas.Style = Style;
			Canvas.DrawColor =  WhiteColor;
			Canvas.CurX = BaseX + (i - 1) * WeaponOffset;
			Canvas.CurY = BaseY;
			
			WeapX = ((i-1)%4) * 64;
			WeapY = ((i-1)/4) * 32;
			Canvas.DrawTile(Texture'GeHUD.GEhudWeapons',TexX,TexY,WeapX,WeapY,64.0,32.0);
		}
		else if ( WeaponSlot[i] != W )
		{
			if ( Pending == i )
			{
				if ( (Opacity > 8) || !Level.bHighDetailMode )
					Canvas.Style = ERenderStyle.STY_Normal;
				Canvas.DrawColor = WhiteColor;
			}
			else
			{
				Canvas.Style = Style;
				Canvas.DrawColor = WhiteColor;
			}
			Canvas.CurX = BaseX + (i - 1) * WeaponOffset;
			Canvas.CurY = BaseY;
			
			if ( WeaponSlot[i].bSpecialIcon )
				Canvas.DrawIcon(WeaponSlot[i].StatusIcon, WeapScale);
			else
			{
				WeapX = ((i-1)%4) * 64;
				WeapY = ((i-1)/4) * 32;
				Canvas.DrawTile(Texture'GeHUD.GEhudWeapons',TexX,TexY,WeapX,WeapY,64.0,32.0);
			}
		}
	}

	//draw weapon numbers and ammo
	TexX = 0.75 * WeapScale * 25;
	TexY = 0.75 * WeapScale * 64;
	for ( i=1; i<11; i++ )
	{
		if ( WeaponSlot[i] != None )
		{
			WeaponX = BaseX + (i - 1) * WeaponOffset + 4 * WeapScale;
			if ( WeaponSlot[i] != W )
			{
				Canvas.CurX = WeaponX;
				Canvas.CurY = BaseY + 4 * WeapScale;
				Canvas.DrawColor = WhiteColor;
				if ( (Opacity > 8) || !Level.bHighDetailMode )
					Canvas.Style = ERenderStyle.STY_Normal;
				else
					Canvas.Style = Style;
				if ( i == 10 )
					Canvas.DrawTile(Texture'GeHUD.HudElements', TexX, TexY, 0, 0, 25.0, 64.0);
				else
					Canvas.DrawTile(Texture'GeHUD.HudElements', TexX, TexY, 25*i, 0, 25.0, 64.0);
			}
			if ( WeaponSlot[i].AmmoType != None )
			{
				// Draw Ammo bar
				Canvas.CurX = WeaponX;
				Canvas.CurY = BaseY + 52 * WeapScale;
				Canvas.DrawColor = WhiteColor;
				AmmoScale = FClamp(88.0 * WeapScale * WeaponSlot[i].AmmoType.AmmoAmount/WeaponSlot[i].AmmoType.MaxAmmo, 0, 88);
				Canvas.DrawTile(Texture'GeHUD.HudElements', AmmoScale, 8 * WeapScale,64,64,128.0,8.0);
			}
		}
	}
}
 

Blödsinn machen

cannon fodder
Dec 4, 2001
68
0
0
Switzerland
dwmade.stormpages.com
for a radar, this seems to work:

Code:
//====================================================================
// WH40KRadar.
//====================================================================
class WH40KRadar extends Actor;

#exec TEXTURE IMPORT Name=Frame FILE=Textures\RadarFrame.pcx MIPS=OFF FLAGS=2
#exec TEXTURE IMPORT NAME=Blips FILE=Textures\RadarBlips.pcx MIPS=OFF

const UUPerRadian = 10430.219196;
var float Scale;
var int RadarRadius;
var float DetectRadius;

event PreBeginPlay()
{
	RadarRadius = 50;
	DetectRadius = 1500;
	Scale = RadarRadius/DetectRadius;	
}

event PostRender(canvas Canvas)
{
	local Pawn P;
	local int BaseX, BaseY;
	local float XL, YL;
	local float XDiff, YDiff;
	local float CurX, CurY;
	local float YawRadians;
	
	Canvas.DrawColor.R = 255;
	Canvas.DrawColor.G = 255;
	Canvas.DrawColor.B = 255;
	Canvas.Style = ERenderStyle.STY_Masked;
	Canvas.SetPos(0, Canvas.ClipY - (RadarRadius * 2));
	
	Canvas.DrawTile(Texture'WH40K.Frame', 100.0, 100.0, 0.0, 0.0, 100.0, 100.0);

	Canvas.Font = class'FontInfo'.static.GetStaticSmallestFont(Canvas.ClipX);
	Canvas.StrLen("Radius: "$string(DetectRadius), XL, YL);
	Canvas.SetPos(5, Canvas.ClipY - (RadarRadius * 2) - YL);
	Canvas.DrawText("Radius: "$string(DetectRadius), False);		
	
	YawRadians = Owner.Rotation.Yaw/UUPerRadian;	// Should ViewRotation be referenced here instead?
	BaseX = 50;
	BaseY = Canvas.ClipY - RadarRadius;		
	
	foreach RadiusActors( class'Pawn', P, DetectRadius, Owner.Location )
	{
		if ( !P.IsInState('Dying') && !P.IsA('PlayerPawn') ) // Standalone game types
		{
			XDiff = P.Location.X - Owner.Location.X;
			YDiff = P.Location.Y - Owner.Location.Y;
			// Clockwise rotation about the origin (BaseX, BaseY)
			CurX = XDiff * Cos(YawRadians) + YDiff * Sin(YawRadians);
			CurY = XDiff * -Sin(YawRadians) + YDiff * Cos(YawRadians);
			Canvas.SetPos(BaseX + CurY * Scale - 2.5, BaseY - CurX * Scale - 2.5);
			if ( P.PlayerReplicationInfo.Team == Pawn(Owner).PlayerReplicationInfo.Team )
				Canvas.DrawTile(Texture'WH40K.Blips', 5.0, 5.0, 0.0, 0.0, 5.0, 5.0);
			else
				Canvas.DrawTile(Texture'WH40K.Blips', 5.0, 5.0, 5.0, 0.0, 5.0, 5.0);
		}
	}
}

defaultproperties
{
	bHidden=True
}

however, I've stumbled across (and have seen people mention in other threads) Pawn.ViewRotation. could somebody clarify the difference between this and Actor.Rotation? Up till now I've always referenced Actor.Rotation and it seems to work fine probably just dumb luck...)
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
42
void
www.vovoid.com
If you would like something more real you could use visibleactor instead and still use the radius, since a radarwave cant go through a wall...
But what would be the fun of that...
It's just a tip...