I would like to create a weapon that increases in damage the farther the target is from the caster.
There are two approaches, one would be a constant change, the further the target the damage scale continues to go up, and the other is a static amount, I.E. Once the target is farther then a range of 16, damage is increased by 50%.
The most dynamic approach would involve triggers where the weapon does a dummy Damage effect for launch/impact visuals and then triggers do the actual damage.
For a pure data method you would need the weapon to use a Switch effect that uses several Combine validators that use pairs of Location Range validators. Based on which range bracket the target is in the switch can then use different Damage effects with incremental damage.
StarCraft II does not support this as far as I am aware. Heroes of the Storm needed special mechanics added to it so they could efficiently create Li Ming Arcane Orb and other abilities that scale with distance travelled.
Both DrSuperEvil's approaches sound a sensible work around depending on which sort of scaling you want. However they might not be completely accurate in the case of projectile linked damage where a projectile is launched and the launcher moves. If the launcher moves away from the target it might increase the damage, and like wise if it moves towards the target the game might be decreased.
If a projectile is used another approach would be to periodically increment a buff/charge on the projectile unit and deal damage based on the number of such buff/charge. This is the travel time of the projectile which translates into a duration.
This might sound sort of crude, but I ended up using a simple search area effect with range validators on the apply behavior effects. The behavior effects are applied to the target with combat damage responding only to the weapon. When at the proper range the appropriate behavior is periodically applied. I use the range validators to let the effect know whether to apply the damage buff to the target. The duration of the behavior is short enough that if a target moves out of range or moves closer it will apply or unapply rather quickly.
For now its easy enough to do this with 3 different damage levels. Light, Medium, and Heavy.
The direct way would require triggering the damage, computing the damage amount based on the unit energy vital and other data. The indirect way would be to use triggers to add/remove buff charges based on the energy vital amount and each buff increases ability type damage by a small fraction.
Or have a whole ton of behaviors with combine validators checking the energy requirements. If you did increments of 10 energy, and your max energy is 300 for the unit, that would be 30 behaviors. Put the combine validator on the (disable) check box, so that only 1 behavior is active at a time according to the proper energy level. Not sure which is going to be laggier, using triggers or doing that crazy 30 buff thing!
I would like to create a weapon that increases in damage the farther the target is from the caster.
There are two approaches, one would be a constant change, the further the target the damage scale continues to go up, and the other is a static amount, I.E. Once the target is farther then a range of 16, damage is increased by 50%.
How would I go about doing this?
The most dynamic approach would involve triggers where the weapon does a dummy Damage effect for launch/impact visuals and then triggers do the actual damage.
For a pure data method you would need the weapon to use a Switch effect that uses several Combine validators that use pairs of Location Range validators. Based on which range bracket the target is in the switch can then use different Damage effects with incremental damage.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
StarCraft II does not support this as far as I am aware. Heroes of the Storm needed special mechanics added to it so they could efficiently create Li Ming Arcane Orb and other abilities that scale with distance travelled.
Both DrSuperEvil's approaches sound a sensible work around depending on which sort of scaling you want. However they might not be completely accurate in the case of projectile linked damage where a projectile is launched and the launcher moves. If the launcher moves away from the target it might increase the damage, and like wise if it moves towards the target the game might be decreased.
If a projectile is used another approach would be to periodically increment a buff/charge on the projectile unit and deal damage based on the number of such buff/charge. This is the travel time of the projectile which translates into a duration.
All good ideas,
Just as you were writing that I was thinking of trying the same thing. using a periodic buff/charge on the projectile.
I will let you all know what I come up with in a few days.
Happy editing.
This might sound sort of crude, but I ended up using a simple search area effect with range validators on the apply behavior effects. The behavior effects are applied to the target with combat damage responding only to the weapon. When at the proper range the appropriate behavior is periodically applied. I use the range validators to let the effect know whether to apply the damage buff to the target. The duration of the behavior is short enough that if a target moves out of range or moves closer it will apply or unapply rather quickly.
For now its easy enough to do this with 3 different damage levels. Light, Medium, and Heavy.
While we're on the topic. Any ideas of how to make damage scale with a units vitals? So the more energy a unit has, the more damage it does.
The direct way would require triggering the damage, computing the damage amount based on the unit energy vital and other data. The indirect way would be to use triggers to add/remove buff charges based on the energy vital amount and each buff increases ability type damage by a small fraction.
Or have a whole ton of behaviors with combine validators checking the energy requirements. If you did increments of 10 energy, and your max energy is 300 for the unit, that would be 30 behaviors. Put the combine validator on the (disable) check box, so that only 1 behavior is active at a time according to the proper energy level. Not sure which is going to be laggier, using triggers or doing that crazy 30 buff thing!
Just remember there is a cap as to how many different buffs a unit can have on it at once.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
In reply to DrSuperEvil:
32 I think or was it 64...
Maybe have a personal aura system where a switch decides what damage boost buff to apply.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg