From 26517d87298d9393dbba1a0b711288d0278e2859 Mon Sep 17 00:00:00 2001 From: ineed bots Date: Sat, 26 Sep 2026 11:57:28 -0600 Subject: [PATCH] built ins --- maps/mp/bots/_bot_internal.gsc | 4 +-- maps/mp/bots/_bot_utility.gsc | 42 +++++++++++++--------- scripts/mp/bots_adapter_znation_libcod.gsc | 12 +++++++ 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/maps/mp/bots/_bot_internal.gsc b/maps/mp/bots/_bot_internal.gsc index 2769bd8..b54eb06 100644 --- a/maps/mp/bots/_bot_internal.gsc +++ b/maps/mp/bots/_bot_internal.gsc @@ -242,7 +242,7 @@ doBotMovement_loop( data ) } // climb through windows - if ( self isMantling() ) + if ( self BotBuiltinIsMantling() ) { data.wasmantling = true; self crouch(); @@ -262,7 +262,7 @@ doBotMovement_loop( data ) // check if need to jump bt = bullettrace( startPosForward, startPosForward - ( 0, 0, 40 ), false, self ); - if ( bt[ "fraction" ] < 1 && bt[ "normal" ][ 2 ] > 0.9 && data.i > 1.5 && !self isOnLadder() ) + if ( bt[ "fraction" ] < 1 && bt[ "normal" ][ 2 ] > 0.9 && data.i > 1.5 && !self BotBuiltinIsOnLadder() ) { data.i = 0; self thread jump(); diff --git a/maps/mp/bots/_bot_utility.gsc b/maps/mp/bots/_bot_utility.gsc index 85a9fbf..33d6695 100644 --- a/maps/mp/bots/_bot_utility.gsc +++ b/maps/mp/bots/_bot_utility.gsc @@ -111,6 +111,32 @@ BotBuiltinBotWeapon( weapon ) } } +/* + Test +*/ +BotBuiltinIsMantling() +{ + if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "ismantling" ] ) ) + { + return self [[ level.bot_builtins[ "ismantling" ] ]](); + } + + return false; +} + +/* + Test +*/ +BotBuiltinIsOnLadder() +{ + if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "isonladder" ] ) ) + { + return self [[ level.bot_builtins[ "isonladder" ] ]](); + } + + return false; +} + /* Returns if player is the host */ @@ -559,22 +585,6 @@ isSecondaryGrenade( nade ) return issubstr( nade, "smoke_grenade_" ); } -/* - CoD2 -*/ -isMantling() -{ - return false; -} - -/* - CoD2 -*/ -isOnLadder() -{ - return false; -} - /* CoD2 */ diff --git a/scripts/mp/bots_adapter_znation_libcod.gsc b/scripts/mp/bots_adapter_znation_libcod.gsc index 4998215..e35b888 100644 --- a/scripts/mp/bots_adapter_znation_libcod.gsc +++ b/scripts/mp/bots_adapter_znation_libcod.gsc @@ -7,6 +7,8 @@ init() level.bot_builtins[ "isbot" ] = ::do_isbot; level.bot_builtins[ "botangles" ] = ::do_botangles; level.bot_builtins[ "botweapon" ] = ::do_botweapon; + level.bot_builtins[ "isonladder" ] = ::do_isonladder; + level.bot_builtins[ "ismantling" ] = ::do_ismantling; } do_printconsole( s ) @@ -178,3 +180,13 @@ do_botweapon( weapon ) // self switchtoweapon( weapon ); } + +do_ismantling() +{ + return self ismantling(); +} + +do_isonladder() +{ + return self isonladder(); +}