• 🏆 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!

Time Event Expires

Status
Not open for further replies.
Level 5
Joined
Jan 5, 2019
Messages
108
Hey i am trying to make a time event happen, but it doesn't seems to do my bidding, after people have choosen a "Hero" and "Time Expires" they have to get "Moved Instantly" to a region. its feels like the time doesn't work at all

  • Timed Instant TP Player 1
    • Events
      • Time - TimeEvent expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Shop Area <gen> contains hero[(Player number of Player 1 (Red))]) Equal to True
        • Then - Actions
          • For each (Integer A) from 1 to 1, do (Actions)
            • Loop - Actions
              • Unit - Move hero[1] instantly to SoloArenaPoint[1]
        • Else - Actions
          • Countdown Timer - Pause TimeEvent
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 1 (Red) slot status) Equal to Is playing
            • Then - Actions
              • If ((Shop Area <gen> contains hero[1]) Equal to True) then do (Countdown Timer - Pause TimeEvent) else do (Do nothing)
            • Else - Actions
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
You started TimeEvent?

Also be aware you are moving 1 hero to 1 location and the loop is pointless at the moment. Maybe you meant Integer A instead of the numeric constant of 1.

Pausing periodic timers is buggy as they will resume to be 1 shot. Better to run timers in 1 shot mode and restart them each time.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
To post your trigger:

["trigger"]
Paste your trigger here
["/trigger"]

Remove the quotation marks.

@Dr Super Good
  • Start Timer
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TimerIsOn Equal to False
        • Then - Actions
          • Set VariableSet TimerIsOn = True
          • Countdown Timer - Start Timer as a Repeating timer that will expire in 0.05 seconds
        • Else - Actions
  • Timer
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Some Condition Is Met That Ends The Timer
        • Then - Actions
          • Set VariableSet TimerIsOn = False
          • Countdown Timer - Pause Timer
        • Else - Actions
Would that cause problems? I feel like I've been using Timers this way forever without any issues.
 
Last edited:
Level 5
Joined
Jan 5, 2019
Messages
108
Sorry the reason why it has to keep repeat is because every time "ALL Players" is finish killing "Browns unit" in a specific region the timer has to restart which basically just gives the players time to buy, before they are send back into the "Arena Region"

PS: sorry its been a long time since i have been working on this map so i have to figured out all my ideas again and how i thought to set it up


  • AllUnitsAreDead World Arena
    • Events
      • Unit - A unit owned by Player 12 (Brown)Dies
    • Conditions
    • Actions
      • Set VariableSet tempGroup = (Units in Fighting Region <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in tempGroup.) Equal to True
        • Then - Actions
          • Set VariableSet tempGroup = (Units in fightRegion matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to Player 12 (Brown))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in tempGroup) Equal to 0
              • (Number of units in tempGroup) Equal to 0
            • Then - Actions
              • Wait 0.20 seconds
              • Set VariableSet AllHeroes[(Player number of Player 1 (Red))] = (Units in Fighting Region <gen> owned by Player 1 (Red))
              • Set VariableSet AllHeroes[(Player number of Player 2 (Blue))] = (Units in Fighting Region <gen> owned by Player 2 (Blue))
              • Set VariableSet AllHeroes[(Player number of Player 3 (Teal))] = (Units in Fighting Region <gen> owned by Player 3 (Teal))
              • Set VariableSet AllHeroes[(Player number of Player 4 (Purple))] = (Units in Fighting Region <gen> owned by Player 4 (Purple))
              • Set VariableSet AllHeroes[(Player number of Player 5 (Yellow))] = (Units in Fighting Region <gen> owned by Player 5 (Yellow))
              • Set VariableSet AllHeroes[(Player number of Player 6 (Orange))] = (Units in Fighting Region <gen> owned by Player 6 (Orange))
              • Set VariableSet tempPoint = (Center of baseRegion)
              • For each (Integer A) from 0 to 10, do (Actions)
                • Loop - Actions
                  • Unit - Move (Summoned unit) instantly to tempPoint
                  • Unit - Move (Random unit from AllHeroes[(Player number of Player 1 (Red))]) instantly to tempPoint
                  • Unit - Move (Random unit from AllHeroes[(Player number of Player 2 (Blue))]) instantly to tempPoint
                  • Unit - Move (Random unit from AllHeroes[(Player number of Player 3 (Teal))]) instantly to tempPoint
                  • Unit - Move (Random unit from AllHeroes[(Player number of Player 4 (Purple))]) instantly to tempPoint
                  • Unit - Move (Random unit from AllHeroes[(Player number of Player 5 (Yellow))]) instantly to tempPoint
                  • Unit - Move (Random unit from AllHeroes[(Player number of Player 6 (Orange))]) instantly to tempPoint
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • Custom script: call DestroyGroup(udg_tempGroup)
        • Else - Actions
 
Level 5
Joined
Jan 5, 2019
Messages
108
To post your trigger:

["trigger"]
Paste your trigger here
["/trigger"]

Remove the quotation marks.

@Dr Super Good
  • Start Timer
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TimerIsOn Equal to False
        • Then - Actions
          • Set VariableSet TimerIsOn = True
          • Countdown Timer - Start Timer as a Repeating timer that will expire in 0.05 seconds
        • Else - Actions
  • Timer
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Some Condition Is Met That Ends The Timer
        • Then - Actions
          • Set VariableSet TimerIsOn = False
          • Countdown Timer - Pause Timer
        • Else - Actions
Would that cause problems? I feel like I've been using Timers this way forever without any issues.

Thanks i forgot :)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
No problem.

Just a heads up, you're leaking tempGroup in that trigger and have another potential tempGroup leak during the 0.20 second wait.

You should destroy the first tempGroup before creating it again:
  • Destroy tempGroup here
  • Set VariableSet tempGroup = (Units in fightRegion matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to Player 12 (Brown))))
Then move the last "call DestroyGroup" so it happens before the Wait instead of after:
  • Destroy tempGroup here
  • Wait 0.20 seconds
^The issue with how it's currently setup is during that 0.20 second wait there's potential that you create/destroy tempGroup in another trigger. If you were to create tempGroup again in another trigger then you will create a leak, and it will destroy the wrong group after the 0.20 seconds.

You also check this condition twice when you only need to do it once:
  • (Number of units in tempGroup) Equal to 0
  • (Number of units in tempGroup) Equal to 0
 
Last edited:
Status
Not open for further replies.
Top