How would someone go about taking a stock weapon in the game and have the player's spawn with it?
Upvote
0
Here you go, the code I use for my weapons.How would someone go about taking a stock weapon in the game and have the player's spawn with it?
//=============================================================================
// 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"
}
// 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'));
}
Install the KF SDK in the steam TOOLS section.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,
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.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.
You can use a dedicated server to build mutators as well.
Maybe this is happening because you are using wine???
Use the Linux Dedicated Server... App ID 215360.
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.
Hi, do you have an example of how one can do this? I am struggling with this as well. I am just trying to change groundspeed for the playerActually, it's simply a matter of not adding a particular line of code:
Code:bAddToServerPackages=true
And also don't manually add it to server packages either!
Yes, since the server decides the attributes of the specimens you can alter these attributes just on the server and the changes will be replicated to clients. However, you have to do more than just alter defaultproperties. You see, the problem is that both the server and the client have their own copy of these attributes, and changes to the default values are not replicated, meaning if you change the default GroundSpeed variable on the server, the client will still think it's the original. You'll instead want to change the variables of each specimen as they spawn, which you can do by implementing the CheckReplacement function:
Code:function bool CheckReplacement(Actor Other, out byte bSuperRelevant) { if (ZombieClot(Other) != None) { ZombieClot(Other).GroundSpeed = 10; } return Super.CheckReplacement(Other, bSuperRelevant); }
However, there's another problem. Certain variable defaults are used during gameplay, which will reset sometimes (for instance uncrouching resets GroundSpeed to the default). I'd suggest that for such variables you simply set the default properties on both the server and the client.