• 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.

[Solved] I need help with triggers for Impale

Luu

Luu

Level 6
Joined
Feb 11, 2021
Messages
45
Well, I imagine it's a simple trigger, but I don't have much experience in this area, so I wanted to clear up this doubt.

I made a skill based on Impale called Monkey King Bar for my custom hero, Wukong, and I would like to use a dummy to cast the skill, because when I use an animation model for this skill in Art - Caster, I notice that the model gets stuck to Wukong for a few moments and then the animation ends. This generates a weird visual bug. So I would like a dummy to use the skill so that the animation is more harmonious and natural for my proposal.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
This should work. Impale (Wukong) is a "fake" ability that has no effects and Impale (Dummy) is the actual Impale ability:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Impale (Wukong)
  • Actions
    • Unit - Create 1 Dummy for (Triggering player) at (Position of (Triggering unit))
    • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
    • Unit - Add Impale (Dummy) to (Last created unit)
    • Unit - Set Level of Impale (Dummy) for (Last created unit) to (Level of (Ability being cast))
    • Unit - Order (Last created unit) to Undead - Impale (Target point of ability being cast)
However, the original Impale ability can target either a point (the ground) or a unit. It's up to you whether you carry this mechanic over to Impale (Wukong) since that ability will determine the targeting.

Here's how you can differentiate between the two types of targeting (point/unit) if need be:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Impale (Wukong)
  • Actions
    • Unit - Create 1 Dummy for (Triggering player) at (Position of (Triggering unit))
    • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
    • Unit - Add Impale (Dummy) to (Last created unit)
    • Unit - Set Level of Impale (Dummy) for (Last created unit) to (Level of (Ability being cast))
    • 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
        • Unit - Order (Last created unit) to Undead - Impale (Target point of ability being cast)
      • Else - Actions
        • Unit - Order (Last created unit) to Undead - Impale (Position of (Target unit of ability being cast))
How to create a proper Dummy unit:
Step 1) Copy and paste the Locust.
Step 2) Set it's Model = None, Shadow = None, Attacks Enabled = None, Movement Type = None, Speed Base = 0.
Step 3) OPTIONAL - Use a custom Dummy model and modify the Locust's Art fields by setting pretty much everything to 0.00. This allows all art related effects to play properly.

Note:
These triggers have memory leaks. This is not something you need to concern yourself with if you're still learning but I feel obligated to mention it.
 
Last edited:

Luu

Luu

Level 6
Joined
Feb 11, 2021
Messages
45
I tried here, but it didn't work :confused:2

That's the problem, I would like the dummy to cast the skill to avoid this bug with the animation of the staff falling attached to Wukong.
 

Attachments

  • 2024-08-25 14-11-36 (online-video-cutter.com).mp4
    1.8 MB
Level 25
Joined
Mar 29, 2020
Messages
1,466
the idea of using the dummy is that the dummy unit is the one casting the real spell, not monkey king.

what the trigger uncle gave you does is detect when wukong casts the fake ability, and makes the dummy then use the real ability on the same target. currently, wukong is casting the MKB ability, and then a dummy is also casting standard impale on the same target.

you need to first create an ability based on the channel ability that does nothing besides targeting a unit/ground. you also need to give it the icon you want etc. this ability should do nothing on it's own. it should have all the tooltips for the real ability since this is what the player will see, but behind the scenes this is a fake ability.

then, the ability that is currently called monkey king bar should be the ability that you are giving the dummy in the trigger.
 

Luu

Luu

Level 6
Joined
Feb 11, 2021
Messages
45
the idea of using the dummy is that the dummy unit is the one casting the real spell, not monkey king.

what the trigger uncle gave you does is detect when wukong casts the fake ability, and makes the dummy then use the real ability on the same target. currently, wukong is casting the MKB ability, and then a dummy is also casting standard impale on the same target.

you need to first create an ability based on the channel ability that does nothing besides targeting a unit/ground. you also need to give it the icon you want etc. this ability should do nothing on it's own. it should have all the tooltips for the real ability since this is what the player will see, but behind the scenes this is a fake ability.

then, the ability that is currently called monkey king bar should be the ability that you are giving the dummy in the trigger.
Thank you for clarifying, I will try to do that and if anything happens I will talk to you again, thank you again for your attention :thumbs_up:
 

Luu

Luu

Level 6
Joined
Feb 11, 2021
Messages
45
The dummy is not using the skill, can you find out why?

I created a fake ability based on channel, placed the icons and tooltips. If you can find where I'm going wrong, I'd really appreciate it.
 

Attachments

  • Dark Forest Wukong Test.w3x
    16.4 MB · Views: 7

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
The dummy is not using the skill, can you find out why?

I created a fake ability based on channel, placed the icons and tooltips. If you can find where I'm going wrong, I'd really appreciate it.
A Dummy unit has all of the same restrictions as any normal unit. That means Cast Range, Mana Cost, Requirements, Targets Allowed ALL need to be setup so that the Dummy doesn't have any issues casting the spell.

Also, your Dummy unit should be based on the Locust, with it's Movement Type = None, Attacks Enabled = None, and Speed Base set to 0.
 

Luu

Luu

Level 6
Joined
Feb 11, 2021
Messages
45
A Dummy unit has all of the same restrictions as any normal unit. That means Cast Range, Mana Cost, Requirements, Targets Allowed ALL need to be setup so that the Dummy doesn't have any issues casting the spell.

Also, your Dummy unit should be based on the Locust, with it's Movement Type = None, Attacks Enabled = None, and Speed Base set to 0.
I'm doing this. Did you notice any problems with the trigger I made?
 

Luu

Luu

Level 6
Joined
Feb 11, 2021
Messages
45
  • Monkey King Bar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Monkey King Bar (Channel)
    • Actions
      • Unit - Create 1 Dummy for (Triggering player) at (Position of (Triggering unit)) facing (Position of (Triggering unit))
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Monkey King Bar (Dummy) to (Last created unit)
      • Unit - Set level of Monkey King Bar (Dummy) for (Last created unit) to (Level of (Ability being cast) for (Triggering unit))
      • Unit - Order (Last created unit) to Undead Crypt Lord - Impale (Target point of ability being cast)
It's working, the issue is that the animation of the staff falling doesn't appear because the dummy is invisible and this animation is stuck to him in Art - Caster.

Is there any way to make the dummy not appear and the staff animation appear?
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Now I understand what you wanted. You don't need a Dummy unit, you just want to create the Boundless Strike special effect at the position of the caster + facing the target point rather than it be attached to the caster.
  • Monkey King Bar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Monkey King Bar
    • Actions
      • -------- Get offsets: --------
      • Set VariableSet MKB_Point[0] = (Position of (Triggering unit))
      • Set VariableSet MKB_Point[1] = (Target point of ability being cast)
      • Set VariableSet MKB_Angle = (Angle from MKB_Point[0] to MKB_Point[1])
      • Set VariableSet MKB_Point[2] = (MKB_Point[0] offset by 100.00 towards MKB_Angle degrees.)
      • -------- --------
      • -------- Boundless Strike: --------
      • Special Effect - Create a special effect at MKB_Point[0] using war3mapImported\BoundlessStrike-1.mdx
      • Special Effect - Set Yaw of (Last created special effect) to: (Radians(MKB_Angle))
      • Special Effect - Destroy (Last created special effect)
      • -------- --------
      • -------- War Stomp: --------
      • Special Effect - Create a special effect at MKB_Point[2] using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- --------
      • -------- Clean up memory leaks: --------
      • Custom script: call RemoveLocation( udg_MKB_Point[0] )
      • Custom script: call RemoveLocation( udg_MKB_Point[1] )
      • Custom script: call RemoveLocation( udg_MKB_Point[2] )
I also fixed your Dummy unit. It doesn't need to be a Hero and it's Movement Type should be set to None and Speed Base set to 0.
 

Attachments

  • Dark Forest Wukong Test Fix1.w3x
    16.4 MB · Views: 10

Luu

Luu

Level 6
Joined
Feb 11, 2021
Messages
45
Now I understand what you wanted. You don't need a Dummy unit, you just want to create the Boundless Strike special effect at the position of the caster + facing the target point rather than it be attached to the caster.
  • Monkey King Bar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Monkey King Bar
    • Actions
      • -------- Get offsets: --------
      • Set VariableSet MKB_Point[0] = (Position of (Triggering unit))
      • Set VariableSet MKB_Point[1] = (Target point of ability being cast)
      • Set VariableSet MKB_Angle = (Angle from MKB_Point[0] to MKB_Point[1])
      • Set VariableSet MKB_Point[2] = (MKB_Point[0] offset by 100.00 towards MKB_Angle degrees.)
      • -------- --------
      • -------- Boundless Strike: --------
      • Special Effect - Create a special effect at MKB_Point[0] using war3mapImported\BoundlessStrike-1.mdx
      • Special Effect - Set Yaw of (Last created special effect) to: (Radians(MKB_Angle))
      • Special Effect - Destroy (Last created special effect)
      • -------- --------
      • -------- War Stomp: --------
      • Special Effect - Create a special effect at MKB_Point[2] using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- --------
      • -------- Clean up memory leaks: --------
      • Custom script: call RemoveLocation( udg_MKB_Point[0] )
      • Custom script: call RemoveLocation( udg_MKB_Point[1] )
      • Custom script: call RemoveLocation( udg_MKB_Point[2] )
I also fixed your Dummy unit. It doesn't need to be a Hero and it's Movement Type should be set to None and Speed Base set to 0.
I am immensely grateful for your dedication in helping me. I hope that with this everyone who plays Wukong on my map can have a great visual experience. I'm very happy, man :thumbs_up:
 
Top