KF KFWeaponPickup

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

colop

FNG / Fresh Meat
Aug 23, 2012
12
0
0
Hello!

KFWeaponPickup replace a own Weaponpickup?

This possible?

Thanks!:D
 

colop

FNG / Fresh Meat
Aug 23, 2012
12
0
0
The Killing Floor Do not use the original file KFWeaponPickup.uc file
mine use

You understand?

Sorry My English
 

colop

FNG / Fresh Meat
Aug 23, 2012
12
0
0
one example here: D

class AA12Pickup extends KFWeaponPickup;

class KFWeaponPickup extends NewKFWeaponPickup;


NewKFWeaponPickup <-- this is the original and the
KFWeaponPickup own!!

understand?:D
 

colop

FNG / Fresh Meat
Aug 23, 2012
12
0
0
so as not having to the all weapons
change this part : extends KFWeaponPickup;
 

scary ghost

FNG / Fresh Meat
Sep 13, 2010
900
338
0
California
one example here: D

class AA12Pickup extends KFWeaponPickup;

class KFWeaponPickup extends NewKFWeaponPickup;


NewKFWeaponPickup <-- this is the original and the
KFWeaponPickup own!!

understand?:D

so as not having to the all weapons
change this part : extends KFWeaponPickup;

Unfortunately you can't do it like that. AA12Pickup will find KFWeaponPickup within its own package first. In other words writing

Code:
class AA12Pickup extends KFWeaponPickup
is really the same as

Code:
class AA12Pickup extends [COLOR=DarkOrange]KFMod[/COLOR].KFWeaponPickup
because both classes are a part of the KFMod package.
 

colop

FNG / Fresh Meat
Aug 23, 2012
12
0
0
Ok Thanks!!

And I have this code!
I'm sorry I do not know how to code to insert


var float LastUseMeMsgTime;
var string UseMeMessage;

auto state pickup
{
function BeginState()
{
UntriggerEvent(Event, self, None);
if ( bDropped )
{
AddToNavigation();
SetTimer(20, false);
}
}

function Touch( actor Other )
{
if(!ValidTouch(Other))
{
return;
}

if(Pawn(Other) != none && PlayerController(Pawn(Other).Controller) != none && Level.TimeSeconds - LastUseMeMsgTime > 4.f)
{
LastUseMeMsgTime = Level.TimeSeconds;
PlayerController(Pawn(Other).Controller).ClientMessage(UseMeMessage, 'KFCriticalEvent');
}
}
}

function bool ValidTouch( actor Other )
{

if ( KFHumanPawn(Other) != none && !CheckCanCarry(KFHumanPawn(Other)) )
{
PlayerController(Pawn(Other).Controller).ReceiveLocalizedMessage(Class'KFMainMessages', 4);
return false;
}

return true;
}

function UsedBy( Pawn user)
{
local Inventory Copy;
local KFWeaponPickup P,Closest;
local float Dist,ClosestDist;



foreach User.TouchingActors(class 'KFWeaponPickup', P)
{
Dist = VSizeSquared(P.Location - Location);
if(ClosestDist == 0 || Dist < ClosestDist)
{
ClosestDist = Dist;
Closest = P;
}
}


if( Closest == self && ValidTouch(user) )
{
Copy = SpawnCopy(user);
AnnouncePickup(user);
SetRespawn();
if ( Copy != None )
Copy.PickupFunction(user);

TriggerEvent(Event, self, user);
}
}

defaultproperties
{
UseMeMessage="Press USE key to Pick up"
}

you have to push the button to pick up the gun

But I want it everyone can just pick up with own weapon

this is understandable?:p
 
Last edited:

Marco

Active member
May 23, 2009
644
232
43
Finland
Piece of cake. All you need to do is to use GameRules to prevent touching pickup of weapons, and replace playercontroller to override 'Use' code to pick up weapons.
But do not ask me how to write that, because I am not going to waste my time on this.
 

colop

FNG / Fresh Meat
Aug 23, 2012
12
0
0
I do not understand!
Trouble that here felttem this code or what ?:D

And thanks for the answer: D
 
Nov 11, 2013
77
1
8
Piece of cake. All you need to do is to use GameRules to prevent touching pickup of weapons, and replace playercontroller to override 'Use' code to pick up weapons.
But do not ask me how to write that, because I am not going to waste my time on this.


In response to http://forums.tripwireinteractive.com/showthread.php?p=1413132#post1413132

Is Marco still around to potentially elaborate on this?

Is it as simple as changing a line of code or are we talking a huge script.

All we want is a freaking mutator that allows you to press use to pick up a weapon.