How to make a HUD mutator

  • 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.

KillerMonk

UScript and VC++ Master Mind
Jan 9, 2002
48
0
0
Utah
www.programmersheaven.com
well, more how can I add it without making a new game type. It was done with the team beacon mutator, but that just draws little icons, I'm wondering how I could change the whole HUD w/o having to create a whole new game type...
 

arcanex

teh grinning totem
Sep 28, 2001
123
0
0
I don't think you can change the default HUD with just a mutator, all you can do is add to it through PostRender() functions.
 

Lemoni

The Philosapher
Feb 17, 2001
628
0
0
members.lycos.co.uk
just make the game type, it easer to under stand the functions for the hud if u do, i did an split (with - signs) the challeng hud up so i could understand it
 

Captain Kewl

I know kewl.
Feb 13, 2001
794
0
0
IN YOUR HOUSE
Visit site
Sure it's possible to change the HUD. Use ModifyPlayer to change PlayerPawn(Other).myHUD. Unclean programming, but it works. :)

I think it might also be possible to replace the HUD in a SpawnNotify, though my attempts to do so crashed UT. Though at the time I didn't really understand what I was doing, so it may yet be possible.
 

|FAST|_Chimp

Col. Mustard
Mar 5, 2002
6
0
0
Visit site
This is my code written from tutorial by Druken Master ascholer@mediaone.net... You'll get the idea...

create mutator:
class scpHudScore extends Mutator;

var bool gbInitDone;

function PreBeginPlay()
{
if (gbInitDone) return;
gbInitDone = True;
spawn(class'scpHudScore.scpHudScoreNotify');
}

Create the spawn notify:
class scpHudScoreNotify extends SpawnNotify;

simulated event Actor SpawnNotification( Actor loActor )
{

if ( HUD(loActor).HUDMutator == none)
{
HUD(loActor).HUDMutator = spawn(class'scpHudScore.scpHudScoreHud',loActor);
}
else
{
HUD(loActor).HUDMutator.AddMutator(spawn(class'scpHudScore.scpHudScoreHud',loActor));
}
return loActor;

}
defaultproperties
{
ActorClass=class'Engine.HUD';
}


create the hud:
class scpHudScoreHud extends Mutator;
simulated function PostRender (canvas loCanvas)
{

loCanvas.SetPos(30,50);
loCanvas.DrawText("my text");
}