• 🏆 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!

[Trigger] damage when missile of spells hits the target

Status
Not open for further replies.

EdgeOfChaos

E

EdgeOfChaos

Check for stun buff, remove it, re-apply a different stun, and do whatever unique thing you want.
 
Level 12
Joined
May 22, 2015
Messages
1,051
It may be a bit of a hack, but you can also do this with a damage detection system.

If you have a dummy cast the actual spell (you could have a 0-damage finger of death with no animation on the unit who casts the spell), you could check for when the dummy deals damage and then apply additional effects.

It could get pretty messy if you need data from the unit that casts it, though.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Ehem, execus me good sirs and ladies but does not
  • Unit - Starts the effect of an ability
run when the missile hits the target as the OP explained ? Why are you all giving complicated stuff like DDS, and buff checking, and other when there is a simple and very easy to do thing.


Just make an ability based on channel and use
  • Event
    • Unit - Starts the effect of an ability
  • Condition
    • Ability being cast equal to TheDummySpellBasedOnChannel
  • Action
    • Drop teh bass
Edit// Ah, this is if the stun is not wanted as Storm Bolt always stuns ( a stun duration of 0.00 is an infinite stun)
If you want some stun to the spell use Storm Bolt and replace "TheDummySpellBasedOnChannel" with "TheModifiedStormBoltYouJustMade"
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
Title explains it, for example, i have the Storm Bolt ability, and i want something to happen when the missile model hits it's target. How can i do that if it even is possible in GUI?

There is 2 effective ways of checking if storm bolt is hitting a unit

  • Detect Damage, which is a bit of a hazzle if you have little experience with editor and you need a damage detection trigger/system.

or for a novice mapper

  • Check for buff. Add target a a group in cast trigger, check for storm bolt buff every 0.05 sec in a second trigger, when it has the stun buff (I recommend create a new buff unique to that ability, since many abilities use same stun buff), then apply something to happen to that unit and remove the unit from unit group.

  • Cast Storm Bolt
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Set StormBoltCastCounter = (StormBoltCastCounter + 1)
      • -------- StormBoltCastCounter (Integer - variable) --------
      • Unit Group - Add (Target unit of ability being cast) to CheckForBuff
      • -------- CheckForBuff (Unit Group - variable) --------
      • Trigger - Turn on Storm Bolt Buff Check <gen>
      • Wait - 10 seconds
      • Set StormBoltCastCounter = (StormBoltCastCounter - 1)
  • Storm Bolt Buff Check
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CheckForBuff and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Stunned Special) Equal to True
            • Then - Actions
              • Unit Group - Remove (Picked unit) from CheckForBuff
              • -------- Do your trigger stuff here, what effect you wan --------
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StormBoltCastCounter Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
There are two ways to do it.

1, Use a DDS.
With this tool, you can catch the moment when a unit takes damage.
When that happens, you check if the target has the buff "stun" and if he has, the damage is dealt via the Storm Bolt.
However there is one problem.
This will mean that you have to remove the storm bolt buff immediately.
You will have to do the stun yourself. For that you can use a stun system.

2, use a Missile System.
This option is much more recommended as it
1, opens a lot of more possibilities.
2, doest require additional stuff (custom stuns, etc)
3, will learn you how to use systems like these.
A missile system creates a new missile and it will move to the target.
When it hits the target, you are given an onHit event on which you can do whatever you want to the target.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Ehem, execus me good sirs and ladies but does not
  • Unit - Starts the effect of an ability
run when the missile hits the target as the OP explained ? Why are you all giving complicated stuff like DDS, and buff checking, and other when there is a simple and very easy to do thing.


Just make an ability based on channel and use
  • Event
    • Unit - Starts the effect of an ability
  • Condition
    • Ability being cast equal to TheDummySpellBasedOnChannel
  • Action
    • Drop teh bass
Edit// Ah, this is if the stun is not wanted as Storm Bolt always stuns ( a stun duration of 0.00 is an infinite stun)
If you want some stun to the spell use Storm Bolt and replace "TheDummySpellBasedOnChannel" with "TheModifiedStormBoltYouJustMade"

Does it work like this with Channel? I haven't used channel for anything yet.

As for storm bolt, "Unit - Starts the effect of an ability" gets when the storm bolt is released, not when it hits. AFAIK, there is no super easy way to detect when a missile hits. Easiest, imo, is damage detection.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,185
According to to me spending an hour to code a missile system to deal damage half a second (give or take) later is not worth the effort unless you're aiming for a DC.

There are better things to spend time on. Might worth it to download an existing one if you plan to use it for a lot of spells, but since I don't know the situation, I can only guess.
 
Status
Not open for further replies.
Top