User Tools

Site Tools


4rpl:commands:applytodamagemap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
4rpl:commands:applytodamagemap [2022/04/23 10:01] virgilw4rpl:commands:applytodamagemap [2024/02/18 15:07] (current) – [Presets] Backpeddeled self into <-shotUnit Vertu
Line 25: Line 25:
 :!: 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]] :!: 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 "1" is actually a value of 1,000,000. Hence the Creeper depth limit of 2,146 in a single cell as the Max Integer of 32 bit is 2,147,483,647. So whenever using this API, what ever amount of damage to the Creeper you wish to map, multiply it by 1,000,000. Otherwise this API will not work effectively.
 ===== Examples ===== ===== Examples =====
 <code 4rpl> <code 4rpl>
-ApplyToDamageMap(-1 <-targetX <-targetZ 10 5000000 false)+ApplyToDamageMap(self <-targetX <-targetZ 10 5000000 false)
  
 :Destroyed :Destroyed
    #Remove the damage when this unit is destroyed    #Remove the damage when this unit is destroyed
-   ApplyToDamageMap(-1 <-targetX <-targetZ 10 -5000000 false)+   ApplyToDamageMap(self <-targetX <-targetZ 10 -5000000 false)
 </code> </code>
 +<code 4rpl>
 +ApplyToDamageMap(self <-targetX <-targetZ 10 <-DAMAGE 1000000 * false)
 +#Using a DAMAGE Initial Variable, we multiply it by 1,000,000 to keep it scaled to real values of Creeper depth.
 +
 +:Destroyed
 +   #Remove the damage when this unit is destroyed
 +   ApplyToDamageMap(self <-targetX <-targetZ 10 <-DAMAGE -1000000 * false)
 +</code>
 +
 +==== Presets ====
 +<code 4rpl>
 +ApplyToDamageMap(<-shotUnit <-targetPos.x <-targetPos.z <-RADIUS <-DAMAGE 1000000 * false)
 +</code>
 +
 <=[[4rpl:start| Index]] <=[[4rpl:start| Index]]
  
4rpl/commands/applytodamagemap.1650722510.txt.gz · Last modified: 2022/04/23 10:01 by virgilw