View Full Version : How to make a HUD mutator
KillerMonk
1st Feb 2002, 06:42 PM
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
2nd Feb 2002, 08:11 PM
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
3rd Feb 2002, 10:04 AM
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
KillerMonk
3rd Feb 2002, 08:16 PM
Could I make a mutator to change gametypes? That way it won't spam up the Gametype list...
Captain Kewl
4th Feb 2002, 09:09 AM
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
5th Mar 2002, 09:37 PM
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");
}
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.