get_current_player_aggro_list_target - ryzom/ryzomcore GitHub Wiki


title: Get Current Player Aggro List Target description: published: true date: 2023-03-13T13:26:14.315Z tags: editor: markdown dateCreated: 2023-03-13T13:26:14.315Z

getCurrentPlayerAggroListTarget

The getCurrentPlayerAggroListTarget native AI script function returns the Entity ID (as a string) of the player with the most aggro in the aggro list of a bot.

Syntax

(playerEidAsString: s)getCurrentPlayerAggroListTarget(botIndex: f)

Arguments

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

Return value

  • playerEidAsString (string): The Entity ID (as a string) of the player with the most aggro in the bot's aggro list. Returns an empty string if the aggro list is empty.

Examples

($playerId)getCurrentPlayerAggroListTarget(4);
(distance)getPlayerDistance(4, $playerId);

This example code gets the Entity ID of the player with the most aggro in the aggro list of the bot at index 4 in the current group. The resulting Entity ID is stored in the $playerId variable. The distance between the bot at index 4 and the player with the most aggro is then calculated using the getPlayerDistance function.

Notes

A bot index is used to identify the bot. If there is only one spawned bot in a group, then the index value is 0. If the bot index of a specific bot is needed, the getBotIndexByName function can be used. The getBotCount function can be used to determine the number of bots in a group. The isGroupAlived or isBotAlived functions can be used to verify if the bot index is valid.

If no bot is identified by the bot index (or if the bot is not spawned), the function returns an empty string and displays a warning message. The isBotAlived function can be used to ensure that the bot index is still a valid value.

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