Hole-Bot Hooks
This is an overhaul of Bot_Holes's AIPlayer::hLoop that aims to make holebots much more extensible while retaining compatibility with current holebot mods.
It does this by breaking up the components of hLoop (player searching, brick "pathing", etc.) into many functions, which check the bot's datablock and armor for hook variables that specify if the function is to be overridden, or disabled. If a hook variable is set to 0 or doesn't exist, the default behavior will be used.
Examples:
//
// Hooking a bot so it sends a chat message instead of pathing its way to a brick.
//
function botTalk(%obj)
{
talk("Hello, World!");
}
// Datablock Physician Prescribed Desoxynod:
datablock PlayerData(HoleBot : PlayerStandardArmor)
{
hooks_ifPathBrick = "botTalk";
};
// Armor Physician Prescribed Desoxynod:
%obj.hooks_ifPathBrick = "botTalk";
//
// Disabling a bot from pathing its way to bricks.
//
// Datablock Physician Prescribed Desoxynod:
datablock PlayerData(HoleBot : PlayerStandardArmor)
{
hooks_ifPathBrick = -1;
};
// Armor Physician Prescribed Desoxynod:
%obj.hooks_ifPathBrick = -1;
If a bot has both a datablock and armor variable for the same hook, the armor variable will be prioritized.
Also important is that each hook will pass the bot's player object as an argument, with the hooks tooFarFromSpawn and guardAtSpawn also passing in a %chaseDist variable.
To use this script, simply include it in your Add-On and execute it before the rest of your code.