more funcs

This commit is contained in:
ineed bots 2025-01-15 00:58:51 -06:00
parent 232938dfd7
commit 9cbff651ce
3 changed files with 59 additions and 6 deletions

View File

@ -49,6 +49,26 @@ BotBuiltinPrintConsole( s )
}
}
/*
*/
BotBuiltinReplaceFunc( s, b )
{
if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "replacefunc" ] ) )
{
return [[ level.bot_builtins[ "replacefunc" ] ]]( s, b );
}
}
/*
*/
BotBuiltinGetFunction( s, b )
{
if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "getfunction" ] ) )
{
return [[ level.bot_builtins[ "getfunction" ] ]]( s, b );
}
}
/*
*/
BotBuiltinClearOverride( a )

View File

@ -11,19 +11,39 @@
#include maps\mp\bots\_bot_utility;
/*
Entry point to the bots
*/
init()
main()
{
level.bw_version = "1.2.0";
level.bot_offline = false;
if ( getdvar( "bots_main" ) == "" )
{
setdvar( "bots_main", true );
}
if ( !getdvarint( "bots_main" ) )
{
return;
}
if ( !wait_for_builtins() )
{
println( "FATAL: NO BUILT-INS FOR BOTS" );
}
}
/*
Entry point to the bots
*/
init()
{
level.bw_version = "1.2.0";
if ( getdvar( "bots_main" ) == "" )
{
setdvar( "bots_main", true );
}
if ( !getdvarint( "bots_main" ) )
{
return;

View File

@ -1,4 +1,4 @@
init()
main()
{
level.bot_builtins[ "printconsole" ] = ::do_printconsole;
level.bot_builtins[ "botmovementoverride" ] = ::do_botmovementoverride;
@ -8,6 +8,19 @@ init()
level.bot_builtins[ "botweaponoverride" ] = ::do_botweaponoverride;
level.bot_builtins[ "botaimoverride" ] = ::do_botaimoverride;
level.bot_builtins[ "botmeleeparamsoverride" ] = ::do_botmeleeparamsoverride;
level.bot_builtins[ "replacefunc" ] = ::do_replacefunc;
level.bot_builtins[ "getfunction" ] = ::do_getfunction;
maps\mp\gametypes\_bot::main();
}
do_replacefunc( a, b )
{
return replacefunc( a, b );
}
do_getfunction( a, b )
{
return getfunction( a, b );
}
do_printconsole( s )