From d746ca0a7da13bf83b015abb15714dfcbd8b804e Mon Sep 17 00:00:00 2001 From: Edo Date: Sat, 16 Jul 2022 15:40:10 +0200 Subject: [PATCH] Improvements to game scripts (#253) --- GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc | 9 +++++---- GameFiles/IW5/storage/iw5/scripts/_customcallbacks.gsc | 4 ++-- .../PT6/storage/t6/scripts/mp/_customcallbacks.gsc.src | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc b/GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc index 5d6e8649..86d9e57b 100644 --- a/GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc +++ b/GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc @@ -29,8 +29,9 @@ onPlayerConnect( player ) for( ;; ) { level waittill( "connected", player ); - player setClientDvar("cl_autorecord", 1); - player setClientDvar("cl_demosKeep", 200); + player setClientDvars( "cl_autorecord", 1, + "cl_demosKeep", 200 ); + player thread waitForFrameThread(); player thread waitForAttack(); } @@ -60,7 +61,7 @@ getHttpString( url ) runRadarUpdates() { - interval = int(getDvar("sv_printradar_updateinterval")); + interval = getDvarInt( "sv_printradar_updateinterval", 500 ); for ( ;; ) { @@ -191,7 +192,7 @@ waitForAdditionalAngles( logString, beforeFrameCount, afterFrameCount ) i++; } - lastAttack = int(getTime()) - int(self.lastAttackTime); + lastAttack = getTime() - self.lastAttackTime; isAlive = isAlive(self); logPrint(logString + ";" + anglesStr + ";" + isAlive + ";" + lastAttack + "\n" ); diff --git a/GameFiles/IW5/storage/iw5/scripts/_customcallbacks.gsc b/GameFiles/IW5/storage/iw5/scripts/_customcallbacks.gsc index 4647187d..82ad8004 100644 --- a/GameFiles/IW5/storage/iw5/scripts/_customcallbacks.gsc +++ b/GameFiles/IW5/storage/iw5/scripts/_customcallbacks.gsc @@ -53,7 +53,7 @@ waitForAttack() runRadarUpdates() { - interval = int(getDvar("sv_printradar_updateinterval")); + interval = getDvarInt( "sv_printradar_updateinterval", 500 ); for ( ;; ) { @@ -183,7 +183,7 @@ waitForAdditionalAngles( logString, beforeFrameCount, afterFrameCount ) i++; } - lastAttack = int(getTime()) - int(self.lastAttackTime); + lastAttack = getTime() - self.lastAttackTime; isAlive = isAlive(self); logPrint(logString + ";" + anglesStr + ";" + isAlive + ";" + lastAttack + "\n" ); diff --git a/GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc.src b/GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc.src index e0916d8c..8f49a93f 100644 --- a/GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc.src +++ b/GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc.src @@ -60,7 +60,7 @@ waitForAttack() runRadarUpdates() { - interval = int(getDvar("sv_printradar_updateinterval")); + interval = getDvarInt( "sv_printradar_updateinterval" ); for ( ;; ) { @@ -190,7 +190,7 @@ waitForAdditionalAngles( logString, beforeFrameCount, afterFrameCount ) i++; } - lastAttack = int(getTime()) - int(self.lastAttackTime); + lastAttack = getTime() - self.lastAttackTime; isAlive = isAlive(self); logPrint(logString + ";" + anglesStr + ";" + isAlive + ";" + lastAttack + "\n" );