[weapon] Putting your weapon in trader?

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

gamemann

FNG / Fresh Meat
Apr 25, 2010
128
12
0
Mullica Hill, New Jersey
GFLClan.com
Hello i searched all around the forum and couldn't find the code for putting your own weapon in the trader? I am trying to put my new weapons in the trader but whenever i go to the trader, they're not there :(
I attached one weapon i made to this thread and check it out and please tell me how to get my weapons into the trader?

BY THE WAY: I made my own mod folder for this!
thanks,
gamemann
 

Attachments

  • killingfloortraderquestion.zip
    13.6 KB · Views: 0
Last edited:

-=Ivan=-

FNG / Fresh Meat
Oct 27, 2009
235
105
0
I think first of all you have to make a mutator, in the main Mutator script add:
var() config bool bReplaceShopWeps;


function PostBeginPlay()
{

if( bReplaceShopWeps )
SetTimer(0.1,false);

}

function Timer()
{
local KFGameType KF;


KF = KFGameType(Level.Game);
if ( KF!=None )
{
if( KF.KFLRules!=None )
KF.KFLRules.Destroy();
KF.KFLRules = Spawn(class'KFMyLevelRules');

}

}
defaultproperties
{
bReplaceShopWeps=True
GroupName="Sniper"
bAddToServerPackages=True
FriendlyName="Sniper"
Description="..."
bAlwaysRelevant=True
RemoteRole=ROLE_SimulatedProxy
}
Then create the KFMyLevelRules:
class KFMyLevelRules extends KFLevelRules;


defaultproperties
{
ItemForSale(28)=Class'YourPackage.YourWeaponPickup'
}

hope this helps
 

YoYoBatty

FNG / Fresh Meat
Dec 17, 2009
3,460
2,502
0
Canada
I think first of all you have to make a mutator, in the main Mutator script add:
Then create the KFMyLevelRules:


hope this helps

You don't have to added the bool variable, take it out it's useless.


Code:
function PostBeginPlay()
{
 
SetTimer(0.1,false);
}
 
function Timer()
{
local KFGameType KF;
 
 
KF = KFGameType(Level.Game);
if ( KF!=None )
{
if( KF.KFLRules!=None )
KF.KFLRules.Destroy();
KF.KFLRules = Spawn(class'KFMyLevelRules');
 
}
 
}
defaultproperties
{
GroupName="Sniper"
bAddToServerPackages=True
FriendlyName="Sniper"
Description="..."
bAlwaysRelevant=True
RemoteRole=ROLE_SimulatedProxy
}
 
Last edited:

gamemann

FNG / Fresh Meat
Apr 25, 2010
128
12
0
Mullica Hill, New Jersey
GFLClan.com

gamemann

FNG / Fresh Meat
Apr 25, 2010
128
12
0
Mullica Hill, New Jersey
GFLClan.com
I think first of all you have to make a mutator, in the main Mutator script add:
Then create the KFMyLevelRules:


hope this helps
ok i think this is how it works but since i am not good at killing floor modding i have to ask this question: DO i have to make a whole new folder like KFSniper then put Classes folder in there then put all of that?
 

gamemann

FNG / Fresh Meat
Apr 25, 2010
128
12
0
Mullica Hill, New Jersey
GFLClan.com
i just did but new problems... When i try to compile my other weapon heres what happens...
errors:
SwordMutator.uc error<6> bad or missing expression in If

Here is the code:
Code:
class SwordMutator extends Mutator;

function PostBeginPlay()
{

if( bReplaceShopWeps )
SetTimer(0.1,false);

}

function Timer()
{
local KFGameType KF;


KF = KFGameType(Level.Game);
if ( KF!=None )
{
if( KF.KFLRules!=None )
KF.KFLRules.Destroy();
KF.KFLRules = Spawn(class'KFMyLevelRules');

}

}
defaultproperties
{
bReplaceShopWeps=True
GroupName="Sword"
bAddToServerPackages=True
FriendlyName="Sword"
Description="Add the Sword to the game"
bAlwaysRelevant=True
RemoteRole=ROLE_SimulatedProxy
}
 

braindead

FNG / Fresh Meat
Aug 22, 2009
918
346
0
Merry Ol' England
it doesnt work, when i go by a weapon nothing ends up on the list, not even regular weapons!

Hey Gamemann

Did you put all 3 files into your System directory?
.u
.ucl
and .ini

When you click on the edit button you should have all of the standard KF weapons listed?
If you go right to the end and click on the down arrow, you will get the add button to add your new weapon?

If you continue with the mut you are making, any weapons you make after this you will not be able to use together because each mutator will create a new KFLevelRules and there can only be one per game. My mut was supposed to negate that issue.
 

gamemann

FNG / Fresh Meat
Apr 25, 2010
128
12
0
Mullica Hill, New Jersey
GFLClan.com
Hey Gamemann

Did you put all 3 files into your System directory?
.u
.ucl
and .ini

When you click on the edit button you should have all of the standard KF weapons listed?
If you go right to the end and click on the down arrow, you will get the add button to add your new weapon?

If you continue with the mut you are making, any weapons you make after this you will not be able to use together because each mutator will create a new KFLevelRules and there can only be one per game. My mut was supposed to negate that issue.
Okay i think you know what i am saying but ill explain it again just to make sure(because i didnt do good in explaining it :p : when i go buy a weapon at the trader and at the right where you buy a weapon there was nothing there! and yes i did copy all the files into system folder!
 

YoYoBatty

FNG / Fresh Meat
Dec 17, 2009
3,460
2,502
0
Canada
I said use this code:
function PostBeginPlay()
{

SetTimer(0.1,false);
}

function Timer()
{
local KFGameType KF;


KF = KFGameType(Level.Game);
if ( KF!=None )
{
if( KF.KFLRules!=None )
KF.KFLRules.Destroy();
KF.KFLRules = Spawn(class'KFMyLevelRules');

}

}
defaultproperties
{
GroupName="Sniper"
bAddToServerPackages=True
FriendlyName="Sniper"
Description="..."
bAlwaysRelevant=True
RemoteRole=ROLE_SimulatedProxy
}
 

Benjamin

Grizzled Veteran
May 17, 2009
3,650
635
113
France
It's not necessary (nor recommended) to use your own KFLevelRules class, just modify the instance of the existing one in the mutator's PostBeginPlay function.
 
  • Like
Reactions: Olivier

gamemann

FNG / Fresh Meat
Apr 25, 2010
128
12
0
Mullica Hill, New Jersey
GFLClan.com
It's not necessary (nor recommended) to use your own KFLevelRules class, just modify the instance of the existing one in the mutator's PostBeginPlay function.
k thx! Ok new problem though(not with weapons thing) but this is way off topic of this topic, its a crash but i dont want to create a new topic on it. I get this critical error everytime i play the game, it happens at anytime.
Code:
 Build UT2004_Build_[2004-11-11_10.48]

OS: Windows NT 6.1 (Build: 7600)
CPU: GenuineIntel PentiumPro-class processor @ 3203 MHz with 2047MB RAM
Video: NVIDIA GeForce GTS 250 (6099)

General protection fault!

History: SkeletalMeshGet <- USpriteEmitter::UpdateParticles <- AEmitter::Tick <- TickAllActors <- ULevel::Tick <- (NetMode=0) <- TickLevel <- UGameEngine::Tick <- Level KF-NewJerseyLab(V1) <- UpdateWorld <- MainLoop <- FMallocWindows::Free <- FMallocWindows::Realloc <- 4C576C61 0 FArray <- FArray::Realloc <- 0*2 <- FMallocWindows::Free
I did change speeds of zombies in kfmods folder and health too if that could do any damage but it was going good until i put sandbox on and put it so zombies spawn more quikly and more amount of zombies spawn at a time but i never had a problem with it!
Please help!

ALSO: it says my processor is: GenuineIntel PentiumPro-class processor BUT ITS REALLY intel core 2 duo E8200 at 2.66 ghz
thanks,
gamemann
 
Last edited: