Code Modify Hud

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Fahrenheit

FNG / Fresh Meat
Nov 2, 2009
14
3
0
I'm starting to create mutators and I would like to know the code to change the images of the perk of Hud in my servers.
Example
modify the texture of the perk by another type of texture.

Anyone know the code?
 

YoYoBatty

FNG / Fresh Meat
Dec 17, 2009
3,459
2,502
0
Canada
look in KFMod -> Classes -> HUDKillingFloor.uc
You can change the HUD type by creating a custom game type that extends KFGameType and delete everything except default props. Simply modifiy anything you want in there. Now to make it load that gametype create a mutator similar to this(you might have to adjust it):

class Something extends Mutator;

function postBeginPlay()
{
local string currentmap;

if(TestGameType(level.game)==none)
{
currentmap=GetURLMap(false);
level.servertravel("?game=KFTestMut.TestGameType",true);
}

}

defaultproperties
{
GroupName="KF-Deeskjack"
FriendlyName="Test Gametype"
Description="Upcoming project for Killing Floor. EARLY ALPHA TEST! Made by YoYoBatty July 19 2010."
bAlwaysRelevant=True
RemoteRole=ROLE_SimulatedProxy
bAddToServerPackages=True
}


Of course that is an example and you need to change the names around so the classes match up with your modded gametype.

Good luck and if you have any questions just PM me!
 

Marco

Active member
May 23, 2009
644
227
43
Finland
You can archive exactly the same WITH a mutator:
Code:
Class MyMutator extends Mutator;

function PreBeginPlay()
{
    AddToPackageMap();
    Level.Game.HUDType = string(Class'MyCustomHud');
    Destroy();
}
 
  • Like
Reactions: PiX

YoYoBatty

FNG / Fresh Meat
Dec 17, 2009
3,459
2,502
0
Canada
You can archive exactly the same WITH a mutator:
Code:
Class MyMutator extends Mutator;
 
function PreBeginPlay()
{
    AddToPackageMap();
    Level.Game.HUDType = string(Class'MyCustomHud');
    Destroy();
}

I just tried this out and it works! TY for that Marco!