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!
 
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/
 
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.
 
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 The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/
  • The Helper The Helper:
    Happy Thursday!
  • Ghan Ghan:
    I'm not so sure, there's still a lot of Thursday left for it to become unhappy.
    +3
  • The Helper The Helper:
    still a few hours
  • The Helper The Helper:
    Its Friday!!!!
    +1
  • Ghan Ghan:
    Thursday 7/10 would Thursday again
    +3

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top