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

'attack ground once' order

Status
Not open for further replies.
Level 12
Joined
Sep 11, 2011
Messages
1,176
  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set tempLoc = (Position of Demolisher 0002 <gen>)
      • Unit - Order Demolisher 0002 <gen> to Attack Ground (tempLoc offset by 300.00 towards (Facing of Demolisher 0002 <gen>) degrees)
      • Custom script: call RemoveLocation(udg_tempLoc)
like this ?

EDIT: oh, you want the order to be only once. let's see..
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set WriteIndex = (WriteIndex + 1)
      • Set Catapults[WriteIndex] = (Triggering unit)
      • Set tempLoc = (Position of Catapults[WriteIndex])
      • Set tempLoc2 = (tempLoc offset by 300.00 towards (Facing of Catapults[WriteIndex]) degrees)
      • Unit - Order Catapults[WriteIndex] to Attack Ground tempLoc2
      • Custom script: call RemoveLocation(udg_tempLoc)
      • Custom script: call RemoveLocation(udg_tempLoc2)
      • Wait 3.00 seconds
      • Set ReadIndex = (ReadIndex + 1)
      • Unit - Order Catapults[ReadIndex] to Stop
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ReadIndex Equal to WriteIndex
        • Then - Actions
          • Set ReadIndex = 0
          • Set WriteIndex = 0
        • Else - Actions
I'm using MUI Waits fyi.
 
Level 23
Joined
Oct 18, 2008
Messages
938
mui waits seems pretty interesting as I always took wait to be a function never intended to work in any way, but I guess using it this way would.

for the idea itself, it's obvious it can be done this way but there are many potential issues. attack speed modifications could make the wait imprecise, there could be walking between the command and beginning of the attack, or the player might want to cancel the order to do something else and then have the unit stopped by the trigger anyway.

might end up having to do it this way but that trigger would at least need some fine tuning, if nothing else.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
true true.. It would be helpful if you provide a scenario, but I just gave a rough idea on how I would do what you want. Ofc it needs improvement.

EDIT: I wonder why you would want to order the unit via trigger if the player could control the unit.
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
I'm not so sure? You want a unit to attack ground once and you're not controling that unit, right?
If yes, it's can be done by trigger, once that unit attack the ground once you could just order that to stop/pause...
I'm not sure if this is what do you mean?
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Hey, I found a solution to the

walking between the command and beginning of the attack, or the player might want to cancel the order to do something else and then have the unit stopped by the trigger anyway.

this

  • Untitled Trigger 002
    • Events
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Not equal to (Order(Attack Ground))
    • Actions
      • For each (Integer IntegerVariable) from 1 to WriteIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Catapults[IntegerVariable]
            • Then - Actions
              • Set Catapults[IntegerVariable] = No unit
            • Else - Actions
this will nullify the catapult who get ordered to do something else from the Index therefore the catapult won't stop without reason.

EDIT : And for the

attack speed modifications could make the wait imprecise

you would want to keep each unit's Base Attack Time, and keep each attack speed buffs which is too tedious of a work :/

EDIT 2 : actually, if you don't really want to use MUI Waits, there is another alternative, which is using hashtables or GUI Unit Indexer
 
Last edited:
Level 23
Joined
Oct 18, 2008
Messages
938
locusts are the crypt lord's ulti summons that aren't clickable that are popularly used as dummies in spells. my experiments showed they can be attacked by a unit if that unit is allowed to target invulnerable units and is ordered to do so by a trigger.

I just need to remove the unit's model and it will be neither visible nor selectable and attacking it will be in effect same as attacking ground.
 
Status
Not open for further replies.
Top