• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

A way to fix bug with pause game

Status
Not open for further replies.
Level 12
Joined
Jul 17, 2013
Messages
544
Hey is there way to temporary disable pause game option?

Pause is usefull in my map but sometimes IT can lead to breaking gamę.my map got lot of cut scenes. Alreday few times players managed to pause game right when cut scenę began so the gamę cant be upaused then and its over. At the moment cut scenę begins menu is disabled and nothing more can be done except alt and F4. I alreday tired to put the function to unapuse gamę when cut scenę begins but IT just doesnt help
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
  • Hide Pause Button
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Custom script: call BlzFrameSetVisible(BlzGetFrameByName("PauseButton", 0), false)
This will hide the Pause Button, preventing it from being clicked.

It would be better to hide it during map initialization so that players can't click it before the 0.50 seconds has elapsed.

I'm just worried that by doing that it will cause desyncs... I like to play it safe with frames and only mess with them after a small amount of time has passed and all players have finished loading.

Perhaps you could Disable User Control during Map Initialization. Then Enable control after the button has been hidden. This way players can't click Pause before:
  • Time - Elapsed game time is 0.50 seconds
If you want to do this for other UI frames here's a link that contains a list of their names: Default Names for BlzGetFrameByName
 
Last edited:
Level 12
Joined
Jul 17, 2013
Messages
544
wait im litle confused, hidding button generaly creates desync? or only if its done at map init. the cut scenes which can be broken with pauses happen only at 20 min of game and 30. so can't i set pause button then to false? and after these cut scenes end to true?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Edit: If you're doing it that late into the game then it's fine, no worry about desync.

And about the Disable User Control stuff, forget what I said.

Hide button:
  • Custom script: call BlzFrameSetVisible(BlzGetFrameByName("PauseButton", 0), false)
Show button:
  • Custom script: call BlzFrameSetVisible(BlzGetFrameByName("PauseButton", 0), true)
Just Hide it before the cinematic and then Show it afterwards.
 
Level 12
Joined
Jul 17, 2013
Messages
544
does it disable and enable button alreday for everyone or i need to use local player for everyone? i am once again litle confused because i alreday use such script to hide custom UI button and guy the second dev in my map did it with local player.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
GetLocalPlayer() does your Actions for a specific player. So this would hide the Pause button for only Player 1 (Red):
  • Custom script: if ( GetLocalPlayer() == Player(0) ) then
  • Custom script: call BlzFrameSetVisible(BlzGetFrameByName("PauseButton", 0), false)
  • Custom script: endif
If you DON'T use GetLocalPlayer() then it hides the Frame for everyone. This is the default behavior of BlzFrameSetVisible() and all of the other Frame functions.
 
Status
Not open for further replies.
Top