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

TD spawn system help

Status
Not open for further replies.
Level 3
Joined
Nov 15, 2010
Messages
30
Hello

I have a problem, I don't clearly know how to make a spawn system to move creeps from multiple points.

The map is mazeish.
The problem is the creeps must move from initial spawn point to 4 different points in order and only once, if a unit enters a point not in order it has no effect until it goes to the right one, each time a unit enters a point, it regains 10% of its max hp. once the unit reaches the 4th point, it explodes, taking a life with it.

The problem stems from my inability to make it go from one place to another.

So far I have this set up with custom values, but I feel lost.
  • Player 1 Initial Move
    • Events
      • Unit - A unit enters Player 1 Spawner <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
      • Or - Any (Conditions) are true
        • Conditions
          • (Custom value of (Triggering unit)) Not equal to 1
          • (Custom value of (Triggering unit)) Not equal to 2
          • (Custom value of (Triggering unit)) Not equal to 3
    • Actions
      • Unit - Order (Triggering unit) to Move To (Center of Player 1 North East Checkpoint 1 <gen>)
  • Player 1 Move from first to second
    • Events
      • Unit - A unit enters Player 1 North East Checkpoint 1 <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
      • Or - Any (Conditions) are true
        • Conditions
          • (Custom value of (Triggering unit)) Not equal to 1
          • (Custom value of (Triggering unit)) Not equal to 2
          • (Custom value of (Triggering unit)) Not equal to 3
    • Actions
      • Unit - Set the custom value of (Triggering unit) to 1
      • Unit - Order (Triggering unit) to Move To (Center of Player 1 South East Checkpoint 2 <gen>)
 
Last edited by a moderator:
Level 11
Joined
Oct 13, 2005
Messages
233
  • Or - Any (Conditions) are true
  • Conditions
  • (Custom value of (Triggering unit)) Not equal to 1
  • (Custom value of (Triggering unit)) Not equal to 2
  • (Custom value of (Triggering unit)) Not equal to 3
The above condition will always be true. What you want to do is instead assign each region a number. Setting up each region in an array like MortAr suggested helps with this. When an enemy enters one of the regions, check to make sure that the unit's custom value matches the region's value. So if a unit is heading towards Region#1, it's custom value should also be 1. When entering region#1, change the custom value to 2 and order it to move to region #2. Repeat this for all the regions and you should be set.
 
Status
Not open for further replies.
Top