is_alived - ryzom/ryzomcore GitHub Wiki


title: Is Alived description: published: true date: 2023-03-14T02:43:21.528Z tags: editor: markdown dateCreated: 2023-03-14T02:29:15.538Z

isAlived and isGroupAlived

The isAlived and isGroupAlived native AI script functions check if the group is alive. They return 1 if the group is spawned and at least one member of the group is alive.

Syntax

(alive)isAlived(); // isAlived__f
(alive)isGroupAlived(); // isGroupAlived__f

Return value

  • alive (float): Returns 1 if the group is spawned and at least one bot is alive, 0 otherwise.

Examples

($alive)isAlived();
if ($alive == 1.0f) {
    debug("At least one member of the group is alive!");
}

This example code calls the isAlived function and stores the result in the $alive variable. If at least one member of the group is alive, it prints a debug message.

($alive)isGroupAlived();
if ($alive == 1.0f) {
    debug("At least one member of the group is alive!");
}

This example code calls the isGroupAlived function and stores the result in the $alive variable. If at least one member of the group is alive, it prints a debug message.

Notes

The isGroupAlived function is an alias of isAlived.

This function is used to determine if the current group is alive and can be interacted with. If the group is not alive, some functions that depend on a spawned group may not work correctly.

The isBotAlived function can be used to determine if a specific bot in the group is alive.

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