• 🏆 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!

How to Disable Game Pausing

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: 353
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