User Tools

Site Tools


4rpl:commands:damageunit

This is an old revision of the document!


Index
Unit

DamageUnit

DamageUnit(<-unit <-amt)

Description

Damages the specified unit. Typical health values for most units are either 0 or 1. Units that have a health of 0 will be destroyed when Damage is called. Other units will have damage deducted from their health. Note that positive values cause damage. If a negative value is passed in, the resulting unit's health increases.

:WARNING: If using this API for something like a custom missile and applying this API after getting a list of units to damage, make sure the unit that's doing this is not part of the list of units to damage otherwise this API will damage the unit that called it and possibly end the loop prematurely by destroying it. This will either make the unit very unreliable in using this API effectively or reliably destroy the unit using this API before applying it to the intended units. So for the sake of your sanity please be mindful of this if it appears this API isn't working super reliably.

-Vertu | Who temporarily lost his mind to this.

Examples

DamageUnit(<-someUnitUID 0.1)

Index

4rpl/commands/damageunit.1648510423.txt.gz · Last modified: 2025/02/14 14:56 (external edit)