set_dyn_energy - ryzom/ryzomcore GitHub Wiki


title: Set Dyn Energy description: published: true date: 2023-03-12T12:38:23.865Z tags: editor: markdown dateCreated: 2023-03-12T10:03:20.965Z

setDynEnergy

The setDynEnergy native AI script function is used to set energy values on a specified index for all groups that match a given request. Valid index values for this action are integers between 0 and 3. Valid values for the energy parameter range from 0 to 1.

The request parameter for this action takes the form of [family-<family_name>] [cellZone-<cellzone_name>]. It is possible to use wildcards (? and *) in the family and cellzone names.

Syntax

()setDynEnergy(Request: s, Index: f, Value: f) // setDynEnergy_sff_

Arguments

  • Request (string): A request string in the format [family-<family_name>] [cellZone-<cellzone_name>].
  • Index (float): The index number of the energy slot to set.
  • Value (float): The value to set for the specified energy slot.

Example

()setDynEnergy("family-tribu*", Index, Energy) 

This example code sets the dynamic energy of all groups defined by the family-tribu* request string to the energy value specified by Energy in the energy slot specified by Index.

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