From 5b2788ac916e75b526e7ba1434213180444bc286 Mon Sep 17 00:00:00 2001 From: beppegoodoldrebel <69092966+beppegoodoldrebel@users.noreply.github.com> Date: Wed, 30 Jul 2025 12:12:33 +0200 Subject: [PATCH] Random SwatOfficer delays before entry This makes the Initiate action little bit random so Red and Blue squads are less perfectly synced. For example if they both throw a bang inside a room the bangs are exploding the exact same time... which is odd... with this they are exploding with little delay ... it feels more natural! --- .../Classes/Squads/Actions/SquadMoveAndClearAction.uc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Game/SwatAICommon/Classes/Squads/Actions/SquadMoveAndClearAction.uc b/Source/Game/SwatAICommon/Classes/Squads/Actions/SquadMoveAndClearAction.uc index d1bbd9f8..0e5f3acb 100644 --- a/Source/Game/SwatAICommon/Classes/Squads/Actions/SquadMoveAndClearAction.uc +++ b/Source/Game/SwatAICommon/Classes/Squads/Actions/SquadMoveAndClearAction.uc @@ -461,7 +461,9 @@ latent function OpenTargetDoor(Pawn Officer) // only open the door if it's closed and not broken if (CanInteractWithTargetDoor()) - { + { + sleep(FClamp(frand(), 0.0 , 0.3 )); // make AI less perfectly synced + ISwatDoor(TargetDoor).RegisterInterestedInDoorOpening(self); // have him open the door @@ -753,6 +755,8 @@ latent function ThrowGrenade() } else { + sleep(FClamp(frand(),0.0 , 0.5 ) ); // random wait to make Red and Blue AI less perfectly synced + // make sure the throw grenade goal exists assert(CurrentThrowGrenadeGoal != None); @@ -792,7 +796,7 @@ latent function FinishUpThrowBehavior() yield(); } - sleep(PostGrenadeThrowDelayTime); + sleep(PostGrenadeThrowDelayTime + FClamp(frand(),0.0 , 0.5 ) ); //random delay added to make Red and Blue AI less perfectly synced CurrentThrowGrenadeGoal.unPostGoal(self); CurrentThrowGrenadeGoal.Release();