• 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 Removing all start weapons

StuKKa

Grizzled Veteran
Mar 20, 2010
65
10
Hi there,
I know there was a way to remove all weapons and items from a player. But i couldn't find something on the forum. Is there a way to let the players start without any weapon? I think it should be done in the PostBeginPlay() function. Could someone please help?
 
I have seen this on a mutator somewhere, but i don't find it. The reason for this is, that i don't want some perks start with some of the weapons (i.e. Welder, because they get thermit or something else)...
And there it worked....i think i knew that it was only one line of code.....but i couldn't remember that.....one line stops all player from loading the default equipment....
 
Upvote 0
well, yes i know that now, thats why i suggested looking in the kfsp classes
maybe its in here somewhere:
// Story Mode Specific Variables

var KFSPLevelInfo SPInfo; // The reigning Level Info

var bool bDefKFEquips; // Sets whether pawns spawn with regular gear or not. (KFSP)
var int PlayerStartingHealth; // The starting amount of Hitpoints for all players.
var int PlayerStartingArmor;

var bool bPlayedIntro;

var KFTeamProgressVolume SpawnVolume;

function LoadUpMonsterList();

event PostNetBeginPlay()
{
local KFSPLevelInfo LI;

foreach AllActors(class'KFSPLevelInfo',LI)
{
if (LI != none)
SPInfo = LI;
}

if(SPInfo != none)
KFGameReplicationInfo(GameReplicationInfo).bHUDShowCash = SPInfo.bHUDShowCash;
}

function OverrideInitialBots()
{
InitialBots = 0;
}

function bool TooManyBots(Controller botToRemove)
{
return true;
}

function AddDefaultInventory( pawn PlayerPawn )
{
if (SPInfo != none)
if ( KFHumanPawn(PlayerPawn) != None )
KFHumanPawn(PlayerPawn).AddDefaultInventory();

SetPlayerDefaults(PlayerPawn);
}

function RestartPlayer( Controller aPlayer )
{
Super(gameinfo).RestartPlayer(aPlayer);
if( aPlayer.Pawn!=None && SPInfo!=none )
SPInfo.ModifyPlayer(aPlayer.Pawn);
}
function AddGameSpecificInventory(Pawn p)
{
if( SPInfo!=none )
SPInfo.AddGameInv(p);
}

function ForceAddBot();

function InitPlacedBot(Controller C, RosterEntry R){}

function InitializeBot(Bot NewBot, UnrealTeamInfo BotTeam, RosterEntry Chosen);

function bool AddBot(optional string botName)
{
return false;
}

exec function AddBots(int num);

function Bot SpawnBot(optional string botName)
{
Return None;
}

event PlayerController Login( string Portal, string Options, out string Error )
{
local PlayerController NewPlayer;
local Controller C;
local bool bTempLate;

bTempLate = bNoLateJoiners;
bNoLateJoiners = False;
NewPlayer = Super.Login(Portal,Options,Error);
bNoLateJoiners = bTempLate;

for ( C=Level.ControllerList; C!=None; C=C.NextController )
if ( (C.PlayerReplicationInfo != None) && C.PlayerReplicationInfo.bOutOfLives && !C.PlayerReplicationInfo.bOnlySpectator && !GameReplicationInfo.bMatchHasBegun )
{
NewPlayer.PlayerReplicationInfo.bOutOfLives = true;
NewPlayer.PlayerReplicationInfo.NumLives = 1;
Break;
}

NewPlayer.SetGRI(GameReplicationInfo);

if ( bDelayedStart ) //!
{
NewPlayer.GotoState('PlayerWaiting');
return NewPlayer;
}
return NewPlayer;

}

event KFSceneEnded( KFSceneManager SM, Actor Other )
{
GotoState('MatchInProgress');
}

/* cinematic started... */
event KFSceneStarted( KFSceneManager SM, Actor Other )
{
if ( Other != None && Other.IsA('KFSceneManager') )
GotoState('MPOutroCinematic');
}

/* network friendly outro */
state MPOutroCinematic
{
}

function bool IsPlayingIntro()
{
return false;
}

State MatchInProgress
{
function beginstate()
{
if (!bPlayedIntro)
{
TriggerEvent('IntroScene', Self, None); // try to play Matinee intro
bPlayedIntro = true;
 
Upvote 0