copy_dyn_energy - ryzom/ryzomcore GitHub Wiki


title: Copy Dyn Energy description: published: true date: 2023-03-12T12:39:11.271Z tags: editor: markdown dateCreated: 2023-03-12T09:49:11.953Z

copyDynEnergy

The copyDynEnergy native AI script function is used to copy energy values from one index to another on all groups that match a specified request. Valid index values for this action are integers between 0 and 3.

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

()copyDynEnergy(Request: s, IndexSrc: f, IndexDst: f) // copyDynEnergy_sff_

Arguments

  • Request (string): A request string in the format [family-<family_name>] [cellZone-<cellzone_name>].
  • IndexSrc (float): The index number of the source energy slot.
  • IndexDst (float): The index number of the destination energy slot.

Example

()copyDynEnergy("family-tribu*", SourceIndex , DestinationIndex) 

This example code copies the dynamic energy of all groups defined by the family-tribu* request string from the energy slot specified by IndexSrc to the energy slot specified by IndexDst.

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