This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
4rpl:commands:applytodamagemap [2021/03/05 14:52] – virgilw | 4rpl:commands:applytodamagemap [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 6: | Line 6: | ||
===== Description ===== | ===== Description ===== | ||
- | Applies ' | + | Applies ' |
The unit is the unit to associate this damage map alteration to. When the unit is destroyed, the amount applied to the damage map will be removed. | The unit is the unit to associate this damage map alteration to. When the unit is destroyed, the amount applied to the damage map will be removed. | ||
- | If the unit is not specified (unit = -1 or less), then no unit association is created. This means that the damage map must be manually cleaned up! Use this with extreme caution.\\ | + | If the unit is not specified (unit = -1 or less), then no unit association is created. This means that the damage map must be manually cleaned up! Use this with extreme caution. |
- | CellX and cellZ define the center of a circle or square with a specified radius.\\ | + | |
- | The amt value is added to each cell in the defined region. | + | |
- | The damage map does not affect the calculation of min/max AC.\\ | + | |
- | The damage map is global to the map. When multiple scripts/ | + | |
- | However, any damage map value above max int will be treated as max int for purposes of min/max creeper calculation.\\ | + | |
- | NOTE!!!! | + | |
- | a weapon projectile, your must remove that applied damage once the projectile no longer exists. To remove from the damage map, simply use a negative value for amt.\\ | + | |
- | BE VERY CAREFUL TO SUBTRACT OUT EXACTLY WHAT IS APPLIED TO THE DAMAGE MAP. OTHERWISE VALUES WILL BE LEFT IN THE DAMAGE MAP THAT WILL AFFECT MORTAR FIRE AND ANY OTHER UNIT THAT LOOKS AT THE DAMAGE MAP. | + | |
+ | CellX and cellZ define the center of a circle or square with a specified radius. | ||
+ | |||
+ | The amt value is added to each cell in the defined region. | ||
+ | |||
+ | The damage map does not affect the calculation of min/max AC. | ||
+ | The damage map is global to the map. When multiple scripts/ | ||
+ | However, any damage map value above max int will be treated as max int for purposes of min/max creeper calculation. | ||
+ | |||
+ | |||
+ | :!: The damage map is persistent (during a game and even across save/load). If the unit is not specified, you must subtract values from the damage map when the applied damage is no longer needed. So, for instance, if you apply damage to the damage map when creating | ||
+ | a weapon projectile, your must remove that applied damage once the projectile no longer exists, if the projectile is not specified as the unit in the call to ApplyToDamageMap To remove from the damage map, simply use a negative value for amt.\\ | ||
+ | |||
+ | :!: BE VERY CAREFUL TO SUBTRACT OUT EXACTLY WHAT IS APPLIED TO THE DAMAGE MAP. OTHERWISE VALUES WILL BE LEFT IN THE DAMAGE MAP THAT WILL AFFECT MORTAR FIRE AND ANY OTHER UNIT THAT LOOKS AT THE DAMAGE MAP. See [[RemoveUnitDamageMap]] | ||
+ | |||
+ | :WARNING: When using this API, you can't just directly input your damage variable in. A single cell of Creeper with a depth of " | ||
===== Examples ===== | ===== Examples ===== | ||
<code 4rpl> | <code 4rpl> | ||
- | ApplyToDamageMap(-1 < | + | ApplyToDamageMap(self < |
:Destroyed | :Destroyed | ||
# | # | ||
- | | + | |
</ | </ | ||
+ | <code 4rpl> | ||
+ | ApplyToDamageMap(self < | ||
+ | #Using a DAMAGE Initial Variable, we multiply it by 1,000,000 to keep it scaled to real values of Creeper depth. | ||
+ | |||
+ | :Destroyed | ||
+ | # | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ==== Presets ==== | ||
+ | <code 4rpl> | ||
+ | ApplyToDamageMap(< | ||
+ | </ | ||
+ | |||
< | < | ||