• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Why isn't this working?

Status
Not open for further replies.
Level 10
Joined
Feb 19, 2006
Messages
237
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Climb Tree
    • Actions
      • Unit - Create 1 Dummy Unit for (Owner of (Casting unit)) at (Position of (Target destructible of ability being cast)) facing Default building facing degrees
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Disenchant to (Last created unit)
      • Custom script: call IssueTargetDestructableOrder(bj_lastCreatedUnit, "disenchant", GetSpellTargetDestructable())
that stupid owl caused by this ability is still there when it should be taken out by disenchant...
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
You have to understand few things. Disenchanct is point type spell meaning that you can't order unit to cast it on destructible but first set position of target tree and then call function that orders dummy to disenchant that location.

You are forced to use abilities that target trees by default (there are few exceptions surely) because channel can't target tree ;/
It's great that you use Naish Sentinel spell - because it works properly for this kind of actions.

Additionaly:
- your triggers leaks
- the string order is 'dispel' not 'disenchant'
- you have to consider speed of missle, if it's instant that you can run actions instantly, but if it has some speed (thus there is delay before owl will actually sit on tree) TriggerSleepAction or other 'delay' stuff should be introducted to your trigger.

Next time please add stuff required to test the trigger (trees) and create proper dummy unit =)
 

Attachments

  • TreeClimbTest.w3x
    9.1 KB · Views: 50
Status
Not open for further replies.
Top