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

Code [Help] Other ways to Load a Custom Perk into game?

Josko

Grizzled Veteran
Nov 2, 2012
107
0
I've made my own perk, and I have been able to load it into game in Solo Mode just fine with the code:

Code:
KFGameType(Level.Game).default.LoadedSkills[6] = class'PackageNameHere.CustomKFVetDemolitions';

However, that does not work in multiplayer on my server.

So I'm trying to find different ways to load my 'CustomKFVetDemolitions ' class like with the code I used to load my ' CustomKFRandomItemSpawn ' class which worked perfectly online,

but when I did the same with my custom perk class, it did not even work in Solo.

The code:

Code:
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
local Vector SpawnLoc;
 
if ( Other.Class == class'KFRandomItemSpawn' )
 {
 SpawnLoc = Other.Location;
 Other.Destroy();
 Spawn(class'CustomRandomItemSpawn',,,SpawnLoc);
 return true;
 }
 
 else if ( Other.Class == class'KFVetDemolitions' )
 {
 SpawnLoc = Other.Location;
 Other.Destroy();
 Spawn(class'CustomKFVetDemolitions',,,SpawnLoc);
 return true;
 }
 
return Super.CheckReplacement(Other,bSuperRelevant);
}

I don't see anything wrong with the code, it should work like it did with my custom RandomItemSpawn class, but it dosn't.

Is there any other ways I could try?
 
It wont work. You would have to do it in the PostBegin (?) function and set it as the old one as your new one.
Dont disinformate people. Abstract class cannot be instantiated, you cannot spawn Actor with type 'KFVetDemolitions'.

To replace veterancy, author need to change it in .ini-file of ServerPerks Mutator, or use mutator for replacing perks, idk it's name.
 
Upvote 0
hello

hello

I've made my own perk, and I have been able to load it into game in Solo Mode just fine with the code:

Code:
KFGameType(Level.Game).default.LoadedSkills[6] = class'PackageNameHere.CustomKFVetDemolitions';
However, that does not work in multiplayer on my server.

So I'm trying to find different ways to load my 'CustomKFVetDemolitions ' class like with the code I used to load my ' CustomKFRandomItemSpawn ' class which worked perfectly online,

but when I did the same with my custom perk class, it did not even work in Solo.

The code:

Code:
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
local Vector SpawnLoc;
 
if ( Other.Class == class'KFRandomItemSpawn' )
 {
 SpawnLoc = Other.Location;
 Other.Destroy();
 Spawn(class'CustomRandomItemSpawn',,,SpawnLoc);
 return true;
 }
 
 else if ( Other.Class == class'KFVetDemolitions' )
 {
 SpawnLoc = Other.Location;
 Other.Destroy();
 Spawn(class'CustomKFVetDemolitions',,,SpawnLoc);
 return true;
 }
 
return Super.CheckReplacement(Other,bSuperRelevant);
}
I don't see anything wrong with the code, it should work like it did with my custom RandomItemSpawn class, but it dosn't.

Is there any other ways I could try?
In the server GUI type in "/gamemode (playername) #" Don't put the () where it says playername, just put the player's name. Where the # is, you put either a 0 (survival) or a 1 (creative).
 
Upvote 0
Dont disinformate people. Abstract class cannot be instantiated, you cannot spawn Actor with type 'KFVetDemolitions'.

To replace veterancy, author need to change it in .ini-file of ServerPerks Mutator, or use mutator for replacing perks, idk it's name.
I was not meaning that bad in any way. I think you misread what I put. I gave a solution to getting it to work (what I think will work).
 
Upvote 0
Abstract class cannot be instantiated, you cannot spawn Actor with type 'KFVetDemolitions'.

To replace veterancy, author need to change it in .ini-file of ServerPerks Mutator, or use mutator for replacing perks, idk it's name.


I don't want to use ServerPerks, I hate it, it makes so everyone who joins starts with lvl 0 on all perks. It's horrible.

And I don't want to use any other mutator to replace a perk with my own custom perk, I don't want to be dependent on that or those mutators.

There must be some code to replace a veterancy class like KFVetDemolitions so it can be all in one package like all my stuff is already.

If you think (or know) that you have(or know) a solution, please be a little more detailed since I'm new at this :p

It would be greatly appreciated!
 
Upvote 0
Check some of the weapons releases, iirc one of them came with a mutator to add a custom perk so the weapon was perked.

Thanks, I'll do that! :)

Either way, using anything will greylist your server so people people wont be
able to progress there perks anyway

My server is already greylisted and I don't care about that since all my perks are lvl6.

I don't care if people won't level up, they never notice it anyway.

If they want to level up, they can go to a whitelisted server and then come back the the fun server! ( Mine that is. )

why not just use serverperks and have the
minimum perk level of lvl 6?

Then everybody will be lvl6 which is not what I like or want, that's just wrong. That would be almost like giving every player the best gun when they spawn.

Sorry, Really don't like that :p
But I'll check the code on other weapon releases and see what I find. Thanks!
 
Upvote 0