How to Disable Game Pausing

Level 39
Joined
Jun 23, 2007
Messages
4,058
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 thePauseGamenative 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

  • 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
JASSvJASS
Create a trigger with the title "DisablePause" and paste this in it

JASS:
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
JASS:
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.

    DisablePause1.jpg


  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.

    DisablePause2.jpg


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

    DisablePause.jpg
 

Attachments

  • DisablePause.w3x
    8.9 KB · Views: 342
Last edited by a moderator:
Level 12
Joined
Feb 22, 2010
Messages
1,115
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)
 
Top