Timer at MapInit Not Counting Appropriately

jedi8955

New Member
Reaction score
4
Just starting out with the SC2 editor here, trying to move over my WC3 experience. Having a weird issue with a Timer Window. While in game, it's not counting at all, it sits a 0:00:00. Here's my trigger:

Trigger:
  • Events
    • Game - Map Initialization
    • Local Variables
      • SetupTimer = (New timer) <Timer>
    • Conditions
    • Actions
      • Timer - Start SetupTimer as a One Shot timer that will expire in 180.0 Game Time seconds
      • Timer - Create a timer window for (Last started timer) with the title "Setup Phase" using Remaining time (Initially Visible)


I've tried changing Game Time to Real Time and (Last started timer) to SetupTimer, with no results. The window just sits there at 0:00:00.

Thanks for the help!
 

ZeroPoints

New Member
Reaction score
8
was looking at a site and seems like you need an event every (number) of seconds of game time
then action set the timer window for timer
but i didn't really look deep into it. plus i think i also heard that map init starts during the maps load screen(not sure how reliable this is) haha maybe just maybe its cos the loads creen goes for 180seconds in itself and at start it will be 0
also maybe have an event on unit created or something action reset timer or something and print timer somewhere just to test whats actually wrong with it maybe.

source: http://forums.sc2mapster.com/development/triggers/12233-quick-timer-question/
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
I think it was the same way in worldedit, but you should always start timers after 1 second of game time. init doesn't trigger things like timers correctly because many things need to load up or whatnot.
 

jedi8955

New Member
Reaction score
4
Weird, I thought I had posted a reply yesterday, but I guess not. Go go qwertyface.

Anyway, I figured out the problem. The Timer and the Timer Window had to be global variables, and it had to start after 1 second of game time. Setting these got it to work perfectly.

Here's the working code:

Trigger:
  • Setup Timer Begun
    • Events
      • Timer - Elapsed time is 1.0 Game Time seconds
    • Local Variables
    • Conditions
    • Actions
      • UI - Display "Setup Phase begun. Choose races and..." for (All players) to Chat area
      • Timer - Start SetupTimer as a One Shot timer that will expire in 180.0 Game Time seconds
      • Timer - Create a timer window for SetupTimer, with the title "Setup Phase", using Remaining time (initially Visible)
      • Variable - Set SetupWindow = (Last created timer window)


As a side note, getting a SC2 tag would be pretty chill :)

Thanks for the help with working this out! Hopefully this necropost will help the next person down the line with a healthy google reflex.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top