• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] Self-cast custom spell doesn't work as intended

Level 15
Joined
Sep 11, 2013
Messages
557
Greetings!
I am happy to say that I am almost ready to finish my new [TAG] map and to upload it on Hive! I think this project will be ready in maybe 1-2 weeks thanks to your awesome help.:peasant-cheers-back:

So.. back to the problem.. : )

I have this Impulsive Fire - 2025(Shockwave) spell that create a dummy that cast (Breath of Fire) and this trigger work great as long as I target the enemy or the ground with my shockwave.
  • Impulsive Fire
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Impulsive Fire - 2025
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to No unit
        • Then - Actions
          • Set VariableSet ImpulsiveFirePoint[1] = ((Position of (Triggering unit)) offset by 100.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees.)
          • Set VariableSet ImpulsiveFirePoint[2] = (Target point of ability being cast)
          • Set VariableSet ImpulsiveFire_Angle = (Angle from (Position of (Triggering unit)) to ImpulsiveFirePoint[2])
          • Game - Display to (All players) the text: 1 GROUND
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Target unit of ability being cast) Not equal to (Triggering unit)
            • Then - Actions
              • Set VariableSet ImpulsiveFirePoint[1] = ((Position of (Triggering unit)) offset by 100.00 towards (Angle from (Position of (Triggering unit)) to (Position of (Target unit of ability being cast))) degrees.)
              • Set VariableSet ImpulsiveFirePoint[2] = (Position of (Target unit of ability being cast))
              • Set VariableSet ImpulsiveFire_Angle = (Angle from (Position of (Triggering unit)) to ImpulsiveFirePoint[2])
              • Game - Display to (All players) the text: 2. UNITS/BUILDINGS
            • Else - Actions
              • Set VariableSet ImpulsiveFirePoint[1] = ((Position of (Triggering unit)) offset by 100.00 towards (Angle from (Position of (Triggering unit)) to (Position of (Target unit of ability being cast))) degrees.)
              • Set VariableSet ImpulsiveFire_Angle = (Facing of (Triggering unit))
              • Game - Display to (All players) the text: 3. SELF
      • Game - Display to (All players) the text: works1
      • Unit - Create 1 Impulsive Fire Dummy 1 for (Owner of (Triggering unit)) at ImpulsiveFirePoint[1] facing ImpulsiveFire_Angle degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Impulsive Fire - DUMMY to (Last created unit)
      • Unit - Set level of Impulsive Fire - DUMMY for (Last created unit) to (Level of Impulsive Fire - 2025 for (Triggering unit))
      • Unit - Order (Last created unit) to Neutral Brewmaster - Breath Of Fire ImpulsiveFirePoint[1]
      • Custom script: call RemoveLocation(udg_ImpulsiveFirePoint[1])
      • Custom script: call RemoveLocation(udg_ImpulsiveFirePoint[2])
The problem appears when I try to use the shockwave on myself.
As you can see in the image below, when I cast on myself, the dummy appears on the right, not in front of my hero.
I wish that, when I cast the spell on myself, the dummy must appear, just like when I cast the spell on the ground/enemy (in front of my hero's face, offset by 100 range.)

I don't know how I can do that.. :peasant-sad:


1763266033014.png


I attached the test map below.

The help will be appreciated!

:peasant-bowing:
 

Attachments

then just add a condition checking if the caster is targeting themself, and create the dummy 100 units infront like this
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Triggering unit) Equal to (Target unit of ability being cast)
    • Then - Actions
      • Unit - Create 1 Footman for (Triggering player) at ((Position of (Triggering unit)) offset by 100.00 towards (Facing of (Triggering unit)) degrees.) facing Default building facing degrees
    • Else - Actions
 
Here's a cleaned up design.
1. You don't need the Angle variable.
2. I fixed the (Position of (Triggering unit)) memory leak.
3. Your Dummy unit does not need to face the target. Dummy units don't have to turn to cast spells, unless you've failed to set them up properly.
  • Impulsive Fire
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Impulsive Fire - 2025
    • Actions
      • Set Variable ImpulsiveFirePoint[1] = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to No unit
        • Then - Actions
          • Set Variable ImpulsiveFirePoint[2] = (Target point of ability being cast)
          • Game - Display to (All players) the text: 1. GROUND
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Target unit of ability being cast) Not equal to (Triggering unit)
            • Then - Actions
              • Set Variabe ImpulsiveFirePoint[2] = (Position of (Target unit of ability being cast))
              • Game - Display to (All players) the text: 2. UNITS/BUILDINGS
            • Else - Actions
              • Set Variable ImpulsiveFirePoint[2] = (ImpulsiveFirePoint[1] offset by 10.00 towards (Facing of (Triggering unit))) degrees.)
              • Game - Display to (All players) the text: 3. SELF
      • Unit - Create 1 Impulsive Fire Dummy 1 for (Owner of (Triggering unit)) at ImpulsiveFirePoint[1] facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Impulsive Fire - DUMMY to (Last created unit)
      • Unit - Set level of Impulsive Fire - DUMMY for (Last created unit) to (Level of Impulsive Fire - 2025 for (Triggering unit))
      • Unit - Order (Last created unit) to Neutral Brewmaster - Breath Of Fire ImpulsiveFirePoint[2]
      • Custom script: call RemoveLocation(udg_ImpulsiveFirePoint[1])
      • Custom script: call RemoveLocation(udg_ImpulsiveFirePoint[2])
How to create a proper Dummy unit:
1. Copy and paste the Locust.
2. Set it's Model, Shadow, Attack Type, and Movement Type to None.
3. Set it's Speed Base to 0.
4. Optionally you can change it's Model to an imported Dummy model. This gives you access to Attachment points. If you notice missing Art effects when your Dummy casts spells then this is the reason why! It could also be attributed to you killing the Dummy too early.

Note that a Dummy unit with these settings can no longer move around. If you need that functionality, like if you're using Dummy units as Missiles (you shouldn't be), then you'll need to re-enable it's Movement settings. But once you do that the Dummy will need to turn to face it's target again. If you MUST use a Dummy as a Missile then it should be used exclusively for that and NOT for casting spells.

A map should really only need 1 Dummy unit that can be used everywhere.
 
Last edited:
Here's a cleaned up design.
1. You don't need the Angle variable.
2. I fixed the (Position of (Triggering unit)) memory leak.
3. Your Dummy unit does not need to face the target. Dummy units don't have to turn to cast spells, unless you've failed to set them up properly.
  • Impulsive Fire
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Impulsive Fire - 2025
    • Actions
      • Set Variable ImpulsiveFirePoint[1] = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to No unit
        • Then - Actions
          • Set Variable ImpulsiveFirePoint[2] = (Target point of ability being cast)
          • Game - Display to (All players) the text: 1. GROUND
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Target unit of ability being cast) Not equal to (Triggering unit)
            • Then - Actions
              • Set Variabe ImpulsiveFirePoint[2] = (Position of (Target unit of ability being cast))
              • Game - Display to (All players) the text: 2. UNITS/BUILDINGS
            • Else - Actions
              • Set Variable ImpulsiveFirePoint[2] = (ImpulsiveFirePoint[1] offset by 10.00 towards (Facing of (Triggering unit))) degrees.)
              • Game - Display to (All players) the text: 3. SELF
      • Unit - Create 1 Impulsive Fire Dummy 1 for (Owner of (Triggering unit)) at ImpulsiveFirePoint[1] facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Impulsive Fire - DUMMY to (Last created unit)
      • Unit - Set level of Impulsive Fire - DUMMY for (Last created unit) to (Level of Impulsive Fire - 2025 for (Triggering unit))
      • Unit - Order (Last created unit) to Neutral Brewmaster - Breath Of Fire ImpulsiveFirePoint[2]
      • Custom script: call RemoveLocation(udg_ImpulsiveFirePoint[1])
      • Custom script: call RemoveLocation(udg_ImpulsiveFirePoint[2])
How to create a proper Dummy unit:
1. Copy and paste the Locust.
2. Set it's Model, Shadow, Attack Type, and Movement Type to None.
3. Set it's Speed Base to 0.
4. Optionally you can change it's Model to an imported Dummy model. This gives you access to Attachment points. If you notice missing Art effects when your Dummy casts spells then this is the reason why! It could also be attributed to you killing the Dummy too early.

Note that a Dummy unit with these settings can no longer move around. If you need that functionality, like if you're using Dummy units as Missiles (you shouldn't be), then you'll need to re-enable it's Movement settings. But once you do that the Dummy will need to turn to face it's target again. If you MUST use a Dummy as a Missile then it should be used exclusively for that and NOT for casting spells.

A map should really only need 1 Dummy unit that can be used everywhere.
Hi Uncle! :peasant-waving:
Thanks for your help!
Works perfectly!



then just add a condition checking if the caster is targeting themself, and create the dummy 100 units infront like this
This can work too; thanks for the help!
 
Last edited:
Back
Top