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

[Solved] Anti pause system

Status
Not open for further replies.
Level 9
Joined
Dec 12, 2007
Messages
489
apparently there's no such way to detect pause game event or even check if the game is paused or not, thus unable to prevent players from pausing the game.

a workaround would be periodic event which continously unpause the game, like this:
  • Unpause Game
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Game - Unpause the game
change the interval to value that suits you.
 
Level 12
Joined
Jun 1, 2009
Messages
576
apparently there's no such way to detect pause game event or even check if the game is paused or not, thus unable to prevent players from pausing the game.

a workaround would be periodic event which continously unpause the game, like this:
  • Unpause Game
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Game - Unpause the game
change the interval to value that suits you.

I tryed this before posting....it is buged

if i set every 1 sec then dont works
if i set every 0.1 - 0.2 sec that works but mess up the game....players cant click on spells...etc
 
Level 12
Joined
Jun 1, 2009
Messages
576
You can try the following method: Check if a certain unit is paused before using the unpause game action. I'm assuming units are paused when the game is paused.

i can try....

I need this becouse some players in my map deliberately pause game...why? I will explain....

Problem is that while game is paused units cant move, but cooldown of heroes in Tavern continies to reduces...One team gain advantage becouse this.....so i want to prevent it....
 
Level 12
Joined
Jun 1, 2009
Messages
576
or maybe you can prevent them to gain advantage. i think that would be easyer
altough i don't know how your map works:/

what is the advantage one team gains?

Team 1 waits to cooldown in tavern come to 0 so they can attack other team.
Team 2 need to build defense while Team 1 waiting to pick hero.

Players from team 1 pause game....while game is paused Team 2 cant build but cooldown in Tavern of Team 1 continies to reduce even if game is paused...so Team 2 dont have enough time to build unitil Team 1 spawn....Team 1 stole 2-3 seconds.....I hope that you understand.....
 
Level 12
Joined
Oct 16, 2010
Messages
680
Players from team 1 pause game....while game is paused Team 2 cant build but cooldown in Tavern of Team 1 continies to reduce even if game is paused...

remove taverns and add them manually at specific game time.

  • Events
    • Time - Elapsed game time is 60 sec
  • Conditions
  • Actions
    • Unit - Create 1 TomTeamTavern at point blablabla...
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
If you really want to forbid pause it's quite easy.
There is a hardcoded limit of 3 pauses, included the ones made by triggers if i remember correctly.
So just make a trigger which pause/unpause the game 3 times and players wouldn't be allowed to use the pause anymore.
You can try the "event" map initialization, or maybe time elapsed and you shouldn't have to use any wait for the different pause and unpause.

This will work only if it's a lan / battle.net game.
 
Level 12
Joined
Jun 1, 2009
Messages
576
If you really want to forbid pause it's quite easy.
There is a hardcoded limit of 3 pauses, included the ones made by triggers if i remember correctly.
So just make a trigger which pause/unpause the game 3 times and players wouldn't be allowed to use the pause anymore.
You can try the "event" map initialization, or maybe time elapsed and you shouldn't have to use any wait for the different pause and unpause.

This will work only if it's a lan / battle.net game.

Yea you are right, 3 pause is limit....but i am not shure that this includes trigger pauses, but i will try i hope that it will work :)

EDIT: i tryed but pasue/unpause with triggers bugs the game.....even with wait action.....But i found how to stop them to pause.....i need this only for 20 seconds.....so i set periodical event every 0.05 seconds and action FORCE UI CANCEL that prevent players to enter game manu....and after 20 seconds i turn trigger off.......Does anyone know is it a whay to detect pressing F10 (game menu) so i dont need periodical event, becouse it is not reliable?
 
Last edited:
Level 9
Joined
Dec 12, 2007
Messages
489
I didn't know what you did with Troll-Brain's suggestion to use up the pause,
I tried with this simple script run after Elapsed 1 second event on LAN game:
JASS:
call PauseGame(true)
call PauseGame(false)
call PauseGame(true)
call PauseGame(false)
call PauseGame(true)
call PauseGame(false)
it did waste all 3 pauses without any real pause, just 3 message about used up pause.
I didn't know what bug come across you but I can confirm this method works flawlessly in my test.

if you want, you can use PandaMine's AMHS's ReplayDetect function 3 times to use up the pause. although its exaggerating to use it 3 times instead of pause unpause 3 times like what I did.
 
Level 12
Joined
Jun 1, 2009
Messages
576
I didn't know what you did with Troll-Brain's suggestion to use up the pause,
I tried with this simple script run after Elapsed 1 second event on LAN game:
JASS:
call PauseGame(true)
call PauseGame(false)
call PauseGame(true)
call PauseGame(false)
call PauseGame(true)
call PauseGame(false)
it did waste all 3 pauses without any real pause, just 3 message about used up pause.
I didn't know what bug come across you but I can confirm this method works flawlessly in my test.

if you want, you can use PandaMine's AMHS's ReplayDetect function 3 times to use up the pause. although its exaggerating to use it 3 times instead of pause unpause 3 times like what I did.

I used same thing but in gui and with and without pause in my Map intilization trigger and map got buged i dont know why.......I will try one more time, if i dont do it good i will write you for help? Maybe it is becouse map initalization...

EDIT: that was reason, tnx guys! + rep to all
 
Level 9
Joined
Dec 12, 2007
Messages
489
this is the complete trigger I use, in case you need example code:
  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Custom script: call PauseGame(true)
      • Custom script: call PauseGame(false)
      • Custom script: call PauseGame(true)
      • Custom script: call PauseGame(false)
      • Custom script: call PauseGame(true)
      • Custom script: call PauseGame(false)
 
Status
Not open for further replies.
Top