• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Just a minor problem :)

Status
Not open for further replies.
Level 6
Joined
May 27, 2007
Messages
162
So, is it possible to issue a unit an order (through triggers) like a way-point?

Like, when playing War3, you 'Move' to point A, then hold shift and 'Attack-Move' to point B, your unit will move blindly (ignoring hostiles) to point A, and then reach point B and go aggressive with the 'Attack-Move' towards point B?

Possible through triggers?

Thanks!
 
Level 8
Joined
Aug 21, 2009
Messages
333
I'm 95% sure that the shift-click idea is not supported in the triggers. An alternative to this specific example would be to order the unit to move to the center of a region; then create another trigger that checks for the unit to enter that region and orders that unit to move-attack somewhere else.
 
Level 6
Joined
May 27, 2007
Messages
162
My problem now is this:

Set TempY = (Y of (Position of (Damage source)))
Set TempX = (X of (Position of (Damage source)))

How can I convert TempY + TempX back into a Point variable type?
 
Level 6
Joined
May 27, 2007
Messages
162
  • Harvesting Asteroids
    • Events
    • Conditions
      • (Unit-type of (Damage source)) Equal to Asteroid Miner
      • (Unit-type of (Triggering unit)) Equal to Asteroid
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Damage source) is in AsteroidMiners) Equal to False
        • Then - Actions
          • Unit Group - Add (Damage source) to AsteroidMiners
          • Set TempY = (Y of (Position of (Damage source)))
          • Set TempX = (X of (Position of (Damage source)))
          • Hashtable - Save TempY as (Key y) of (Key (Damage source)) in ReturningAsteroidsHASH
          • Hashtable - Save TempX as (Key x) of (Key (Damage source)) in ReturningAsteroidsHASH
          • Unit - Set the custom value of (Damage source) to ((Custom value of (Damage source)) + 8)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Damage source)) Less than or equal to 150
            • Then - Actions
              • Unit - Set the custom value of (Damage source) to ((Custom value of (Damage source)) + 8)
            • Else - Actions
              • Unit - Order (Damage source) to Move To (Position of Processors[(Player number of (Owner of (Damage source)))])
  • Gold returned to Processors
    • Events
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Asteroid Miner
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Entering unit)) Greater than 0
          • ((Entering unit) is in AsteroidMiners) Equal to True
        • Then - Actions
          • Set TempX = (Load (Key x) of (Key (Entering unit)) from ReturningAsteroidsHASH)
          • Set TempY = (Load (Key y) of (Key (Entering unit)) from ReturningAsteroidsHASH)
          • Set TempPoint = (Point(TempX, TempY))
          • Floating Text - Create floating text that reads (+ + (String((Custom value of (Entering unit))))) at (Position of (Entering unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
          • Floating Text - Change (Last created floating text): Disable permanence
          • Unit - Set the custom value of (Entering unit) to 0
          • Unit - Order (Entering unit) to Attack-Move To TempPoint
          • Hashtable - Clear all child hashtables of child (Key (Entering unit)) in ReturningAsteroidsHASH
          • Unit Group - Remove (Entering unit) from AsteroidMiners
        • Else - Actions

So, this doesn't seem to be working. The unit's just move to center of the playable map area. Can anyone spot the problems?
 
First off, try this:
  • Custom script: set udg_TempX = GetUnitX(GetEventDamageSource())
  • Hashtable - Save (TempX) as (Key x) of (Key(Damage Source)) in ReturningAsreroidsHASH
(The same for the Y value)

In the second trigger, don't use the same variable TempX, TempY (You can do it without variables too).

If it doesn't work, I'm pretty sure it's because you clear the values in the Hashtable without using some kind of timer or... the nasty "wait".
 
Status
Not open for further replies.
Top