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

How to code and deploy mutator in to the KF2 linux server

Nerus87

Member
Jul 9, 2018
8
0
36
Poland
I have problem to understanding how to create and deploy mutator (plugin) to my own.

Current i have pace of code:

//=============================================================================
// KFMutator
//=============================================================================
// Example mutator class for KF2
//=============================================================================
class Test extends KFMutator;

/**
* This function can be used to parse the command line parameters when a server
* starts up
*/

function InitMutator(string Options, out string ErrorMessage)
{
super.InitMutator( Options, ErrorMessage );
`log("This is my Example Mutator");
}

And I have questions about it:

1) What is the difference between KFMutator and Mutator (I saw in some other tutorials), guess KFMutator extends Mutator?
2) Where I can find API documentation?
3) What means '`' apostrophe?
4) I need add some information's about mutator to some config file?

I've put Test mutator to "KFGame/BrewedPC" but it didn't load by server, even on web admin remote management: "There are no mutators available for this gametype." in "Change Map" section.

start params: "./kf2_coop/Binaries/Win64/KFGameSteamServer.bin.x86_64 kf-bioticslab?QueryPort=27715?Private=0?Mutator=Test.Test"

Regards,
Nerus.
 
1) KFMutator extends Mutator as you said. All it does on top of Mutator is set the MyKFGI reference and sets up the mutator chaining for TW's mutator functions. E.g. Mutator.ModifyZedTime does nothing, but KFMutator at least calls the next mutator's ModifyZedTime (this is the chaining). You should extend KFMutator; I can't see any reason why you wouldn't.

2) TW have not yet provided any significant documentation. There some comments in their code but it's rarely comprehensive. I think Yoshiro is planning to use Confluence for this purpose but I really don't expect anything decent. We've been left with nothing for a long time. However, the Unreal Engine (and more importantly Unrealscript) is quite well documented for the most part. These sites are generally the go to sites for learning Unrealscript: https://api.unrealengine.com/udk/Thr...nicalHome.html, https://wiki.beyondunreal.com/UnrealScript_overview.

3) The back tick is for macros which are defined in .uci files. If you've dealt with C++ before, these macros are handled by the preprocessor where the macro text itself is replaced whatever it's meant to expand out to. You really don't need to know about this when starting out, but if you care to learn it at some point, here's a good reference: https://api.unrealengine.com/udk/Thr...Processor.html.

4) I think you can play around with extending KFMutatorSummary but I don't know if that will do much for you. You don't need to include your mutator in a config file to get it to work.

I don't know whether you put the compiled .u file in the BrewedPC folder or the .uc source code files. Make sure you have compiled the mod and use the .u file. I'm guessing the space in "Test. Test" is due to the forum adding it, but if not make sure there's no space there.

HickDead made a great tutorial for creating mods: https://steamcommunity.com/sharedfil...?id=1112644122
 
Last edited:
  • Like
Reactions: Nerus87
Upvote 0