SC2Mapster Forums

Development > Triggers

How to put previous wave units (1 each) into 1 wave

  • 6 posts
    #1 Nov 05, 2012 at 20:21 UTC - 0 likes

    Hi,

    This is a td game I'm making and want to spawn all the previous wave units ( 1 each) on my last wave.

    I need help on this, if someone knows plz reply !

    Thx very much!

    #2 Nov 06, 2012 at 06:57 UTC - 1 like

    Create a unit type array.

    (you can also use this for rounds, but I digress)

    add each unit type of every unit ever spawned.

    at the last round pick each integer or for each integer (for the purposes of this little explanation, I'll be using pick each integer, but both should work.)

    Create unit UnitArray[Picked Integer] at SpawnPoint.

    You can also add these units to the array as each round starts or finishes, to save time and energy.

    Last edited Nov 06, 2012 by Yaksmanofage
    #3 Nov 08, 2012 at 21:42 UTC - 0 likes

    @Yaksmanofage: Go

    Thx a lot! Althogh I didn't try it out yet it makes a lot of sence !

    Other issue i have is that i dont want to set the life for each wave unit in the data, I rather make a multiplyer in trigger somehow.. Someting like this :

    I set wave 1 units life to lets say 100 ( through unit properties trigger I assume) so the first wave unit would have 100 life, than i'd like to multiply this with 1.2 for the next wave and I want to muliply wave 2's wich would be (100x1.2=)120 with 1.2 wich than be (120x1.2=)144 for wave 3 and so on ..

    I want to do it this way so I can make different difficulty lvls a lot easier since all i would need to change is the 1st wave's life to lets say 80 for easy mode ( wave 2 would have 96 life ) and 120 for hard mode ( wave 2 would have 144 life ) and 100 would correspond to normal mode ( wave 2 would have 120 life ).

    Is this achievable?

    #4 Nov 09, 2012 at 02:33 UTC - 0 likes

    @ElBushido: Go

    Yes.

    I'll attach a map in a moment which will explain the process.

    I haven't tried all units, but it should work.

    There are two ways to use it:

    1. increasing the multiplication constant and not the health each "round"

    2. increasing the health but not the multiplication constant each "round"

    I wasn't sure which one you wanted. They both work virtually the same, the value produced is just different.

    Last edited Nov 09, 2012 by Yaksmanofage
    Name Size MD5
    testmap.SC2Map 14.5 KiB 086bf31ea31d...
    #5 Nov 09, 2012 at 16:43 UTC - 0 likes

    @Yaksmanofage: Go

    Thx a lot for the tip !

    i want to make the 1 where the multiplication stays the same, but the health changes kinda like a chain reaction.

    So if i set the 1st waves health to 100 and multiply that with 1.2 for wave 2 -wich = 120- will it remember wave 2's health and multiply that amount with 1.2 for wave 3 -wich is 144 (120*1.2) , than will it remember wave 3's health and multiply that with 1.2 for wave 4 - that would come to 173- and so on or i have to add that to"health max" like so?:

    health max [1]=100, health max[2]=120, health max[3]=144, health max[4]=173 and so on?

    Last edited Nov 09, 2012 by ElBushido
    #6 Nov 09, 2012 at 18:19 UTC - 0 likes

    @ElBushido: Go

    well no, if we are remembering health regardless of units you'll need to store that in a global variable. Then you change the catalog value of the spawned unit to be = the stored variable times the multiplication constant or change the stored value each round to be equal to the old value x 1.2, then just apply the constant as the health value via catalogs.

    Name Description Size MD5
    testmap.SC2Map made default to show what I mean 14.9 KiB d704bb96a380...
  • 6 posts

You must login to post a comment. Don't have an account? Register to get one!