1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

How to Disable Game Pausing

Discussion in 'Miscellaneous Tutorials' started by TriggerHappy, Jan 24, 2014.

  1. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,668
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    Table of contents
    1. Overview
    2. Triggering
    3. Game Interface
    4. DisablePause.w3x
    Overview

    In order to disable the pause feature you have to force the game to be paused three times. We can do this via the
    PauseGame
    native as you can see below.

    The only problem with this is the game shows you a message "the game has been paused" each time. However this can be taken care of by modifying the game interface in your map.

    Triggering

    GUI
    • DisablePause
      • Events
        • Time - Elapsed game time is 0.00 seconds
      • Conditions
      • Actions
        • Game - Pause the game
        • Game - Unpause the game
        • Game - Pause the game
        • Game - Unpause the game
        • Game - Pause the game
        • Game - Unpause the game


    JASS
    JASS vJASS
    Create a trigger with the title "DisablePause" and paste this in it

    Code (vJASS):
    function Trig_DisablePause_Actions takes nothing returns nothing
        call DestroyTimer(GetExpiredTimer())
        call PauseGame(true)
        call PauseGame(false)
        call PauseGame(true)
        call PauseGame(false)
        call PauseGame(true)
        call PauseGame(false)
    endfunction

    //===========================================================================
    function InitTrig_DisablePause takes nothing returns nothing
        call TimerStart(CreateTimer(), 0, false, function Trig_DisablePause_Actions)
    endfunction

    Code (vJASS):
    library DisablePause initializer onInit uses optional TimerUtils

        private function OnGameStart takes nothing returns nothing
            static if LIBRARY.TimerUtils then
                call ReleaseTimer(GetExpiredTimer())
            else
                call DestroyTimer(GetExpiredTimer())
            endif
            call PauseGame(true)
            call PauseGame(false)
            call PauseGame(true)
            call PauseGame(false)
            call PauseGame(true)
            call PauseGame(false)
        endfunction

        //===========================================================================
        private function onInit takes nothing returns nothing
            static if LIBRARY.TimerUtils then
                call TimerStart(NewTimerEx(0), 0, false, function OnGameStart)
            else
                call TimerStart(CreateTimer(), 0, false, function OnGameStart)
            endif
        endfunction
       
    endlibrary


    Game Interface

    To remove the pause notification we have to go into the game interface settings.
    1. To do that hit Advanced -> Game Interface in the toolbar.

      [​IMG]

    2. Look for "Text - General - '%s has resumed the game'", "Text - General - '%s paused the game'" ect.. and change their values to a lot of spaces.

      [​IMG]

    3. Test in-game and you should get this.

      [​IMG]
     

    Attached Files:

    Last edited by a moderator: Feb 8, 2014
  2. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    Oh neat... btw, the three pauses limit are only for MP games right?
     
  3. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,426
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    @Adiktuz: Yep.

    @TriggerHappy: The tutorial looks good! I just need to get around testing it and it should be approvable.
     
  4. IamFootman061

    IamFootman061

    Joined:
    Dec 26, 2013
    Messages:
    193
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Nice creativity and really helpful.
     
  5. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,668
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    Included a demo map.
     
  6. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,426
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Approved.
     
  7. ILH

    ILH

    Joined:
    May 8, 2012
    Messages:
    607
    Resources:
    16
    Models:
    14
    Icons:
    1
    Tutorials:
    1
    Resources:
    16
    Very very clever :D.
     
  8. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,468
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Really? I thought this too simple to be anything even a tutorial. Well good job I suppose. Useful.
     
  9. Ceday

    Ceday

    Joined:
    Feb 22, 2010
    Messages:
    1,080
    Resources:
    0
    Resources:
    0
    Guess what happens when you do this in single player :xxd:


    • Disable Pause
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Wait 0.00 seconds
        • Game - Unpause the game
        • Trigger - Run (This trigger) (checking conditions)

    • Show Dialog
      • Events
        • Player - Player 1 (Red) skips a cinematic sequence
      • Conditions
      • Actions
        • Dialog - Create a dialog button for D labelled A
        • Dialog - Show D for Player 1 (Red)
     
  10. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,468
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Yup this is also a form of single-player as well multi-player map protection, its often used in Korean and Chinese mapmaking.

    So that fixes it Ceday?