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

Detect if a units rally point is on a Unit?

Status
Not open for further replies.
Level 8
Joined
Jul 29, 2010
Messages
319
on my map peasants mine rocks, the rocks are just remodeled units, i'm trying to make it so that when a peasant finishes training and his rally point is on the rock, he auto attacks the rock, so far i've had 0 luck with this although from research i've found that a rally order is recognised as either "smart" or "setrally"

My progress so far, if you even call it progress.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(smart))
          • (Issued order) Equal to (Order(setrally))
    • Actions
      • Set Ordered_Unit = (Ordered unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target unit of issued order)) Equal to Gold Ore
        • Then - Actions
          • Unit - Order Ordered_Unit to Attack (Target unit of issued order)
        • Else - Actions
 
Level 12
Joined
Nov 20, 2007
Messages
660
Do buildings get triggered by
if.gif
(Issued order) Equal to (Order(smart)) ?
If that so you simply have to save all buildings in an array along with the Target unit of issued order (for each one of them) and when a Peasant finishes training you order him to attack that unit.

Let me know if this is helpful.
 
Status
Not open for further replies.
Top