scale_hp - ryzom/ryzomcore GitHub Wiki


title: Scale HP description: published: true date: 2023-03-13T01:08:08.241Z tags: editor: markdown dateCreated: 2023-03-13T01:08:04.894Z

downScaleHP, upScaleHP, and scaleHP

The downScaleHP native AI script function scales the bots' HP down by removing a factor of their current HP.

The upScaleHP native AI script function scales the bots' HP up by adding a factor of their missing HP (the difference between max and current HP).

The scaleHP native AI script function scales the bots' HP by adding a factor of their current HP.

Syntax

()downScaleHP(Coef: f) // downScaleHP_f_
()upScaleHP(Coef: f) // upScaleHP_f_
()scaleHP(Coef: f) // scaleHP_f_

Arguments

  • Coef (float): The percentage of the bots' HP to scale by.

Example

()downScaleHP(0.5); // Scales the bots' HP down by half

This example code scales the bots' HP down by removing half of their current HP.

()upScaleHP(0.5); // Restores half of the bots' missing HP

This example code scales the bots' HP up by adding half of their missing HP.

()scaleHP(2); // Scales the bots' HP up by adding twice their current HP

This example code scales the bots' HP by adding twice their current HP.

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