[Tutorial] Creating a Basic Mutator

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

FluX

Grizzled Veteran
Oct 26, 2010
5,392
233
63
www.fluxiserver.co.uk
How would someone go about taking a stock weapon in the game and have the player's spawn with it?
Here you go, the code I use for my weapons.
Code:
//=============================================================================
// AS50 Mutator - Automatically spawn with it
// Made by FluX
// [URL]http://www.fluxiserver.co.uk[/URL]
//=============================================================================
class MutAS50 extends Mutator;
function ModifyPlayer(Pawn Player)
{
     Super.ModifyPlayer(Player);
     Player.GiveWeapon("FX-AS50.AS50SniperRifle");
}
defaultproperties
{
     bAddToServerPackages=True
     GroupName="KF-AS50Mut"
     FriendlyName="AS50 Mutator Version"
     Description="Spawn with the AS50. Made by FluX"
}
 

Coroner

FNG / Fresh Meat
Sep 13, 2012
144
0
0
Another way is to add something like this to the PerkName.uc file:
(In the ServerPerks source there is SRVet*PerkName*.uc files... rename them to create your own custom versions and recompile)
*This example is from a custom build that uses level 30 as the max.

Code:
// Give Extra Items as Default
static function AddDefaultInventory(KFPlayerReplicationInfo KFPRI, Pawn P)
{
    if (KFPRI.ClientVeteranSkillLevel >= 0 )
        KFHumanPawn(P).CreateInventoryVeterancy("KFLvCM.MachinePistol", GetCostScaling(KFPRI, class'MachinePistolPickup'));

    if (KFPRI.ClientVeteranSkillLevel >= 30)
    {
        KFHumanPawn(P).CreateInventoryVeterancy("KFLvCM.Protecta", GetCostScaling(KFPRI, class'ProtectaPickup'));
        P.ShieldStrength = 100;
    }
    else if (KFPRI.ClientVeteranSkillLevel >= 20)
    {
        KFHumanPawn(P).CreateInventoryVeterancy("KFLvCM.OverchargedAA12", GetCostScaling(KFPRI, class'OverchargedAA12Pickup'));
        P.ShieldStrength = 100;
    }
    else if (KFPRI.ClientVeteranSkillLevel >= 10)
    {
        KFHumanPawn(P).CreateInventoryVeterancy("KFLvCM.AFS12a", GetCostScaling(KFPRI, class'AFS12Pickup'));
        P.ShieldStrength = 100;
    }
    else if (KFPRI.ClientVeteranSkillLevel >= 5)
        KFHumanPawn(P).CreateInventoryVeterancy("KFLvCM.BoomStick", GetCostScaling(KFPRI, class'BoomStickPickup'));
}
 

FluX

Grizzled Veteran
Oct 26, 2010
5,392
233
63
www.fluxiserver.co.uk
No Coroner, i'm saying to make your own perks by stopping all people from recompiling ServerPerks. Don't ever say to recompile it cause it causes massive problems for everyone, version mismatchs everywhere.
 

artyom.anon

FNG / Fresh Meat
Aug 25, 2014
12
0
0
Hi, guys. From a handful of tutorials I have seen so far, you need UCC.exe. My installation did not come with it. Any pointers where I can procure it? Thanks,

EDIT: Also, did anyone have a chance to look at documentation for basic objects used in KF? Stuff like their member variables, accessors for such, etc.
 
Last edited:

FluX

Grizzled Veteran
Oct 26, 2010
5,392
233
63
www.fluxiserver.co.uk
Hi, guys. From a handful of tutorials I have seen so far, you need UCC.exe. My installation did not come with it. Any pointers where I can procure it? Thanks,
Install the KF SDK in the steam TOOLS section.

EDIT: Also, did anyone have a chance to look at documentation for basic objects used in KF? Stuff like their member variables, accessors for such, etc.
There isn't anything for KF, sadly. It's quite easy to look through some extended files to see how things work. It's how I learnt.
 

artyom.anon

FNG / Fresh Meat
Aug 25, 2014
12
0
0
Yeah, I figured that out. Ive been searching the steam store for quite a while until I figured out I was in the wrong place... Thanks anyway though :)

Ah, thats quite unfortunate. Would be much much easier if there was some form of doc to read, rather then browse people's trial and error findings.
 

madfin

Member
Jun 30, 2014
95
0
6
Finland
You can use a dedicated server to build mutators as well.

How and will it work for Linux servers also :confused:

Is there something wrong with ucc.exe? I installed Steam SDK and tried to run make command but it says there is no such command.

ucc.png


I also copied files to .killingfloor/System/ folder and then ucc.exe help command worked, but no still no go for make command.

ucc2.png


Does it need more windows killing floor game files? If so could someone upload them somewhere?
 
Last edited:

madfin

Member
Jun 30, 2014
95
0
6
Finland
Maybe this is happening because you are using wine???
Use the Linux Dedicated Server... App ID 215360.

Internet says that ucc.exe compiling via wine has worked before. But i think it needs some windows kf game file with it. After i tried to run it in my Linux KF folder game would not start anymore. So it messed something in there and not just killingfloor.ini. I deleted whole System folder to get game starting again.

How is the compiling done with that server? I use this Linux kfserver script.

http://danielgibbs.co.uk/lgsm/kfserver/

Maybe i can do it with this one instead and not have to dl 2GB of unnecessary files?
 

madfin

Member
Jun 30, 2014
95
0
6
Finland
Well i downloaded Steam Linux server and all i found was ucc-bin file that is quite useless. AFAIK compile option was never added to Linux UCC. It is only on windows version.

ucc3.png


Maybe i have to dl whole win version of kf game?
 
Last edited:

madfin

Member
Jun 30, 2014
95
0
6
Finland
FFS. The windows Killing Floor was already installed when i installed windows Killing Floor SDK in wine :D

Copied SDK files in windows Killing Floor System folder and commanded wine ucc.exe make and it finally works :eek:
 

madfin

Member
Jun 30, 2014
95
0
6
Finland
I was too hasty to announce success when ucc.exe seemed to work. I have tried to compile those examples in the first post and others, but i always get this "error opening file" message.

Kuvakaappaus_Terminal.png


What file is that? Some file where it imports stuff to mutator? It can't be examplemutator.uc when it was already compiled and parsed?
 

Slie

FNG / Fresh Meat
Dec 16, 2010
270
5
0
Do you have access to create new files that way? I could be mistaken but I don't think it was able to write ExampleMutator.u to the disk.
 

madfin

Member
Jun 30, 2014
95
0
6
Finland
Do you have access to create new files that way? I could be mistaken but I don't think it was able to write ExampleMutator.u to the disk.

I don't think its that. Everybody has permissions to read/write in to that killing floor folder.