• 🏆 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!

Help with channel based ability only working on second time casted

Status
Not open for further replies.
Level 9
Joined
Jun 10, 2013
Messages
473
Hey >:D as said in the title I have an ability based on channel which spawns a tree (destructible) at a target point and healing allies at the point by a set amount (based on custom dummy casted heal) and increasing their armor for 30 seconds (based on custom dummy casted inner fire) which works perfectly but..... only the second time it is casted :/ the trigger is below and any help on what I find to be truly puzzling would be much appreciated and will go along way to helping me finish my up coming treant race based map :)


  • Natures Blessing
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Nature's Blessing
    • Actions
      • Set Unit_Caster = (Triggering unit)
      • Set tempPoint1 = (Position of (Last created destructible))
      • Set TempPoint2 = (Target point of ability being cast)
      • Set Player_Owner = (Owner of Unit_Caster)
      • Set AbilityAdd = Nature's Blessing armor bonus
      • Set AbilityAdd2 = Nature's Blessing hitpoint grant
      • Destructible - Create a Summer Tree Wall at TempPoint2 facing (Random angle) with scale 1.00 and variation 0
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 650.00 of tempPoint1 matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of Player_Owner) Equal to True) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Spellcaster for Player_Owner at tempPoint1 facing Default building facing degrees
          • Unit - Add AbilityAdd to (Last created unit)
          • Unit - Add AbilityAdd2 to (Last created unit)
          • Unit - Order (Last created unit) to Human Priest - Inner Fire (Picked unit)
          • Unit - Order (Last created unit) to Human Priest - Heal (Picked unit)
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_tempPoint1)
 
Level 9
Joined
Jun 10, 2013
Messages
473
SOLVED ! I have solved the issue by turning the above 1 trigger into the following 2

  • Natures Blessing tree spawn
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Nature's Blessing
    • Actions
      • Set TempPoint2 = (Target point of ability being cast)
      • Destructible - Create a Summer Tree Wall at TempPoint2 facing (Random angle) with scale 1.00 and variation 0
      • Custom script: call RemoveLocation(udg_TempPoint2)
  • Natures Blessing effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Nature's Blessing
    • Actions
      • Set Unit_Caster = (Triggering unit)
      • Set TempPoint2 = (Target point of ability being cast)
      • Set Player_Owner = (Owner of Unit_Caster)
      • Set AbilityAdd = Nature's Blessing armor bonus
      • Set AbilityAdd2 = Nature's Blessing hitpoint grant
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 650.00 of TempPoint2 matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of Player_Owner) Equal to True) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Spellcaster for Player_Owner at TempPoint2 facing Default building facing degrees
          • Unit - Add AbilityAdd to (Last created unit)
          • Unit - Add AbilityAdd2 to (Last created unit)
          • Unit - Order (Last created unit) to Human Priest - Inner Fire (Picked unit)
          • Unit - Order (Last created unit) to Human Priest - Heal (Picked unit)
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempPoint2)
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
The problem was that you use "Set tempPoint1 = (Position of (Last created destructible))" before you actually made the destructable.
You dont need 2 triggers for this, just make sure that that "set tempPoint1" is below "Create destructable"
 
Status
Not open for further replies.
Top