Question regarding replacing textures

  • 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/

kyoji

FNG / Fresh Meat
Sep 6, 2011
4
1
0
I modified KFMapEndTextures.utx to display my own message at the end of a round, and it works fine. But if I join a server to play online the hosts texture file is downloaded , or vis a versa if I host a match.

I did some digging in the script files for the game and only found one function that calls the texture in KFMod/Classes/KFHUD.uc/drawEndGameHUD()

I have a mutator compiled and enabled that steals bits of the code (modified of course) but it doesn't work, and I have no idea if thats the proper way to go about it.

Is it possible to replace a default texture like this with one of my own using a mutator? I've looked for some documentation on available KF classes and such, but couldnt find anything substantial past the two very basic mutator tutorials.

Thanks!
 

kyoji

FNG / Fresh Meat
Sep 6, 2011
4
1
0
Well, nobody answered but I figured it out, thanks to GoldMetal!

I decompiled his ServerPerksV3 to figure out how he replaced the perk icons in the HUD. For posterity and those who come after me, I'll explain:

First you define your class that will extend the default class:

Code:
class EXAMPLE extends EXAMPLEPARENT;

Then you copy and paste the code you wish to change, make your modifications, and save your file.

In your mutator class file you have to add these two lines in order for your modifcations to override the class it extends:

Code:
function PostBeginPlay()
{
	AddToPackageMap();
	Level.Game.HUDType = string(Class'EXAMPLE');
}
In this case I'm not sure where Level.Game.HudType is defined; I'll admit that if GoldMetal had not needed to modify this I'd be dead in the water. If anyone could shed some light I'd be appreciative.

Anyway, that's it. Add the usual mutator stuff and you should be good to go!
 
  • Like
Reactions: Benjamin