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

Problem with trigger (Attacking unit)

Status
Not open for further replies.
Level 8
Joined
Jul 3, 2004
Messages
404
well, i want unit A to attack unit B through a trigger, but, the unit only walks down to it and turns away.
This unit A is a Mortar Team, and i want him to use the ranged Mortar Missile. i have no idea what i am doing wrong.

These units he is supposed to attack are dummies that are Paused and hided through a trigger, also added to a Unit Group variable

(Ini trigger)
  • TCB Boss Ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type TCB Target Dummy) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to TCB_Target_Dummy
          • Unit - Hide (Picked unit)
          • Unit - Pause (Picked unit)
      • Trigger - Run Crazy Shooting <gen> (ignoring conditions)
----------------------------------------------------------------------
Crazy Shooting Trigger
  • Crazy Shooting
    • Events
    • Conditions
    • Actions
      • Trigger - Turn on Explosive Damage <gen>
      • Unit - Order Mortar Team 0011 <gen> to Attack Once (Random unit from TCB_Target_Dummy)
      • Set TCB_Crazy_Shooting[1] = (TCB_Crazy_Shooting[1] + 1)
      • Wait 2.50 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TCB_Crazy_Shooting[1] Equal to 9
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Trigger - Run Crazy Shooting <gen> (ignoring conditions)
          • Wait 0.10 seconds
          • Special Effect - Destroy (Last created special effect)
 
Last edited:
Level 9
Joined
Jun 18, 2004
Messages
565
How far away is the mortar team? If he's too close, and thus within his minimum range, chances are he wouldn't attack.

And, for future reference, you can use the trigger command to add in triggers to your post, like so...
  • Test
    • Events
      • Unit - A unit Makes a post
    • Conditions
      • (Triggering site) Equal to (hiveworkshop.com)
    • Actions
      • Trigger - Run (TriggerCode) (checking conditions)
Right click the very top of any trigger (right above "Events") and put it in a post to have it show.
 
Status
Not open for further replies.
Top