In this TD we want the spawn to be based off of the bounty you can get per round. lets say 20... We have different units that have different values.. It would randomly pick those units and those values would add up to 20.
Example.
Boss=3
Tanks=2
Flying=2
others=1
so maybe one round a boss(+3) no tanks 5 flying (+10) and 7 other (+7) would equal 20. But. for some reason it works like a charm for the first couple rounds but after words they spawn in groups. So we started to see if we did the trigger right. So we maybe it after the round starts it would tell us exactly what spawned.. but after that few couple rounds the numbers say this, but the spawn doesn't look like what was just said. So we think the actuall getting the group to spawn is correct but the part of spawning gets messed up or something... It's complicated to say, but I hope this helps... Here is the code
The Variable ABT_number or w/e is useless so ignore it... We don't think it's the problem either...
The screen shots..
http://img189.imageshack.us/gal.php?g=wc3scrnshot071509232325.jpg
Example.
Boss=3
Tanks=2
Flying=2
others=1
so maybe one round a boss(+3) no tanks 5 flying (+10) and 7 other (+7) would equal 20. But. for some reason it works like a charm for the first couple rounds but after words they spawn in groups. So we started to see if we did the trigger right. So we maybe it after the round starts it would tell us exactly what spawned.. but after that few couple rounds the numbers say this, but the spawn doesn't look like what was just said. So we think the actuall getting the group to spawn is correct but the part of spawning gets messed up or something... It's complicated to say, but I hope this helps... Here is the code
Trigger:
- TRIGGER 004
- Events
- Unit - A unit Begins casting an ability
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Ability being cast) Equal to Next round
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in (Units in PLYR_Region[(Player number of (Owner of (Casting unit)))] owned by Player 12 (Brown))) Equal to 0
- Then - Actions
- Set SPWN_Active[(Player number of (Owner of (Casting unit)))] = True
- Else - Actions
- Set SPWN_Active[(Player number of (Owner of (Casting unit)))] = False
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- SPWN_Active[(Player number of (Owner of (Casting unit)))] Equal to False
- Then - Actions
- Game - Display to (Player group((Owner of (Casting unit)))) the text: (|cffCC0000Round |cffBCAC00 + ((String(PLYR_ROUND[(Player number of (Owner of (Casting unit)))])) + |r|cffCC0000 is already in progress|r))
- Skip remaining actions
- Else - Actions
- If - Conditions
- Trigger - Turn off (This trigger)
- Set SPWN_Active[(Player number of (Owner of (Casting unit)))] = False
- Set PLYR_ROUND[(Player number of (Owner of (Casting unit)))] = (PLYR_ROUND[(Player number of (Owner of (Casting unit)))] + 1)
- Set SPWN_Health[(Player number of (Owner of (Casting unit)))] = (((Power((Real(PLYR_ROUND[(Player number of (Owner of (Casting unit)))])), 2.00)) + 4.00) x DIFF_Health[(Player number of (Owner of (Casting unit)))])
- Multiboard - Set the text for (Last created multiboard) item in column 4, row MLTI_Player_placement[(Player number of (Owner of (Casting unit)))] to (PLYR_Color[(Player number of (Owner of (Casting unit)))] + (String(PLYR_ROUND[(Player number of (Owner of (Casting unit)))])))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (PLYR_ROUND[(Player number of (Owner of (Casting unit)))] mod Levls_per_BNTY_increese) Equal to 0
- Then - Actions
- Set BNTY_Multi[(Player number of (Owner of (Casting unit)))] = (BNTY_Multi[(Player number of (Owner of (Casting unit)))] + 1)
- Set SPAWN_Extra_Zombies[(Player number of (Owner of (Casting unit)))] = (SPAWN_Extra_Zombies[(Player number of (Owner of (Casting unit)))] + 1)
- Else - Actions
- If - Conditions
- Set SPWN_Total = (SPWN_Gold_per_Round[(Player number of (Owner of (Casting unit)))] + SPAWN_Extra_Zombies[(Player number of (Owner of (Casting unit)))])
- Game - Display to (All players) the text: (String(SPWN_Total))
- Set SPWN_Queen_int[1] = (Random integer number between 0 and 1)
- Set SPWN_Total = (SPWN_Total - (SPWN_Queen_int[1] x SPWN_Type_gold[5]))
- Set SPWN_Crawler_int[1] = (Random integer number between 0 and ((SPWN_Total / 4) / SPWN_Type_gold[3]))
- Set SPWN_Total = (SPWN_Total - (SPWN_Crawler_int[1] x SPWN_Type_gold[3]))
- Set SPWN_Runner_int[1] = (Random integer number between 0 and ((SPWN_Total / 2) / SPWN_Type_gold[2]))
- Set SPWN_Total = (SPWN_Total - (SPWN_Runner_int[1] x SPWN_Type_gold[2]))
- Set SPWN_Tank_int[1] = (Random integer number between 0 and ((SPWN_Total / 2) / SPWN_Type_gold[4]))
- Set SPWN_Total = (SPWN_Total - (SPWN_Tank_int[1] x SPWN_Type_gold[4]))
- Set SPWN_Flying_int[1] = (Random integer number between 0 and (SPWN_Total / SPWN_Type_gold[6]))
- Set SPWN_Total = (SPWN_Total - (SPWN_Flying_int[1] x SPWN_Type_gold[6]))
- Set SPWN_Normal_int[1] = SPWN_Total
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- SPWN_Normal_int[1] Greater than or equal to 1
- Then - Actions
- For each (Integer A) from 1 to SPWN_Normal_int[1], do (Actions)
- Loop - Actions
- Unit - Create 1 SPWN_Normal[(Random integer number between 1 and SPWN_Normal_int[0])] for (Owner of (Casting unit)) at SPWN_Start_pt[(Player number of (Owner of (Casting unit)))] facing Default building facing degrees
- Unit - Change ownership of (Last created unit) to Player 12 (Brown) and Retain color
- Unit - Order (Last created unit) to Move To SPWN_End_pt[(Player number of (Owner of (Casting unit)))]
- Unit - Set life of (Last created unit) to SPWN_Health[(Player number of (Owner of (Casting unit)))]
- Unit - Set the custom value of (Last created unit) to ((1000 x (Player number of (Owner of (Casting unit)))) + (100 x 1))
- Loop - Actions
- Set ABT_Number = SPWN_Normal_int[1]
- For each (Integer A) from 1 to SPWN_Normal_int[1], do (Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- SPWN_Runner_int[1] Greater than or equal to 1
- Then - Actions
- Wait 0.25 seconds
- For each (Integer A) from 1 to SPWN_Runner_int[1], do (Actions)
- Loop - Actions
- Unit - Create 1 SPWN_Runner[(Random integer number between 1 and SPWN_Runner_int[0])] for (Owner of (Casting unit)) at SPWN_Start_pt[(Player number of (Owner of (Casting unit)))] facing Default building facing degrees
- Unit - Change ownership of (Last created unit) to Player 12 (Brown) and Retain color
- Unit - Order (Last created unit) to Move To SPWN_End_pt[(Player number of (Owner of (Casting unit)))]
- Unit - Set life of (Last created unit) to SPWN_Health[(Player number of (Owner of (Casting unit)))]
- Unit - Set the custom value of (Last created unit) to ((1000 x (Player number of (Owner of (Casting unit)))) + (100 x 2))
- Loop - Actions
- Set ABT_Number = (ABT_Number + SPWN_Runner_int[1])
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- SPWN_Crawler_int[1] Greater than or equal to 1
- Then - Actions
- Wait 0.25 seconds
- For each (Integer A) from 1 to SPWN_Crawler_int[1], do (Actions)
- Loop - Actions
- Unit - Create 1 SPWN_Crawler[(Random integer number between 1 and SPWN_Crawler_int[0])] for (Owner of (Casting unit)) at SPWN_Start_pt[(Player number of (Owner of (Casting unit)))] facing Default building facing degrees
- Unit - Change ownership of (Last created unit) to Player 12 (Brown) and Retain color
- Unit - Order (Last created unit) to Move To SPWN_End_pt[(Player number of (Owner of (Casting unit)))]
- Unit - Set life of (Last created unit) to SPWN_Health[(Player number of (Owner of (Casting unit)))]
- Unit - Set the custom value of (Last created unit) to ((1000 x (Player number of (Owner of (Casting unit)))) + (100 x 3))
- Loop - Actions
- Set ABT_Number = (ABT_Number + SPWN_Crawler_int[1])
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- SPWN_Flying_int[1] Greater than or equal to 1
- Then - Actions
- For each (Integer A) from 1 to SPWN_Flying_int[1], do (Actions)
- Loop - Actions
- Unit - Create 1 SPWN_Flying[(Random integer number between 1 and SPWN_Flying_int[0])] for (Owner of (Casting unit)) at (SPWN_Start_pt[(Player number of (Owner of (Casting unit)))] offset by (-256.00 + (32.00 x (Real((Integer A))))) towards 0.00 degrees) facing Default building facing degrees
- Unit - Change ownership of (Last created unit) to Player 12 (Brown) and Retain color
- Unit - Order (Last created unit) to Move To SPWN_End_pt[(Player number of (Owner of (Casting unit)))]
- Unit - Set life of (Last created unit) to (SPWN_Health[(Player number of (Owner of (Casting unit)))] x 0.85)
- Unit - Set the custom value of (Last created unit) to ((1000 x (Player number of (Owner of (Casting unit)))) + (100 x 6))
- Loop - Actions
- Set ABT_Number = (ABT_Number + SPWN_Flying_int[1])
- For each (Integer A) from 1 to SPWN_Flying_int[1], do (Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- SPWN_Tank_int[1] Greater than or equal to 1
- Then - Actions
- Wait 0.25 seconds
- For each (Integer A) from 1 to SPWN_Tank_int[1], do (Actions)
- Loop - Actions
- Unit - Create 1 SPWN_Tank[(Random integer number between 1 and SPWN_Tank_int[0])] for (Owner of (Casting unit)) at SPWN_Start_pt[(Player number of (Owner of (Casting unit)))] facing Default building facing degrees
- Unit - Change ownership of (Last created unit) to Player 12 (Brown) and Retain color
- Unit - Order (Last created unit) to Move To SPWN_End_pt[(Player number of (Owner of (Casting unit)))]
- Unit - Set life of (Last created unit) to (SPWN_Health[(Player number of (Owner of (Casting unit)))] x 1.50)
- Unit - Set the custom value of (Last created unit) to ((1000 x (Player number of (Owner of (Casting unit)))) + (100 x 4))
- Loop - Actions
- Set ABT_Number = (ABT_Number + SPWN_Tank_int[1])
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- SPWN_Queen_int[1] Greater than or equal to 1
- Then - Actions
- Wait 0.25 seconds
- For each (Integer A) from 1 to SPWN_Queen_int[1], do (Actions)
- Loop - Actions
- Unit - Create 1 SPWN_Queen[(Random integer number between 1 and SPWN_Queen_int[0])] for (Owner of (Casting unit)) at SPWN_Start_pt[(Player number of (Owner of (Casting unit)))] facing Default building facing degrees
- Unit - Change ownership of (Last created unit) to Player 12 (Brown) and Retain color
- Unit - Set life of (Last created unit) to (SPWN_Health[(Player number of (Owner of (Casting unit)))] x 3.00)
- Unit - Order (Last created unit) to Move To SPWN_End_pt[(Player number of (Owner of (Casting unit)))]
- Unit - Set the custom value of (Last created unit) to ((1000 x (Player number of (Owner of (Casting unit)))) + (100 x 1))
- Loop - Actions
- Else - Actions
- If - Conditions
- Trigger - Turn on (This trigger)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
The Variable ABT_number or w/e is useless so ignore it... We don't think it's the problem either...
The screen shots..
http://img189.imageshack.us/gal.php?g=wc3scrnshot071509232325.jpg