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.

_U][B_StoneRain

New Member
Nov 18, 2001
11
0
0
55
Frankfurt/Germany
www.utbase.com
class myMutator extends Mutator;

var bool isInitialized;

function PostBeginPlay()
{
if ( isInitialized ) return;
isInitialized = True;
RegisterHUDMutator();
}
Function Tick (float Deltatime)
{
Super.Tick(DeltaTime);
if (!bHudMutator) RegisterHUDMutator();
}
simulated event PostRender ( canvas C)
{
..... C.DrawText("....."); .... // do the drawing here
C.Reset();
if ( NextMutator != None )
{
NextMutator.PostRender ( C );
}
}

what is wrong with this code ? locally on my pc it works fine but it doesn't run on our server. simply no effect at all. adding the mutator to the serverpackages only resultet in having to download it. may this be an issue with UTPure ?

another problem is that the mutator does not work in combination with other mutators that change the hud. if i select several mutators only the first in the list changes the hud.

even this version from the tutorials shows the same effects:


smartT.uc
-------------
class smartT expands Mutator;
function PreBeginPlay()
{
spawn(class'smartT.THUDNotify');
}


THUDNotify.uc
------------------
class THUDNotify expands SpawnNotify;
simulated event Actor SpawnNotification( Actor A )
{
if ( HUD(A).HUDMutator == none )
{
HUD(A).HUDMutator = spawn(class'smartT.THUD',A);
}
else
{
HUD(A).HUDMutator.AddMutator(spawn(class'smartT.THUD',A));
}
return A;
}

defaultproperties
{
ActorClass=class'Engine.HUD'
}


THUD.uc
-----------
class THUD extends Mutator;
var bool isInitialized;
function PostBeginPlay()
{
if ( isInitialized ) return;
isInitialized = True;
RegisterHUDMutator();
}
Function Tick (float Deltatime)
{
Super.Tick(DeltaTime);
if (!bHudMutator) RegisterHUDMutator();
}
simulated function PostRender ( canvas C)
{
C.Draw.........
C.Reset();
if ( NextMutator != None )
{
NextMutator.PostRender ( C );
}
}
 

_U][B_StoneRain

New Member
Nov 18, 2001
11
0
0
55
Frankfurt/Germany
www.utbase.com
the mutator runs and the Sender.ClientMessage("...") in the mutate function works, but still no change in the hud. and one hud mutator still overrides all other hud mutators.

when do I have to add a line at serverpackages ?
afaik simulated means that the functions are called on all clients. which functions must be simulated, only Tick & PostBeginPlay & functions like that or all functions I implemented in the mutator ?

/edit 02:58/
on my way :)
 

_U][B_StoneRain

New Member
Nov 18, 2001
11
0
0
55
Frankfurt/Germany
www.utbase.com
BIG TNX to you all, now it works :)

I read all tuties on hud mutators but didn't expect the best infos in a tuty about linked lists. I put the whole spawn notify crap in the trashcan, someone should update the hud tuties and replace the code examples with the code from Mychaeel's zip

@Mychaeel
oh je, nachher um 8:00 klingelt wieder der Wecker, aber jetzt kann ich endlich beruhigt schlafen gehen :p