• 🏆 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 does not like conditions

Status
Not open for further replies.
Level 17
Joined
Jul 17, 2011
Messages
1,864
[trigger=Untitled Trigger 001]
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Revive Survivor <-- a target ability based off lightning shield

Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Target unit of ability being cast)) Equal to (Unit-type of Archer 0274 <gen>)
Then - Actions
Unit - Create 1 Sylvanas Windrunner for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Else - Actions
[/trigger]

the target unit is a unit of the same type however nothing happens it only works if there are no conditions does any1 know why this event does not work with conditons
 
Level 17
Joined
Jul 17, 2011
Messages
1,864
ok i cant get it to work with starts the effect of an ability either ur supposed to use triggering unit with that right so is triggering unit the caster or the target any way here is what im using
[trigger=d]

Untitled Trigger 001
Events
Unit - A unit Starts the effect of an ability
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to (Unit-type of Lord Garithos 0012 <gen>)
(Unit-type of (Casting unit)) Equal to (Unit-type of Lord Garithos 0012 <gen>)
(Unit-type of (Triggering unit)) Equal to (Unit-type of Archer 0274 <gen>)
(Unit-type of (Target unit of ability being cast)) Equal to (Unit-type of Archer 0274 <gen>)
Then - Actions
Unit - Create 1 Sylvanas Windrunner for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Else - Actions

[/trigger]

archer is the target and garithos is the caster
 
Level 16
Joined
May 1, 2008
Messages
1,605
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lightning Shield
      • (Unit-type of (Target unit of ability being cast)) Equal to Lord Garithos
    • Actions
      • -------- actions here --------
Just replace "Lightning Shield" with your ability. The second condition is a Unit-Type Comparison! When you select the unit type, just pick the unit out of the list at the bottom (of the unit-type window).

Edit: If more unit-types have this ability, but the trigger should be triggered, when only a certain unit type casts it then use:
  • (Unit-type of (Triggering unit)) Equal to Archer
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
Yes it could be considered as a jass bug, but simply when this event fire the response event "target unit of ability being cast" returns null, and also probably GetCastingUnit.
All you can do is to store this response event in some variable when the begin spell event fire, there is a vJass script for that on wc3c.net by Anitarf, and i suppose there is something like that lying here or even on thehelper.net
 
Level 17
Joined
Jul 17, 2011
Messages
1,864
the event begins/finishes casting an ability triggers the actions however if you put the conditions nothing happens because as you said it probably returns null for the target unit and the casting unit. if i remember correctly begins/finishes an ability worked fine in normal we so i will test it and see if thats true
 
Status
Not open for further replies.
Top