• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Time Event

Status
Not open for further replies.
Level 5
Joined
Jan 5, 2019
Messages
108
Hey i am trying to make a repeating time event which only should repeat / count down every time all 6 players / those who is in the game, will activate when they all are in a certain region, but i am pretty lost can someone help me ?

Basically when the last player is done fighting in a certain region he will get instant moved to the base, and then i want the count down to begin, so they will get instant moved back to the fighting region after the count down is done
 
Last edited:
When ever a player-hero enters the base region, you need to check for all 6 players if they are in game, and if yes if their hero is inside base region. Once the checks become true you can use "wait" or "timer" to make a time delay for teleporting them back to fight region.

By the way, you should always post your code that you currently have. : )
 
Level 5
Joined
Jan 5, 2019
Messages
108
When ever a player-hero enters the base region, you need to check for all 6 players if they are in game, and if yes if their hero is inside base region. Once the checks become true you can use "wait" or "timer" to make a time delay for teleporting them back to fight region.

By the way, you should always post your code that you currently have. : )

Hey ! Yeah sorry i hadn't made one before now, but this is how it looks :)

  • Player Leave Setup
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
    • Conditions
    • Actions
      • Set Player_Leaves_Game[(Player number of (Triggering player))] = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in Player_Leaves_Game[(Player number of (Triggering player))] and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
          • Custom script: call DestroyGroup(udg_Player_Leaves_Game[GetConvertedPlayerId(GetTriggerPlayer())])


  • Player Left Action
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) slot status) Equal to Has left the game
        • Then - Actions
          • Set PlayerRemove[1] = (Units owned by Player 1 (Red))
          • Unit Group - Pick every unit in PlayerRemove[1] and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Custom script: call DestroyGroup(udg_PlayerRemove[1])
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 2 (Blue) slot status) Equal to Has left the game
            • Then - Actions
              • Set PlayerRemove[2] = (Units owned by Player 2 (Blue))
              • Unit Group - Pick every unit in PlayerRemove[2] and do (Actions)
                • Loop - Actions
              • Custom script: call DestroyGroup(udg_PlayerRemove[2])
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 3 (Teal) slot status) Equal to Has left the game
            • Then - Actions
              • Set PlayerRemove[3] = (Units owned by Player 3 (Teal))
              • Unit Group - Pick every unit in PlayerRemove[3] and do (Actions)
                • Loop - Actions
              • Custom script: call DestroyGroup(udg_PlayerRemove[3])
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 4 (Purple) slot status) Equal to Has left the game
            • Then - Actions
              • Set PlayerRemove[4] = (Units owned by Player 4 (Purple))
              • Unit Group - Pick every unit in PlayerRemove[4] and do (Actions)
                • Loop - Actions
              • Custom script: call DestroyGroup(udg_PlayerRemove[4])
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 5 (Yellow) slot status) Equal to Has left the game
            • Then - Actions
              • Set PlayerRemove[5] = (Units owned by Player 5 (Yellow))
              • Unit Group - Pick every unit in PlayerRemove[5] and do (Actions)
                • Loop - Actions
              • Custom script: call DestroyGroup(udg_PlayerRemove[5])
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 6 (Orange) slot status) Equal to Has left the game
            • Then - Actions
              • Set PlayerRemove[6] = (Units owned by Player 6 (Orange))
              • Unit Group - Pick every unit in PlayerRemove[6] and do (Actions)
                • Loop - Actions
              • Custom script: call DestroyGroup(udg_PlayerRemove[6])
            • Else - Actions
 
Level 5
Joined
Jan 5, 2019
Messages
108
Okay now i made it like this but i am not sure about the timer i need it to keep going on repeat until a Unit dies


  • Timed Instant TP
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Countdown Timer - Start (Last started timer) as a Repeating timer that will expire in 30.00 seconds
          • Countdown Timer - Create a timer window for (Last started timer) with title Next Battle
          • Unit - Move (Random unit from BaseGrp[(Player number of Player 1 (Red))]) instantly to SoloArenaPoint[1]
          • Unit - Move (Random unit from BaseGrp[(Player number of Player 2 (Blue))]) instantly to SoloArenaPoint[2]
          • Unit - Move (Random unit from BaseGrp[(Player number of Player 3 (Teal))]) instantly to SoloArenaPoint[3]
          • Unit - Move (Random unit from BaseGrp[(Player number of Player 4 (Purple))]) instantly to SoloArenaPoint[4]
          • Unit - Move (Random unit from BaseGrp[(Player number of Player 5 (Yellow))]) instantly to SoloArenaPoint[5]
          • Unit - Move (Random unit from BaseGrp[(Player number of Player 6 (Orange))]) instantly to SoloArenaPoint[6]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 All Units Dies <gen> contains (Random unit from AllHeroes[(Player number of Player 1 (Red))])) Equal to True
          • (Player 2 All Units Dies <gen> contains (Random unit from AllHeroes[(Player number of Player 2 (Blue))])) Equal to True
          • (Player 3 All Units Dies <gen> contains (Random unit from AllHeroes[(Player number of Player 3 (Teal))])) Equal to True
          • (Player 4 All Units Dies <gen> contains (Random unit from AllHeroes[(Player number of Player 4 (Purple))])) Equal to True
          • (Player 5 All Units Dies <gen> contains (Random unit from AllHeroes[(Player number of Player 5 (Yellow))])) Equal to True
          • (Player 6 All Units Dies <gen> contains (Random unit from AllHeroes[(Player number of Player 6 (Orange))])) Equal to True
        • Then - Actions
          • Countdown Timer - Pause (Last started timer)
        • Else - Actions
          • Countdown Timer - Start (Last started timer) as a Repeating timer that will expire in 30.00 seconds
      • Set SoloArenaPoint[1] = (Center of Player 1 Arena <gen>)
      • Set SoloArenaPoint[2] = (Center of Player 4 Arena <gen>)
      • Set SoloArenaPoint[3] = (Center of Player 2 Arena <gen>)
      • Set SoloArenaPoint[4] = (Center of Player 5 Arena <gen>)
      • Set SoloArenaPoint[5] = (Center of Player 3 Arena <gen>)
      • Set SoloArenaPoint[6] = (Center of Player 6 Arena <gen>)
      • Set BaseGrp[(Player number of (Matching player))] = (Units in BaseTimeEvent <gen>)
 
Is this the same problem explained in first post?

Maybe my post was wrong, but I expected some trigger with a "A unit enters region" event, which does the checks.

There needs to be checks combined if the player is in game, and only then it is relevant that the hero must be in region.

==

It would help you to access heroes if they're stored into a unit array[] variable. So Hero[1] should store hero by player 1, and so on.

(Mathing Player) does not exist at this point of usage.
 
Level 5
Joined
Jan 5, 2019
Messages
108
Is this the same problem explained in first post?

Maybe my post was wrong, but I expected some trigger with a "A unit enters region" event, which does the checks.

There needs to be checks combined if the player is in game, and only then it is relevant that the hero must be in region.

==

It would help you to access heroes if they're stored into a unit array[] variable. So Hero[1] should store hero by player 1, and so on.

(Mathing Player) does not exist at this point of usage.

You right, i think a lot i posted was wrong i also probably explained it wrong, i change some few things, so now its about making the Timer expire = moving unit, but i still don't understand the countdown timer, after it ends nothing happens i tried a lot of different combos but it wont trigger my hero to get moved. and i also don't know how to make a check if the player is in the game.

And also one of the reason why my Heroes ain't stored into a array is because every player only has one hero, so i can just store (Random unit from BaseGrp[(Player number of Player 1 (Red))])) to it

But maybe i should store them to check if a player is in the game ?





This is how it looks now

  • Timed Instant TP
    • Events
      • Time - TimeEvent expires
    • Conditions
    • Actions
      • Set BaseGrp[(Player number of (Owner of (Triggering unit)))] = (Units in Shop Area <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for TimeEvent) Equal to 0.00
          • (Shop Area <gen> contains (Random unit from BaseGrp[(Player number of Player 1 (Red))])) Equal to True
        • Then - Actions
          • Unit - Move (Random unit from BaseGrp[(Player number of Player 1 (Red))]) instantly to SoloArenaPoint[1]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 1 All Units Dies <gen> contains (Random unit from BaseGrp[(Player number of Player 1 (Red))])) Equal to True
            • Then - Actions
              • Countdown Timer - Pause TimeEvent
            • Else - Actions
        • Else - Actions
          • Countdown Timer - Start TimeEvent2 as a Repeating timer that will expire in 30.00 seconds
  • Timer
    • Events
      • Unit - A unit leaves Preventing Leaving To Base <gen>
    • Conditions
    • Actions
      • Countdown Timer - Start TimeEvent as a One-shot timer that will expire in 60.00 seconds
      • Set TimeEvent = (Last started timer)
      • Countdown Timer - Create a timer window for TimeEvent with title First Battel Will B...
      • Set Timer = (Last created timer window)
      • Countdown Timer - Show Timer
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Shop Area <gen> contains (Random unit from BaseGrp[(Player number of Player 1 (Red))])) Equal to True
          • (Shop Area <gen> contains (Random unit from BaseGrp[(Player number of Player 2 (Blue))])) Equal to True
          • (Shop Area <gen> contains (Random unit from BaseGrp[(Player number of Player 3 (Teal))])) Equal to True
          • (Shop Area <gen> contains (Random unit from BaseGrp[(Player number of Player 4 (Purple))])) Equal to True
          • (Shop Area <gen> contains (Random unit from BaseGrp[(Player number of Player 5 (Yellow))])) Equal to True
          • (Shop Area <gen> contains (Random unit from BaseGrp[(Player number of Player 6 (Orange))])) Equal to True
        • Then - Actions
          • Countdown Timer - Start TimeEvent as a Repeating timer that will expire in 30.00 seconds
          • Set TimeEvent2 = (Last started timer)
          • Countdown Timer - Create a timer window for TimeEvent with title Next Battel :
          • Set Timer1 = (Last created timer window)
          • Countdown Timer - Show Timer
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boos Gate Kepper 0039 <gen> Equal to (Dying unit)
        • Then - Actions
          • Countdown Timer - Pause TimeEvent
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss 1 0076 <gen> Equal to (Dying unit)
        • Then - Actions
          • Countdown Timer - Start TimeEvent as a Repeating timer that will expire in 30.00 seconds
        • Else - Actions
 
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Player 1 (Red) slot status) Equal to Is playing
      • ((Playable map area) contains No unit) Equal to True
    • Then - Actions
    • Else - Actions
^There is an "Player Slot Status" comparison to check if the player is still in game, and a boolean comparison to check if the unit is inside a region. It means both must be true to run the actions.

And also one of the reason why my Heroes ain't stored into a array is because every player only has one hero, so i can just store (Random unit from BaseGrp[(Player number of Player 1 (Red))])) to it
Variables will become huge benefit, also in maintaining triggers. You should try it out! : )

There is no (Triggering Unit) in the first trigger, because no unit triggered the trigger to run. It runs when a timer expired. (Triggering Unit) is meant for event responses like, when a unit does something in the event, casting/ordering/leaving a region/etc.

In second trigger (Dying unit) does not work, too, because it is an "A unit leaves region" event, not a "A unit dies" event.

You probably changed some things already? As I saw [Trigger] - Countdown Timer
 
Status
Not open for further replies.
Top