Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
List of all members
dp88_RegenerateHitpoints Class Reference

Health Regeneration. More...

#include <dp88_misc.h>

Detailed Description

Author
Daniel Paul (danpa.nosp@m.ul88.nosp@m.@yaho.nosp@m.o.co.nosp@m..uk)

Attach this script to a unit to enable it to regenerate health and armour hitpoints, up to a configurable % of its maximum hitpoints. Additionally it can also be configured to only repair hitpoints when not in combat, forcing the player to escape from battle or defeat their opponent before they begin regenerating their hitpoints.

This script is compatible with the dp88_veterancyUnit script and includes settings for alternative regeneration rates at higher veterancy levels, although it also works as a standalone script.

Parameters
HitpointsThe amount of hitpoints to repair each interval
IntervalThe number of seconds between each repair interval
WarheadThe warhead to use when applying repair damage. If this is not set it will apply raw repairs without any warhead scaling. Note that the warhead must have a negative rating vs the unit skin and armour types otherwise the unit will actually take damage every interval
Max_PercentThe maximum percentage of the units total hitpoints that can be repaired, set this to 100 to allow the unit to be repaired completely
Damage_TimeoutThe number of seconds to wait after the last damage event before regeneration is allowed. Set this to 0 to allow regeneration whilst in combat
Hitpoints_VeteranThe amount of hitpoints to repair when the unit is promoted to veteran. Only applicable when used alongside the dp88_veterancyUnit script
Hitpoints_EliteThe amount of hitpoints to repair when the unit is promoted to veteran. Only applicable when used alongside the dp88_veterancyUnit script
ModeAdded in 4.2, this is a bitflag which controls which hitpoints the script should heal. See the table below for the available modes.
Note
The following mode flags are available. To combine modes add the flag values together, for example: Mode 3 would regenerate hitpoints for health (1) and armour (2);

Mode Target
1 Health of this object
2 Armour of this object
4 Health of the vehicle this object is driving (only if attached to a soldier)
8 Armour of the vehicle this object is driving (only if attached to a soldier)
16 Health of the vehicle this object is a passenger in (only if attached to a soldier)
32 Armour of the vehicle this object is a passenger in (only if attached to a soldier)
64 Health of the driver of this object (only if attached to a vehicle)
128 Armour of the driver of this object (only if attached to a vehicle)
256 Health of the passengers of this object (only if attached to a vehicle)
512 Armour of the passengers of this object (only if attached to a vehicle)
The maximum percentage cap is based upon the current mode. If configured to heal both the health and armour of a target the cap is the percentage of the combined health and armour hitpoints, otherwise it is the percentage of whichever hitpoints it is configured to repair.
For example, given an object with 100 health and 100 armour and a cap of 75% the following caps would apply;
Mode Cap
1 Capped at 75 health, ignores armour
2 Capped at 75 armour, ignores health
3 (1+2) Capped at 150 hitpoints (health+armour)
Warning
When using a warhead with this script it is possible that healing may occur outside the target parameters due to armor.ini settings. If you want to heal only health or armour for a target it is recommended that you either use no warhead or use a warhead which only affects the hitpoints you want to heal.