• 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.

How to make creeps attack to a location just like dota?

Status
Not open for further replies.
Level 4
Joined
Aug 7, 2010
Messages
77
My current simple idea is, to make use of triggers by selecting all creep sprawning buildings and create troops and set use rally points to the opponent's main town hall.

Also, i will be puting regions on the "attacking path" with the commands of "if units belongs to player X enter this regions, 'attack & move to' the opponent's main town hall.

I know that my ideas are just the basic. So i'm seeking you all's suggestions on how to improve on my idea. Thanks in advance
 
If you are too lazy to open map ( :SSSSS):

Simply use trigger actions found in Unit section.

- Issue Order Targeting A Point -> move, spells, patrol
- Issue Order Targeting A Unit -> attack, spells
- Issue Order Targeting A Item -> ^above for items
- Issue Order No Target -> stop, hold position, spells

You should use the first one.
  • Unit - Order yourUnit to move to <your location>
Don't forgot about removing leaks afterwards!

However, if units are spawned from buildings (aka Train), there is also action Unit - Set rally point via which you can set destrination of units trained by that building.
 
Level 2
Joined
Aug 3, 2011
Messages
12
Create a UnitGroup Variable, add the newly trained units to that variable, Issue Order targeting a point. That way you can use that group for future commands instead of - "if units belongs to player X enter this regions, 'attack & move to' the opponent's main town hall." if you wish to ditch that system

Hope it Helped ;-)
 
Level 4
Joined
Aug 7, 2010
Messages
77
Create a UnitGroup Variable, add the newly trained units to that variable, Issue Order targeting a point. That way you can use that group for future commands instead of - "if units belongs to player X enter this regions, 'attack & move to' the opponent's main town hall." if you wish to ditch that system

Hope it Helped ;-)

UnitGroup Variable? how to set that? sry i a noob.
 
Level 2
Joined
Aug 3, 2011
Messages
12
First, open the Trigger Editor. Then, press Ctrl + B, OR go to Edit --> Variables at the Menu
Then, press Ctrl + N, OR press the Green 'X', New Variable
Set the Variable Type to- Unit Group
Set Variable Name to Whatever you want (in this case, I'll set it to UnitGroupName)
Make sure the Array Box is UNCHECKED and Initial Value is Empty Unit Group

then create this trigger

  • Trigger1
  • Events
  • Unit - A unit Finishes training a unit
  • Conditions
  • (Unit-type of (Trained unit)) Equal to Footman
  • (Owner of (Trained unit)) Equal to Player 1 (Red)
  • Actions
  • Unit Group - Add (Trained unit) to UnitGroupName
Note- The UnitGroupName is the Variable

Done. Now, whenever you want to issue a command to that group, just use the variable.

  • Unit Group - Pick every unit in UnitGroupName and do (Unit - Order (Picked Unit) to Move To (Center of (Region Name Here)))
You can also create more than 1 variable of that type, just set a different name, like, Group1, Group2, etc..

Hope it helped ;)
 
Level 4
Joined
Aug 7, 2010
Messages
77
@coach: many thanks for your unit group guide.

@spinnaker: is there such a function called attack/move to/spell? i mean i can onli find attack/move to in the category.

another problem is i found out that when charging units finished casting a spell, they refuse to charge anymore and begin to stone.

shall i add the following simple triggers to prevent this?

(event) when units finished cast a spell
(condition) units owned by player 1
(action) order triggered units to attack/move to region x.

thanks all for replying in this thread :)
 
@kaiserimpact Yes, its the Issue Order Targetting a Point, and since some spells target a point too this action refers to them too:

  • Unit - Order (Triggering unit) attack move to (Center of (Region Name Here))
And the same action, but for issuing spell order:
  • Unit - Order (Triggering unit) Orc: Far Seer - Earthquake to (Center of (Region Name Here))
 
Status
Not open for further replies.
Top