is_bot_alived - ryzom/ryzomcore GitHub Wiki


title: Is Bot Alived description: published: true date: 2023-03-13T04:06:31.372Z tags: editor: markdown dateCreated: 2023-03-13T04:06:28.175Z

isBotAlived

The isBotAlived native AI script function is used to test if a bot of the current group is alive, identified by its index.

Syntax

(success: f)isBotAlived(botIndex: f) // isBotAlived_ff

Arguments

  • botIndex (float): The index of the bot.

Return Value

  • success (float): Returns 1.0 if there is at least one member of the group alive, or 0.0 if no living bot is found.

Examples

($botIndex)getBotIndexByName("boss_3");
($alive)isBotAlived($botIndex);
if ($alive == 1.0f) {
    // do something if the bot is alive
}

This example code retrieves the index of a bot named "boss_3" and tests if it is alive. If the bot is alive, the code block is executed.

⚠️ **GitHub.com Fallback** ⚠️