Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Script about HUD (Read 1890 times)
Teuch
YaBB Newbies
*
Offline


Hello all

Posts: 14
Location: Ville Lumière
Joined: Jan 24th, 2017
Gender: Male
Script about HUD
Feb 18th, 2018 at 12:18pm
Print Post  
HI, question for coders, Helen for example  Grin

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


  


Back to top
WWW  
IP Logged
 
Helen
YaBB Administrator
*****
Offline


hello

Posts: 1594
Location: earth
Joined: Nov 8th, 2005
Gender: Male
Re: Script about HUD
Reply #1 - Feb 18th, 2018 at 5:57pm
Print Post  
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.

Code
Select All
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.

Code
Select All
// 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.
  

One of the Scriveners.
Back to top
WWW  
IP Logged
 
Teuch
YaBB Newbies
*
Offline


Hello all

Posts: 14
Location: Ville Lumière
Joined: Jan 24th, 2017
Gender: Male
Re: Script about HUD
Reply #2 - Feb 19th, 2018 at 9:58am
Print Post  
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.





  


Back to top
WWW  
IP Logged
 
Helen
YaBB Administrator
*****
Offline


hello

Posts: 1594
Location: earth
Joined: Nov 8th, 2005
Gender: Male
Re: Script about HUD
Reply #3 - Feb 20th, 2018 at 12:44am
Print Post  
If you don't know how to code, you will need to learn how to code first  Smiley
Do you have a link to that Umaker?
  

One of the Scriveners.
Back to top
WWW  
IP Logged
 
Teuch
YaBB Newbies
*
Offline


Hello all

Posts: 14
Location: Ville Lumière
Joined: Jan 24th, 2017
Gender: Male
Re: Script about HUD
Reply #4 - Feb 21st, 2018 at 4:19pm
Print Post  
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 ?


  


Back to top
WWW  
IP Logged
 
Helen
YaBB Administrator
*****
Offline


hello

Posts: 1594
Location: earth
Joined: Nov 8th, 2005
Gender: Male
Re: Script about HUD
Reply #5 - Feb 22nd, 2018 at 2:36am
Print Post  
Simple as this:

Code
Select All
class sylEnforcer expands Enforcer config(sylStuff);

defaultproperties
{
	PickupAmmoCount=55
	hitdamage=99
}
 

  

One of the Scriveners.
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint