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

Spawning and Moving Units

Status
Not open for further replies.
Level 2
Joined
Jul 28, 2011
Messages
21
This is pretty much the final thing I need to know before I can complete my map.

I want to spawn units similar to how an AoS style map is, but with a different layout. I've provided two diagrams. The first diagram is a rough sketch. I'm assuming that commands to move units move them in straight lines though, so I've provided a second diagram to help show how it might work.

2qn6tdd.jpg


2cd96yr.jpg


Red, Blue, and Brown/Neutral are all meant to be hostile towards eachother. I want to be able to get 3 units spawn in each starting location and move to their desired location for as long as the game lasts (infinitely).

I also want the units to attack eachother when they meet up.

What are the commands I do, and how do I set it all?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
  • Spawn and Move
    • Events
      • Time - Every {X} seconds of game time
    • Conditions
    • Actions
      • Set tempLoc1 = (Center of {Your Area})
      • Set tempLoc2 = (Center of {Enemy Area})
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Unit - Create 1 {Unit Type} for {Player} at tempLoc1 facing 0.00 degrees
          • Unit - Order (Last created unit) to Attack-Move To tempLoc2
      • Custom script: call RemoveLocation(udg_tempLoc1)
      • Custom script: call RemoveLocation(udg_tempLoc2)
That should work, I cannot derive anything else from your post.
This is for a single spawn (of 3 units), you can copy/paste the actions (not trigger) and place them below these. Change the regions and players and you're done.
 
Level 2
Joined
Jul 28, 2011
Messages
21
  • Spawn and Move
    • Events
      • Time - Every {X} seconds of game time
    • Conditions
    • Actions
      • Set tempLoc1 = (Center of {Your Area})
      • Set tempLoc2 = (Center of {Enemy Area})
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Unit - Create 1 {Unit Type} for {Player} at tempLoc1 facing 0.00 degrees
          • Unit - Order (Last created unit) to Attack-Move To tempLoc2
      • Custom script: call RemoveLocation(udg_tempLoc1)
      • Custom script: call RemoveLocation(udg_tempLoc2)
That should work, I cannot derive anything else from your post.
This is for a single spawn (of 3 units), you can copy/paste the actions (not trigger) and place them below these. Change the regions and players and you're done.

I'll try this out and see how it works.
 
Status
Not open for further replies.
Top