HI, question for coders, Helen for example ;D
I am searching an easy way to modify HUD like this :
You take an item and you see a picture. The message "some ammo" or "rocket launcher" will be removed, or not, but in addition of this message you see a picture.
Maybe it already exists ? An HUD modifier ?
Something like this :
Item[0]=Botpack.UT_Eightball
Item[1]=MyItem.Item1
Picture[0]=blabla.pict_rocket
Picture[1]=blabla.pict_myitem
PicturePosition[0]=top: left: size: ......
PicturePosition[1]=top: left: size: ......
With an ini like this, that would be great. :)
The easy way is to create a mutator, and register it as a HUD mutator. This allows you to easily add new stuff to the HUD. However, you will not be able to prevent the normal UT stuff from being drawn.
class SylMutator expands mutator config(SylMutator);
function PreBeginPlay()
{
// You have to register yourself as a HUD mutator like this:
if(!bHUDMutator)
RegisterHUDMutator();
// Other stuff.
}
function PostRender(canvas Canvas)
{
// Draw your stuff.
// Add these lines at the end.
if(HUDMutator != None)
HUDMutator.PostRender(Canvas);
}
The not so easy way is to create your own HUD class, and tell UT to use it. The advantage of doing it this way is you have total control over the HUD. The disadvantage is that there can only be one HUD class, so you could not use any other mutators that are also trying to replace the HUD. Another pain is that there is a different HUD class for each gametype (DM, TDM, CTF, DOM, etc), so you have to make a HUD class for each game type you want to support.
// The UT DeathMatch HUD is the ChallengeHUD class.
class SylChallengeHUD expands ChallengeHUD;
function PostRender(canvas Canvas)
{
// In here you can copy the code from ChallengeHUD, then change it and add new stuff, etc.
}
//////////////////////////////////////////////////////////////////
class SylMutator expands mutator config(SylMutator);
function PreBeginPlay()
{
// Do NOT register yourself as a HUD mutator.
// Instead we tell UT what HUD class we want spawned.
if(Level.Game.IsA('DeathMatchPlus'))
{
DeathMatchPlus(Level.Game).HUDType = Class'SylChallengeHUD';
}
// Other stuff.
}
Any other questions, let me know.
I understand the way but Im not coder so I can't touch this.
I tried to create new class for packages but not yet good, with the Umaker program.
To extand an item for example.
If you don't know how to code, you will need to learn how to code first :-\
Do you have a link to that Umaker?
I thought it's that : http://medor.no-ip.org/index.php?dir=UEditor_Developing/&file=UMake12.zip
Yes I need to learn code.
How do you create a new class for an item, with only editing the default propreties of this item ?
Simple as this:
class sylEnforcer expands Enforcer config(sylStuff);
defaultproperties
{
PickupAmmoCount=55
hitdamage=99
}