• 🏆 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] need help with ability trigger

Status
Not open for further replies.
Level 17
Joined
Aug 19, 2007
Messages
1,380
Hi there, could somebody help me to fix the following trigger, it works except it doesn't summon the Spirit of Vengeance, and I'm aware that there are leaks in it and which they are:
  • Dimension Warp
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Dimension Warp
    • Actions
      • Wait 0.20 seconds
      • Unit - Move (Target unit of ability being cast) instantly to ((Position of (Target unit of ability being cast)) offset by 300.00 towards (Random angle) degrees)
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is dead) Equal to True
        • Then - Actions
          • Unit - Create 1 Spirit of Vengeance for (Owner of (Casting unit)) at (Position of (Dying unit)) facing (Facing of (Dying unit)) degrees
          • Wait 0.10 game-time seconds
          • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Spirit of Vengeance) and do (Actions)
            • Loop - Actions
              • Unit - Set level of Power for (Picked unit) to (2 x (Level of Dimension Warp for (Casting unit)))
        • Else - Actions
          • Do nothing
, thanks for taking the time.
 
Level 8
Joined
Apr 30, 2009
Messages
338
try triggering unit instead of casting unit.

And if you use "starts the effect of an ability" for the event rather than "begins casting an ability," then you don't need the 0.2 wait. When you use "begins casting" it's also exploitable by letting the trigger run without the spell actually being cast, if the player does a stop order.

So always use "a unit starts the effect of an ability" instead of "a unit begins casting an ability"
 
Level 17
Joined
Aug 19, 2007
Messages
1,380
try to save the caster and target of cast into a variable...
the event response of casting unit and target unit of ability being cast won't work after a wait, so it need to be saved into variable.
, yeah it :D worked, thanks so much, I would +rep you if I could.

And if you use "starts the effect of an ability" for the event rather than "begins casting an ability," then you don't need the 0.2 wait. When you use "begins casting" it's also exploitable by letting the trigger run without the spell actually being cast, if the player does a stop order.

So always use "a unit starts the effect of an ability" instead of "a unit begins casting an ability"
, thanks for the tip, +rep

I think the 0.10 wait is pointless, so is that do nothing.

I hope you're aware that if two units cast this spell almost at the same time, it will bug.
, thanks for the tip, +rep
 
Last edited:
Status
Not open for further replies.
Top