• 🏆 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] Getting rid of wait timers in my Hot Potato map

Status
Not open for further replies.
Level 1
Joined
Jan 14, 2022
Messages
1
Making a hot potato map (with extra fun steps) about to release it but I need to polish some things up. I've made the map in GUI because I needed to reintroduce myself to world editor after being away since 2010-2013.
one thing i'll polish is just writing a function for floating text to make it a bit cleaner not sure if it will make any difference efficiency-wise if someone could clear that up for me.



However, the main thing I want to polish is getting rid of the wait timers because some things could look or feel wonky if something were to happen. for example in a regular wait if someone paused the game during a new round it'd royally f#&@ everything in half lmao. Also wait game time is hot garbage and I wanted it out.

I don't have a lot of wait timers, just in a few triggers for some fun interactions/eye candy
  1. Intro Cinematic
  2. A player got smoked, give a random player the potato
  3. New round when everyone's been smoked it basically starts the game over without the intro.

spells are mui, potato pass is mui, but it felt unnecessary to make an intro/new round in that kind of style, not sure how to explain it?

This is what I came up with that works for me and I was wondering if it is a good way to replace waits in GUI for this application, or if there is something better such as a custom jass function in a custom script or using Timers. This is the best way I could think of other than a new trigger after every timer expires which felt wrong even if it works. I remembered reading a while back you can do something with hashtables (which I use in my spells) or something else but I couldn't figure it out or find the thread so here it is.

The trigger is kinda long sorry also the .95 cracks me up I'm just going to round it up later. Maybe regular waits ain't that bad? I dunno

  • Events
    • Time - GStartTimer expires
  • Conditions
  • Actions
    • Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 2.00 seconds
    • Countdown Timer - Destroy (Last created timer window)
    • Dialog - Clear SelectionScreenMenu
    • Trigger - Turn off IntroFlavorText <gen>
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked player) is in CurrentPlayers.) Equal to True
          • Then - Actions
            • Camera - Apply Boss Camera <gen> for (Picked player) over 25.00 seconds
          • Else - Actions
            • Game - Defeat (Picked player) with the message: ur afk xd
    • Unit Group - Pick every unit in playerunits and do (Actions)
      • Loop - Actions
        • Unit - Make (Picked unit) face potato over 0.50 seconds
    • Floating Text - Create floating text that reads |cff808080We've fou... above Your Dumbass Boss 0002 <gen> with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Custom script: call GameWait(10.0)
    • Floating Text - Destroy (Last created floating text)
    • Unit Group - Pick every unit in playerunits and do (Unit - Make (Picked unit) face DomMom over 0.50 seconds)
    • Player Group - Pick every player in CurrentPlayers and do (Actions)
      • Loop - Actions
        • Camera - Shake the camera for (Picked player) with magnitude 3.50
    • Unit - Unhide DomMom
    • Animation - Change DomMom's animation speed to 50.00% of its original speed
    • Animation - Play DomMom's attack animation
    • Special Effect - Create a special effect attached to the origin of DomMom using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Create a special effect attached to the origin of DomMom using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Create a special effect attached to the origin of DomMom using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
    • Special Effect - Destroy (Last created special effect)
    • Unit - Explode Sorceress 0005 <gen>.
    • Unit - Explode Sorceress 0004 <gen>.
    • Unit - Explode Footman 0006 <gen>.
    • Unit - Explode Footman 0010 <gen>.
    • Unit - Explode Captain 0012 <gen>.
    • Unit - Explode Captain 0011 <gen>.
    • Unit - Explode Wagon 0007 <gen>.
    • Wait 1.50 game-time seconds
    • Animation - Reset DomMom's animation
    • Player Group - Pick every player in CurrentPlayers and do (Actions)
      • Loop - Actions
        • Camera - Stop swaying/shaking the camera for (Picked player).
    • Floating Text - Create floating text that reads |cffffffffI|r|cfffa... above DomMom with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Set the velocity of (Last created floating text) to 20.00 towards 90.00 degrees
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
    • Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    • Unit - Order DomMom to Neutral Dark Ranger - Life Drain potato
    • Animation - Change potato flying height to 500.00 at 50.00
    • Unit - Make Your Dumbass Boss 0002 <gen> face DomMom over 0.30 seconds
    • Wait 3.45 game-time seconds
    • Set VariableSet tempLoc = (Position of Your Dumbass Boss 0002 <gen>)
    • Floating Text - Create floating text that reads |cff808080Mommy? so... above Your Dumbass Boss 0002 <gen> with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Set the velocity of (Last created floating text) to 20.00 towards 90.00 degrees
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the lifespan of (Last created floating text) to 10.00 seconds
    • Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    • Wait 3.00 game-time seconds
    • Unit - Turn collision for potato Off.
    • Unit - Order potato to Move To tempLoc
    • Animation - Change potato flying height to -1.00 at 300.00
    • Custom script: call RemoveLocation(udg_tempLoc)
    • Wait 1.00 game-time seconds
    • Set VariableSet tempLoc = (Position of Your Dumbass Boss 0002 <gen>)
    • Trigger - Run ExplodeFX <gen> (ignoring conditions)
    • Animation - Change Your Dumbass Boss 0002 <gen>'s size to (700.00%, 700.00%, 700.00%) of its original size
    • Unit - Explode Your Dumbass Boss 0002 <gen>.
    • Floating Text - Destroy (Last created floating text)
    • Player Group - Pick every player in CurrentPlayers and do (Actions)
      • Loop - Actions
        • Camera - Shake the camera for (Picked player) with magnitude 3.50
    • Custom script: call RemoveLocation(udg_tempLoc)
    • Wait 1.00 game-time seconds
    • Floating Text - Destroy (Last created floating text)
    • Player Group - Pick every player in CurrentPlayers and do (Actions)
      • Loop - Actions
        • Camera - Stop swaying/shaking the camera for (Picked player).
        • Camera - Apply Game Camera <gen> for (Picked player) over 2.50 seconds
    • Animation - Change potato flying height to 150.00 at 100.00
    • Wait 4.00 game-time seconds
    • Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 0.00 seconds
    • Set VariableSet PotatoHolder = (Random unit from playerunits)
    • Set VariableSet pAltitude = 0.50
    • Set VariableSet pTarget = (Position of PotatoHolder)
    • Set VariableSet pUnit = potato
    • Set VariableSet pSpeed = 18.00
    • Trigger - Run Potato Pass <gen> (checking conditions)
    • Unit Group - Pick every unit in playerunits and do (Custom script: call SetUnitPropWindow(GetEnumUnit(), 0.00))
    • Selection - Enable Selection: True, Enable Selection Circle: True
    • Player Group - Pick every player in CurrentPlayers and do (Actions)
      • Loop - Actions
        • Custom script: set bj_wantDestroyGroup=true
        • Selection - Select (Random unit from (Units owned by (Picked player).)) for (Picked player)
    • Trigger - Run Potato Timer <gen> (ignoring conditions)
    • Trigger - Turn on New Round <gen>
    • Trigger - Turn off (This trigger)
    • Wait 2.00 game-time seconds
    • Animation - Play DomMom's spell animation
    • Special Effect - Create a special effect attached to the origin of DomMom using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
    • Special Effect - Destroy (Last created special effect)
    • Wait 0.30 game-time seconds
    • Unit - Hide DomMom

  • // IntroTExpires
  • Events
    • Time - GStartTimer expires
  • Conditions
  • Actions
    • Trigger - Turn on Intro <gen>
  • //
  • //
  • //Intro (Initially Off)
  • Events
    • Time - Every 0.05 seconds of game time
  • Conditions
  • Actions
    • Set VariableSet Timer = (Timer + 0.05)
    • Custom script: if udg_Timer == 0.05 then
    • Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 2.00 seconds
    • Countdown Timer - Destroy (Last created timer window)
    • Dialog - Clear SelectionScreenMenu
    • Trigger - Turn off IntroFlavorText <gen>
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked player) is in CurrentPlayers.) Equal to True
          • Then - Actions
            • Camera - Apply Boss Camera <gen> for (Picked player) over 25.00 seconds
          • Else - Actions
            • Game - Defeat (Picked player) with the message: ur afk xd
    • Custom script: set bj_wantDestroyGroup=true
    • Unit Group - Pick every unit in playerunits and do (Actions)
      • Loop - Actions
        • Unit - Make (Picked unit) face potato over 0.50 seconds
    • Floating Text - Create floating text that reads |cff808080We've fou... above Your Dumbass Boss 0002 <gen> with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Custom script: endif
    • -------- -------- --------
    • -------- Wait --------
    • -------- -------- --------
    • Custom script: if udg_Timer == 10.00 then
    • Floating Text - Destroy (Last created floating text)
    • Custom script: set bj_wantDestroyGroup=true
    • Unit Group - Pick every unit in playerunits and do (Unit - Make (Picked unit) face DomMom over 0.50 seconds)
    • Player Group - Pick every player in CurrentPlayers and do (Actions)
      • Loop - Actions
        • Camera - Shake the camera for (Picked player) with magnitude 3.50
    • Unit - Unhide DomMom
    • Animation - Change DomMom's animation speed to 50.00% of its original speed
    • Animation - Play DomMom's attack animation
    • Special Effect - Create a special effect attached to the origin of DomMom using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Create a special effect attached to the origin of DomMom using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Create a special effect attached to the origin of DomMom using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
    • Special Effect - Destroy (Last created special effect)
    • Unit - Explode Sorceress 0005 <gen>.
    • Unit - Explode Sorceress 0004 <gen>.
    • Unit - Explode Footman 0006 <gen>.
    • Unit - Explode Footman 0010 <gen>.
    • Unit - Explode Captain 0012 <gen>.
    • Unit - Explode Captain 0011 <gen>.
    • Unit - Explode Wagon 0007 <gen>.
    • Custom script: endif
    • -------- -------- --------
    • -------- Wait --------
    • -------- -------- --------
    • Custom script: if udg_Timer == 11.50 then
    • Animation - Reset DomMom's animation
    • Player Group - Pick every player in CurrentPlayers and do (Actions)
      • Loop - Actions
        • Camera - Stop swaying/shaking the camera for (Picked player).
    • Floating Text - Create floating text that reads |cffffffffI|r|cfffa... above DomMom with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Set the velocity of (Last created floating text) to 20.00 towards 90.00 degrees
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
    • Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    • Unit - Order DomMom to Neutral Dark Ranger - Life Drain potato
    • Animation - Change potato flying height to 500.00 at 50.00
    • Unit - Make Your Dumbass Boss 0002 <gen> face DomMom over 0.30 seconds
    • Custom script: endif
    • -------- -------- --------
    • -------- Wait --------
    • -------- -------- --------
    • Custom script: if udg_Timer == 14.95 then
    • Set VariableSet tempLoc = (Position of Your Dumbass Boss 0002 <gen>)
    • Floating Text - Create floating text that reads |cff808080Mommy? so... above Your Dumbass Boss 0002 <gen> with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Set the velocity of (Last created floating text) to 20.00 towards 90.00 degrees
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the lifespan of (Last created floating text) to 10.00 seconds
    • Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    • Custom script: endif
    • -------- -------- --------
    • -------- Wait --------
    • -------- -------- --------
    • Custom script: if udg_Timer == 17.95 then
    • Unit - Turn collision for potato Off.
    • Unit - Order potato to Move To tempLoc
    • Animation - Change potato flying height to -1.00 at 300.00
    • Custom script: call RemoveLocation(udg_tempLoc)
    • Custom script: endif
    • -------- -------- --------
    • -------- Wait --------
    • -------- -------- --------
    • Custom script: if udg_Timer == 18.95 then
    • Set VariableSet tempLoc = (Position of Your Dumbass Boss 0002 <gen>)
    • Trigger - Run ExplodeFX <gen> (ignoring conditions)
    • Animation - Change Your Dumbass Boss 0002 <gen>'s size to (700.00%, 700.00%, 700.00%) of its original size
    • Unit - Explode Your Dumbass Boss 0002 <gen>.
    • Floating Text - Destroy (Last created floating text)
    • Player Group - Pick every player in CurrentPlayers and do (Actions)
      • Loop - Actions
        • Camera - Shake the camera for (Picked player) with magnitude 3.50
    • Custom script: call RemoveLocation(udg_tempLoc)
    • Custom script: endif
    • -------- -------- --------
    • -------- Wait --------
    • -------- -------- --------
    • Custom script: if udg_Timer == 19.95 then
    • Floating Text - Destroy (Last created floating text)
    • Player Group - Pick every player in CurrentPlayers and do (Actions)
      • Loop - Actions
        • Camera - Stop swaying/shaking the camera for (Picked player).
        • Camera - Apply Game Camera <gen> for (Picked player) over 2.50 seconds
    • Animation - Change potato flying height to 150.00 at 100.00
    • Custom script: endif
    • -------- -------- --------
    • -------- Wait --------
    • -------- -------- --------
    • Custom script: if udg_Timer == 23.95 then
    • Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 0.00 seconds
    • Set VariableSet PotatoHolder = (Random unit from playerunits)
    • Set VariableSet pAltitude = 0.50
    • Set VariableSet pTarget = (Position of PotatoHolder)
    • Set VariableSet pUnit = potato
    • Set VariableSet pSpeed = 18.00
    • Trigger - Run Potato Pass <gen> (checking conditions)
    • Custom script: set bj_wantDestroyGroup=true
    • Unit Group - Pick every unit in playerunits and do (Custom script: call SetUnitPropWindow(GetEnumUnit(), 0.00))
    • Selection - Enable Selection: True, Enable Selection Circle: True
    • Player Group - Pick every player in CurrentPlayers and do (Actions)
      • Loop - Actions
        • Selection - Select (Random unit from (Units owned by (Picked player).)) for (Picked player)
    • Trigger - Run Potato Timer <gen> (ignoring conditions)
    • Trigger - Turn on New Round <gen>
    • Custom script: endif
    • -------- -------- --------
    • -------- Wait --------
    • -------- -------- --------
    • Custom script: if udg_Timer == 25.95 then
    • Animation - Play DomMom's spell animation
    • Special Effect - Create a special effect attached to the origin of DomMom using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
    • Special Effect - Destroy (Last created special effect)
    • Custom script: endif
    • -------- -------- --------
    • -------- Wait --------
    • -------- -------- --------
    • Custom script: if udg_Timer == 26.25 then
    • Unit - Hide DomMom
    • Set VariableSet Timer = 0.00
    • Trigger - Turn off (This trigger)
    • Custom script: endif
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
I'd just stick with using Wait - Game Time, it works fine in these simple triggers. In fact, it's a hell of a lot more convenient than anything you can do with timers.

If you want exact precision though, which is understandable for custom spells and things of that sort, then I understand the need to replace the Waits. In that case you're better off doing what Cokemonkey said.

I guess what I'm trying to say is to not worry too much about things that don't really matter. Like if your map had a few memory leaks here and there, nobody else would ever know/notice and the game would function just fine. As a developer it may get under your skin because you seek perfection, but at the end of the day it's often unnecessary/detrimental to have this mindset.
 
Last edited:
Status
Not open for further replies.
Top