Thanks in advance.

Bots are always forcefully respawned. The "force respawn" setting in UT only applies to human players because in this case the respawn may be dependent on the player's input to do so.gamer13 wrote:Is there maybe a way to apply "forced respawn" on bots. Because it seems like it only applies to human players. Or am I thinking of the concept of "forced respawn" wrong.
Thanks, more will come later on.gamer13 wrote: By the way, I really liked your tutorial Ferali.
Very nice tutorials I must say. Thanks for the contributiongamer13 wrote: A little side note; here are my video tutorials on YouTube on 3D art.
Huh ? Do you still think that I'm talking crap ? Okay, then let's see something else...Bot wrote: CampTime = FMin(5, InventorySpot(MoveTarget).markedItem.LatentFloat + 0.5);
Code: Select all
void APawn::execStopWaiting( FFrame& Stack, RESULT_DECL )
{
guardSlow(APawn::execStopWaiting);
P_FINISH;
if( GetStateFrame()->LatentAction == EPOLL_Sleep )
LatentFloat = -1.0;
unguardSlow;
}
Code: Select all
class InstantRespawnBots expands Mutator config(InstantRespawnBots2);
var config float MinTimeBetweenSpawns;
struct PlayerRespawnHistory{
var int PlayerId;
var float LastRespawnTime;
};
var PlayerRespawnHistory RespawnHistory[255];
function updatePlayerSpawnTime(Pawn Other){
local int PlayerId;
local int i;
PlayerId = Other.PlayerReplicationInfo.PlayerId;
for(i = 0; i < 255; i++){
if(RespawnHistory[i].PlayerId == PlayerId){
RespawnHistory[i].LastRespawnTime = Level.TimeSeconds;
return;
}else{
if(i != 0){
if(RespawnHistory[i].PlayerId == 0){
RespawnHistory[i].PlayerId = PlayerId;
RespawnHistory[i].LastRespawnTime = Level.TimeSeconds;
return;
}
}
}
}
}
function float GetLastSpawnTime(int PlayerId){
local int i;
for(i = 0; i < 255; i++){
if(RespawnHistory[i].PlayerId == i){
return RespawnHistory[i].LastRespawnTime;
}
}
return 0;
}
function bool PreventDeath(Pawn Killed, Pawn Killer, name damageType, vector HitLocation)
{
local float LastSpawnTime;
local float Delta;
local bool bPrevent;
bPrevent = false;
if(Killed.PlayerReplicationInfo != None){
LastSpawnTime = GetLastSpawnTime(Killed.PlayerReplicationInfo.PlayerId);
Delta = Level.TimeSeconds - LastSpawnTime;
if(Delta >= MinTimeBetweenSpawns){
Level.Game.Killed(Killer, Killed, damageType);
Level.Game.DiscardInventory(Killed);
Level.Game.RestartPlayer(Killed);
updatePlayerSpawnTime(Killed);
bPrevent = true;
}
}
//if ( NextMutator != None )
//return NextMutator.PreventDeath(Killed,Killer, damageType,HitLocation);
return bPrevent;
}
Thank you for the attached file. (InstantRespawnBots2.zip)UT Sniper (SJA94) wrote: ↑Tue Oct 18, 2022 9:29 am I made(I think you or someone else helped) a small mutator a while ago to make bots respawn instantly(or with a min time, to stop crazy amount of telefrags), to mess around on my server/offline, it's not a great way of doing it but it is fun to play maps with 100s of bots at the same time, or even just a full 16 being active the whole time.
InstantRespawnBots2.zip
Code: Select all
class InstantRespawnBots expands Mutator config(InstantRespawnBots2); var config float MinTimeBetweenSpawns; struct PlayerRespawnHistory{ var int PlayerId; var float LastRespawnTime; }; var PlayerRespawnHistory RespawnHistory[255]; function updatePlayerSpawnTime(Pawn Other){ local int PlayerId; local int i; PlayerId = Other.PlayerReplicationInfo.PlayerId; for(i = 0; i < 255; i++){ if(RespawnHistory[i].PlayerId == PlayerId){ RespawnHistory[i].LastRespawnTime = Level.TimeSeconds; return; }else{ if(i != 0){ if(RespawnHistory[i].PlayerId == 0){ RespawnHistory[i].PlayerId = PlayerId; RespawnHistory[i].LastRespawnTime = Level.TimeSeconds; return; } } } } } function float GetLastSpawnTime(int PlayerId){ local int i; for(i = 0; i < 255; i++){ if(RespawnHistory[i].PlayerId == i){ return RespawnHistory[i].LastRespawnTime; } } return 0; } function bool PreventDeath(Pawn Killed, Pawn Killer, name damageType, vector HitLocation) { local float LastSpawnTime; local float Delta; local bool bPrevent; bPrevent = false; if(Killed.PlayerReplicationInfo != None){ LastSpawnTime = GetLastSpawnTime(Killed.PlayerReplicationInfo.PlayerId); Delta = Level.TimeSeconds - LastSpawnTime; if(Delta >= MinTimeBetweenSpawns){ Level.Game.Killed(Killer, Killed, damageType); Level.Game.DiscardInventory(Killed); Level.Game.RestartPlayer(Killed); updatePlayerSpawnTime(Killed); bPrevent = true; } } //if ( NextMutator != None ) //return NextMutator.PreventDeath(Killed,Killer, damageType,HitLocation); return bPrevent; }