Relativistic Attacks (Ranged attack redirection)

This bundle is marked as awaiting update. A staff member has requested changes to it before it can be approved.
A system for selectively replacing a unit's normal ranged attack with a Relativistic missile at runtime. Also includes a spell for redirecting such attacks while they are in flight. Despite its limitations I thought it was worth posting. See triggers for import instructions and limitations.

Big thank you to Bribe for damage engine and attack indexer and Chopinski for relativistic missiles

Thank you to MyPad for fixing the splash filter function.

edit: You can't see it in the screenshot but the dryads DO get poisoned by the redirected attacks. Also the system does work with evasion.

Changelog:
1.0 - Initial release
1.1 - Minor code updates
1.2 - System now automatically uses most filters defined in the object editor such as air and ground for AoE attack damage filtering. Filters that depend on the other unit involved such as "enemy" are not accounted for however. Also improved test map.
1.3 - Fixed missile height for flying units and Improved test map again
Contents

Relativistic Attacks (Map)

Reviews
Antares
From just a few tests and skimming over the code, I can find a multitude of things going wrong. The Redirect spell seems to be working fine, but the missiles as still moving below the ground a few frames after casting the spell. Because I'm not an...
Feel free to report any issues you find as well as which orb effects do and don't work correctly.

Edit: Does anyone know how to detect if an attack uses a unit's primary or secondary attack (Attack 1 or Attack 2)? Being able to directly detect that would save me a lot of work with this system.
 
Last edited:
From just a few tests and skimming over the code, I can find a multitude of things going wrong.

The Redirect spell seems to be working fine, but the missiles as still moving below the ground a few frames after casting the spell. Because I'm not an expert with the missile system, I couldn't tell you why.

The Store Current Damage Damage Dealt function does not seem to assign the damage amount to the correct unit. Again, I could not tell you why, but the custom value of DamageEventSource is not consistent with the custom value of the units from the enters trigger. This bug might be related to another bug, which is that once the attacked unit dies, suddenly other units on the map start taking damage from the missiles.

The way you're determining the damage amount in the Store Current Damage Enters function is very janky and made no sense to me until I realized that you're deciding on each attack individually if you're replacing it with a relativistic missile or not, based on whether a unit with the Redirect ability is nearby. That is again a very janky implementation.

If you can make a good system that automatically replaces the attacks of all units on the map with relativistic missiles, that would actually be a useful resource. Then a mapmaker can do lots of things with it, and is not just limited to the Redirect ability.

You can use a single event to detect the attack damage, check if it's a ranged attack, and if so, store the damage amount, set the damage to 0, and replace it with a relativistic missile. There's no need for the convoluted stuff you have going on.

This will need major rewrites before it can get approved.

Awaiting Update
 
Top