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

[Solved] How to Spawn creep's and set creep's to point??

Status
Not open for further replies.
Level 8
Joined
Jul 3, 2011
Messages
251
I believe what DotA does is just have a peridoic timer ticking every xx seconds, then create... Say 1 treant, 1 druid and 1 glaive thrower then order last created unit to patrol to <region> then create an event, a unit enters <said region> with the condition unit type of triggering unit equal to <sentinel unit types here> order triggering unit to patrol to <new region here> that is how DotA gets their creeps to move to multiple places, however they could just have multiple groups, pick units in them and order those units to attack-move to a region, then when they enter it remove it from 1 group and add to another. However, either method works fine.
 
Level 8
Joined
Jul 3, 2011
Messages
251
Well if you only have 1 region you want the units to move to, you can do this (note, if there is no final structure to kill to win the game (like the throne/world tree in DotA) then the creeps will not be able to attack anything and will patrol back to where they were created.
  • Untitled Trigger 001
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set p = (Center of Region 000 <gen>)
      • Set p2 = (Center of Region 001 <gen>)
      • Unit - Create 1 Footman for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Unit - Create 1 Rifleman for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Unit - Create 1 Flying Machine for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Custom script: call RemoveLocation(udg_p)
      • Custom script: call RemoveLocation(udg_p2)
 
Level 8
Joined
Jul 3, 2011
Messages
251
A patrol order will make the unit move towards the region but attack any enemies it comes across on the way, once the attacked unit dies, it will automatically continue moving to where you set the patrol to.
 
Level 7
Joined
Jan 29, 2010
Messages
213
  • Untitled Trigger 001
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set p = (Center of Region 000 <gen>)
      • Set p2 = (Center of Region 001 <gen>)
      • Unit - Create 1 Footman for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Unit - Create 1 Rifleman for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Unit - Create 1 Flying Machine for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Custom script: call RemoveLocation(udg_p)
      • Custom script: call RemoveLocation(udg_p2)

When unit gets stuned, rooted or something like that witch stops his movement, it won't move any more.
SO change trigger to this one:
  • Untitled Trigger 001
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set p = (Center of Region 000 <gen>)
      • Set p2 = (Center of Region 001 <gen>)
      • Unit - Create 1 Footman for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Unit - Create 1 Rifleman for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Unit - Create 1 Flying Machine for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Unit Group - Pick every unit (units owned by Player 1 (Red)), order "picked unit" to patrol to p2
      • Custom script: call RemoveLocation(udg_p)
      • Custom script: call RemoveLocation(udg_p2)
 
Level 8
Joined
Jul 3, 2011
Messages
251
When unit gets stuned, rooted or something like that witch stops his movement, it won't move any more.
SO change trigger to this one:
  • Untitled Trigger 001
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set p = (Center of Region 000 <gen>)
      • Set p2 = (Center of Region 001 <gen>)
      • Unit - Create 1 Footman for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Unit - Create 1 Rifleman for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Unit - Create 1 Flying Machine for Player 1 (Red) at p facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To p2
      • Unit Group - Pick every unit (units owned by "player x"), order "picked unit" to patrol to p2
      • Custom script: call RemoveLocation(udg_p)
      • Custom script: call RemoveLocation(udg_p2)

I made those triggers in a hurry, but what you have put can cause the units to attack a different unit, and also unit groups leak, you would need to put set bj_wantDestroyGroup = true before the creation of the group, or set it as a variable and call DestroyGroup(udg_GroupName)
 
Status
Not open for further replies.
Top