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

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.
 
Upvote 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:
Upvote 0
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.
 
Upvote 0