Round based wave system problem

Rab

New Member
Reaction score
1
Ok i took a round based wave system off a "td starter kit map" which can be downloaded here http://warcraft3.filefront.com/file/TD_Starter_Kit;95680 and tried to modify it so that after each round(wave of monsters) when everyone has cleared their monsters, all of each player's units will be teleported to the middle which is the shop area then after 45 seconds warp the player's units back then begin the next round.
So i came up with this..
Starting countdown
Code:
RB Start Spawning
    Events
        Time - StartingTimer expires
    Conditions
    Actions
        Countdown Timer - Destroy (Last created timer window)
        [B]Trigger - Run RB Next Round <gen> (checking conditions)[/B]
        Trigger - Turn off (This trigger)
StartingTimer is basically a 45 second timer which was started in another trigger
Code:
RB Next Round
    Events
    Conditions
    Actions
        Set CurrentLevel = (CurrentLevel + 1)
        Set GoldperLevel = (GoldperLevel + 2)
        Set TotalEnemies = (EnemyCount[CurrentLevel] x 10)
        Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Player - Add GoldperLevel to (Picked player) Current gold)
        Trigger - Run RB Spawn Monsters <gen> (ignoring conditions)
        Game - Display to (All players) for 10.00 seconds the text: (Level  + ((String(CurrentLevel)) + ( :  + (Name of (Last created unit)))))
        If (EnableWaves Equal to True) then do (Leaderboard - Change the value for Player 12 (Brown) in Leaderboard to CurrentLevel) else do (Do nothing)
        If (EnableWaves Equal to True) then do (Leaderboard - Change the value for Neutral Victim in Leaderboard to TotalEnemies) else do (Do nothing)
        [B]Trigger - Turn on RB Total Enemies <gen>[/B]
Code:
RB Total Enemies
    Events
        Unit - A unit owned by Player 12 (Brown) Dies
    Conditions
    Actions
        Set TotalEnemies = (TotalEnemies - 1)
        Leaderboard - Change the value for Neutral Victim in Leaderboard to TotalEnemies
        If (TotalEnemies Equal to 0) then do [B](Trigger - Run Fetch Units <gen> (checking conditions)) [/B]else do (Do nothing)
        If (TotalEnemies Equal to 0) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
Code:
Fetch Units
    Events
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Triggering unit)) Not equal to Player 12 (Brown))) and do (Actions)
            Loop - Actions
                Unit - Move (Picked unit) instantly to (Center of Mid Store Ground <gen>)
        Wait 5.00 seconds
        Trigger - Turn off (This trigger)
        Countdown Timer - Create a timer window for RevolvingTimer with title Till Next Round  
        Countdown Timer - Start RevolvingTimer as a One-shot timer that will expire in 45.00 seconds
        [B]Trigger - Run Return Units <gen> (checking conditions)[/B]
Code:
Return Units
    Events
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Triggering unit)) Equal to Player 1 (Red))) and do (Actions)
            Loop - Actions
                Unit - Move (Triggering unit) instantly to (Center of Red Play <gen>)
        Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Triggering unit)) Equal to Player 2 (Blue))) and do (Actions)
            Loop - Actions
                Unit - Move (Triggering unit) instantly to (Center of Blue Play <gen>)
        Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Triggering unit)) Equal to Player 3 (Teal))) and do (Actions)
            Loop - Actions
                Unit - Move (Triggering unit) instantly to (Center of Teal Play <gen>)
        Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Triggering unit)) Equal to Player 4 (Purple))) and do (Actions)
            Loop - Actions
                Unit - Move (Triggering unit) instantly to (Center of Purple Play <gen>)
        Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Triggering unit)) Equal to Player 5 (Yellow))) and do (Actions)
            Loop - Actions
                Unit - Move (Triggering unit) instantly to (Center of Yellow Play <gen>)
        Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Triggering unit)) Equal to Player 6 (Orange))) and do (Actions)
            Loop - Actions
                Unit - Move (Triggering unit) instantly to (Center of Orange Play <gen>)
        Wait 5.00 seconds
        Trigger - Turn off (This trigger)
        Trigger - Run On RB Next Round <gen> (checking conditions)
So all these triggers work in like a cycle and just go on but i cant find the mistake..whenever i try to run it,after the first wave starts and i kill all the monsters,my hero doesnt get warped..
Red-Orange Play is the entire play area of each player
Mid Store Ground is the middle shop area
thanks
EDIT*
you do not neccasarily have to modify these triggers any other way to make the system i need as stated above is fine...
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
I think the problem lies in the Pick Every Unit actions. Shouldn't it be Matching unit instead of Triggering unit?
 

Rab

New Member
Reaction score
1
oh i went through it again and got suspicious of the TotalEnemies variable..it wasnt triggered properly thus nothing happened..
EDIT*
one more problem..
apparently using "Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Picked unit)) Equal to Player 1 (Red))) and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to (Center of Red Play <gen>)"
will not move player 1 red's creeps back to its play area(specific place for each player) because it takes all the units in the map and if one does not meet the "((Owner of (Picked unit)) Equal to Player 1 (Red)))" condition,the loop action will not start...
so how would i change it so that i move all of player 1's units back to its play area?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
do this:
Trigger:
  • Actions
    • Set Temp_Point = Center of Red Play &lt;gen&gt;
    • Set Temp_Group = Unit in (Units in (Playable map area) matching ((Owner of (Picked unit)) Equal to Player 1 (Red)))
    • Unit Group - Pick every unit in Temp_Group and do actions
      • Loop - Actions
        • Unit - Move (Picked unit) instantly to Temp_Point
    • Custom Script: call DestroyGroup(udg_Temp_Group)
    • Custom Script: call RemoveLocation(udg_Temp_Point)


that should solve your problem and get rid of your leaks, i suggest you read up on a leak tutorial

PS. next time please post your triggers in these tags: [noparse]
Trigger:
  • It goes here
[/noparse]
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top