Skip to content

is_alived

Ryzom Core Wiki edited this page Jul 8, 2024 · 4 revisions

title: Is Alived description: published: true date: 2023-03-16T23:08:17.952Z tags: editor: markdown dateCreated: 2023-03-16T22:25:15.477Z

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.

Clone this wiki locally