• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[vJASS] Custom Attack System

Status
Not open for further replies.
Hello everyone!

I was planning to make a custom missile system for one of my maps, where normal attack is completely intercepted and prevented, and instead replaced by a custom missile. Now, missile systems i have done multiple times before, but i would like to know what the best way is to intercept a units attack, and how to prevent it from happening. Any ideas?
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
By the time where you're already customizing missile unit attacks you'll want to customize melee attacks too since it makes your system much more robust/extensible. When you're coding a bunch of spells/whatever which work with attacks later it's nice to know everything is going through the same system.
 
Add ability cargo hold (orc burrow) directly intercepts attacks

You mean it prevents attacks. I know that, but what i wanted to do was to keep the target aquisition but replace the actual attack itself. WaterKnights solution is the one i will go for.

@PurplePoot: Thank you for that advice, although i am using this for a modern warfare map to simulate strategic missile submarines etc, and i am not sure if it would be efficient for, say, infantry units to have physically simulated bullets in this scenario. For melee weapons though i understand the reasoning, since it is easy to replicate.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Ah, yeah, if it's a case like that then you definitely shouldn't be doing it. I assumed you wanted this for all units.

Definitely have an instant speed 0 damage attack wired to one of the attack types. You could also use the old method that people used for damage detection systems: give people an orb ability and, upon damage, check if the unit has the orb buff. Alternatively you should still be able to make everyone do (essentially) 0 damage and hardcode the actual damage upon a damage event without coding most projectiles manually.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Without messing up the damage numbers it's possible to keep the damage if you use a damage detection system and trigger all damage modifications.
I use the system by looking_for_help, as it allows me to very comfortably change damage. In this case the damage would be stored in the custom projectile and then the actual damage done by the instant attack nullified.
 
Status
Not open for further replies.
Top