Adding Mutator Data to 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.

lofantasy

New Member
Sep 21, 2001
20
0
0
46
Georgia
Visit site
greets, i am curious on how to add info to the hud. ive seen some tutorials on how to do it. but they were very out dated. (v400 or less). i am pretty new to the scripting but im slowly understanding it. right now i have a simple mod an would like to put some numbers on the hud. right above the frags icon. any help would be great =)
an any links to tutorials would be great also =)

ShadowWalker
 

2COOL4-U

New Member
Mar 17, 2001
505
0
0
37
dot NL
2cool.free.fr
call the mutator function RegisterHUDMutator() and you'll get postrender calls for your mutator.

Just add this to your code and place all the drawing with the canvas in it:
PHP:
simulated event PostRender( canvas Canvas )
{
}
 

ca

CHiMERiC Grandmaster
Oct 11, 1999
84
0
0
www.unrealscript.com
or if using a weapon..

If you're using a weapon class as part of your mutator package you could also use the RenderOverlays function... :)
 

lofantasy

New Member
Sep 21, 2001
20
0
0
46
Georgia
Visit site
Me again

thanks for that info. an right now hte mod just adds health to your pawn when u shoot someone. so its not a big one like a gun (im not that good).
an for the RegisterHUDMutator, do i just put that in teh function that adds the health, or above it. an the postRender, that just has to be in the script it self to be called?
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
42
void
www.vovoid.com
if you check in the mutator class you'll get it.
You call the RegisterHUDMutator function when the class is spawned like in postbeginplay:

function postbeginplay()
{
RegisterHUDMutator();
}

then you have the postrender function enabled:

simulated function PostRender( canvas Canvas )
{
(do your drawing here)
}

There are many ways to do this, check them out in canvas.uc

(Extracting code, if you havent done it yet)
 

ca

CHiMERiC Grandmaster
Oct 11, 1999
84
0
0
www.unrealscript.com
What are you trying to do? If you just want to send a message to the client you can just use ClientMessage() instead of dealing with making your mutator a HUD mutator. You can also make a subclass of UT's message class (CriticalEventPlus, etc) to pop up a message similar to the kill and spree messages - "You killed Bob!". Could make your mutator a bit simpler if this is all you are looking ot do, of course if you wanted to draw some textures or have a permanent message on the HUD you'll have to hook in.

Hope I didn't confuse the matter too much. :)
 

lofantasy

New Member
Sep 21, 2001
20
0
0
46
Georgia
Visit site
u didnt confuse me any (not yet that is). an i dont really want to make it msg the person. im just trying to add text to the hud right above the Rank ?/? part. im slowly getting there. but that is what im tryin to do right now =)
 

eXoR

Lead coder
Oct 22, 2001
36
0
0
37
Holland
exorcist.gamepoint.net
Originally posted by papapishu
function postbeginplay()
{
RegisterHUDMutator();
}
In my experience that doesn't always do the job, so I always add this as well:

Function Tick (float Deltatime)
{
Super.Tick(DeltaTime);

if (!bHudMutator)
RegisterHUDMutator();
}
 

lofantasy

New Member
Sep 21, 2001
20
0
0
46
Georgia
Visit site
thanks for all the help. im slowly getting to where i wanted to be =)
an BTW chimeric, on your tutorials, it would be good to put what is needed in the .int for us newbies (not agian =\) for the script to work. im sure its in the normal UT code. but its hard to find it when ur not sure what ur looking for. aside from that. the tutorials are good =)