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

[Solved] Issue order Attack once not working

Status
Not open for further replies.
Level 3
Joined
Jul 21, 2010
Messages
31
So I have two triggers that use Issue Unit Order Targeting a Unit.

The first is when casting an ability:

  • AttackAbility
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Attack
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Cinematic - Clear the screen of text messages for (All players)
          • Quest - Display to (All players) the Quest Update message: ((Marhand + Attacks ) + (Name of EnemyUnit[1]))
          • Unit - Set PlayerUnit movement speed to 522.00
          • Unit - Order PlayerUnit to Attack Once EnemyUnit[1]
          • Wait ((Distance between (Position of PlayerUnit) and (Position of EnemyUnit[1])) / (Current movement speed of PlayerUnit)) seconds
          • Floating Text - Create floating text that reads ((String((Base Damage of (Triggering unit) for weapon index 0))) + damage!) above EnemyUnit[1] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Wait 1.00 seconds
          • Unit - Order PlayerUnit to Attack Ground templocAttack[7]
          • Wait ((Distance between (Position of PlayerUnit) and (Position of EnemyUnit[1])) / (Current movement speed of PlayerUnit)) seconds
          • Wait 1.00 seconds
          • Unit - Make PlayerUnit face templocAttack[6] over 0.00 seconds
          • Unit - Set PlayerUnit movement speed to (Default movement speed of PlayerUnit)
          • Floating Text - Destroy (Last created floating text)
          • Trigger - Run RoundSystem <gen> (checking conditions)
        • Else - Actions
This works fine and it executes each line correctly.

However, I have another version for a trigger that is simply run and checks for an integer condition:

  • GuardAI
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AIAction Equal to 1
        • Then - Actions
          • Cinematic - Clear the screen of text messages for (All players)
          • Quest - Display to (All players) the Quest Update message: (((Name of EnemyUnit[1]) + Attacks ) + Marhand)
          • Unit - Set EnemyUnit[1] movement speed to 522.00
          • Unit - Order EnemyUnit[1] to Attack Once PlayerUnit
          • Wait ((Distance between (Position of PlayerUnit) and (Position of EnemyUnit[1])) / (Current movement speed of EnemyUnit[1])) seconds
          • Floating Text - Create floating text that reads ((String((Base Damage of EnemyUnit[1] for weapon index 0))) + damage!) above PlayerUnit with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Wait 2.00 seconds
          • Unit - Order EnemyUnit[1] to Move To templocAttack[6]
          • Wait ((Distance between (Position of PlayerUnit) and (Position of EnemyUnit[1])) / (Current movement speed of EnemyUnit[1])) seconds
          • Wait 1.00 seconds
          • Unit - Set EnemyUnit[1] movement speed to (Default movement speed of EnemyUnit[1])
          • Unit - Make EnemyUnit[1] face templocAttack[7] over 0.00 seconds
          • Floating Text - Destroy (Last created floating text)
          • Trigger - Run RoundSystem <gen> (checking conditions)
        • Else - Actions
With this trigger, however, the unit simply runs to the locaiton of the PlayerUnit, executes the floating text, but does not issue the attack once order nor does it wait for 2 seconds, instead it simply runs back executing the rest of the trigger.

Interestingly, for some reason it seems to run back to its starting position rather than the set region.

I have checked all areas I could think of if anything external is causing this trigger to fail, but i cannot see it.

I will upload the map if need be, but can anyone see any issue that I cant?
 

Attachments

  • Regions.JPG
    Regions.JPG
    71.8 KB · Views: 59
Level 3
Joined
Jul 21, 2010
Messages
31

So just to show what is happening. Depending on the distance the command Issue Order Targeting a Unit for some reason sometimes issues the unit to attack and sometimes does not. Now There is a custom model imported, could this be the cause?
 
Level 3
Joined
Jul 21, 2010
Messages
31
Figured it out. Apparently setting the elevation - sample radius to 0 causes the trigger sometimes to bug out.
 
Status
Not open for further replies.
Top