1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

TD spawn system help

Discussion in 'Triggers & Scripts' started by Nemitri, Jun 12, 2011.

  1. Nemitri

    Nemitri

    Joined:
    Nov 15, 2010
    Messages:
    29
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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: Jun 14, 2011
  2. MortAr

    MortAr

    Joined:
    Feb 25, 2009
    Messages:
    1,768
    Resources:
    7
    Icons:
    6
    Packs:
    1
    Resources:
    7
    Why don't you save locations into arrays from 1 to 4 and use the custom value as a referrence to them?
     
  3. wyrmlord

    wyrmlord

    Joined:
    Oct 13, 2005
    Messages:
    252
    Resources:
    5
    Tools:
    1
    Maps:
    1
    Tutorials:
    3
    Resources:
    5
    • 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.
     
  4. Nemitri

    Nemitri

    Joined:
    Nov 15, 2010
    Messages:
    29
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Hmm I did create a location array, but its for all four locations of all the players (an array of size 6).

    Like, all region 1 of all 6 players are in a same array.
     
  5. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,474
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Arrays in WC3 are dynamic arrays and thus do not really have a defined size. They do have a maximum of 2^13 indicies though.

    You can use some maths to create a 2D array.
     
  6. demas234

    demas234

    Joined:
    Jun 10, 2011
    Messages:
    2
    Resources:
    0
    Resources:
    0
    how many spawn point do you have?