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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Let your favorite entries duke it out in the 15th Techtree Contest Poll.
    Dismiss Notice
  4. Weave light to take you to your highest hopes - the 6th Special Effect Contest is here!
    Dismiss Notice
  5. 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,765
    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:
    26,046
    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?