here it is..
O.k here's the code:
function Bot SpawnBot(out NavigationPoint StartSpot)
{
local bot NewBot;
local int BotN;
local Pawn P;
local class<bot> BotSpawnClass;
local Float F;
if ( bRatedGame )
return SpawnRatedBot(StartSpot);
Difficulty = BotConfig.Difficulty;
if ( Difficulty >= 4 )
{
bNoviceMode = false;
Difficulty = Difficulty - 4;
}
else
{
if ( Difficulty > 3 )
{
Difficulty = 3;
bThreePlus = true;
}
bNoviceMode = true;
}
BotN = BotConfig.ChooseBotInfo();
StartSpot = FindPlayerStart(None, 255);
if( StartSpot == None )
{
log("Could not find starting spot for Bot");
return None;
}
BotSpawnClass = class'JWF_Bot';
NewBot = Spawn(BotSpawnClass,,,StartSpot.Location,StartSpot.Rotation);
if ( NewBot == None )
log("Couldn't spawn player at "$StartSpot);
if ( (bHumansOnly || Level.bHumansOnly) && !NewBot.bIsHuman )
{
log("can't add non-human bot to this game");
NewBot.Destroy();
NewBot = None;
}
if ( NewBot == None )
{
NewBot = Spawn(BotSpawnClass,,,StartSpot.Location,StartSpot.Rotation);
}
if ( NewBot != None )
{
// Set the player's ID.
NewBot.PlayerReplicationInfo.PlayerID = CurrentID++;
NewBot.PlayerReplicationInfo.Team = BotConfig.GetBotTeam(BotN);
BotConfig.CHIndividualize(NewBot, BotN, NumBots);
NewBot.ViewRotation = StartSpot.Rotation;
// broadcast a welcome message.
BroadcastMessage( NewBot.PlayerReplicationInfo.PlayerName$EnteredMessage, false );
ModifyBehaviour(NewBot);
AddDefaultInventory( NewBot );
NumBots++;
if ( bRequireReady && (CountDown > 0) )
NewBot.GotoState('Dying', 'WaitingForStart');
NewBot.AirControl = AirControl;
if ( (Level.NetMode != NM_Standalone) && (bNetReady || bRequireReady) )
{
// replicate skins
for ( P=Level.PawnList; P!=None; P=P.NextPawn )
if ( P.bIsPlayer && (P.PlayerReplicationInfo != None) &&
P.PlayerReplicationInfo.bWaitingPlayer && P.IsA('PlayerPawn') )
{
if ( NewBot.bIsMultiSkinned )
PlayerPawn(P).ClientReplicateSkins(NewBot.MultiSkins[0], NewBot.MultiSkins[1], NewBot.MultiSkins[2], NewBot.MultiSkins[3]);
else
PlayerPawn(P).ClientReplicateSkins(NewBot.Skin);
}
}
}
what do you reckon?