• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[Question] TriggerSleepAction in Reforged and before

Status
Not open for further replies.
Level 2
Joined
Jan 6, 2016
Messages
9
Does anyone have an idea if TriggerSleepAction was 'broken' in Reforged? According to my own memory and some forum posts, TriggerSleepAction was ticking even when the game is paused/a person is lagging/disconnecting. So it was perfect for e.g. manipulating music/sounds which continue to run during such pauses and you could run the next sound right after the previous one has finished even if someone is lagging at this moment. I'm also seeing some other hacky benefits in this behaviour.

However, according to my tests, in the current game version TriggerSleepAction stops counting when the game is paused. Both in JASS and Lua, both in single player and multiplayer. TriggerWaitForSound also doesn't unpause the thread if the game is paused at the moment the sound finishes, it only unpauses the thread after the game is unpaused with a short delay.

Did anyone else encounter this, or am I making things up? Also, do you know something else that would allow running some code while the game is paused?
 
Level 12
Joined
Jun 12, 2010
Messages
413
Does anyone have an idea if TriggerSleepAction was 'broken' in Reforged? According to my own memory and some forum posts, TriggerSleepAction was ticking even when the game is paused/a person is lagging/disconnecting. So it was perfect for e.g. manipulating music/sounds which continue to run during such pauses and you could run the next sound right after the previous one has finished even if someone is lagging at this moment. I'm also seeing some other hacky benefits in this behaviour.

However, according to my tests, in the current game version TriggerSleepAction stops counting when the game is paused. Both in JASS and Lua, both in single player and multiplayer. TriggerWaitForSound also doesn't unpause the thread if the game is paused at the moment the sound finishes, it only unpauses the thread after the game is unpaused with a short delay.

Did anyone else encounter this, or am I making things up? Also, do you know something else that would allow running some code while the game is paused?
Pretty sure the case was that it continued counting, but never woke the thread up. Just meant that, if a player lagged for 60 seconds right after you start a 60 second wait, the trigger would resume as soon as the player stopped lagging, since the wait timer was still ticking during this time. Not that I ever tested this, so I'm not sure this was indeed ever the case or whether it has been changed.

It has never been possible to execute code while the game is paused in any way.
 
Level 2
Joined
Jan 6, 2016
Messages
9
It has never been possible to execute code while the game is paused in any way.
Actually there is one I know - chat messages. I've tried to pause the game and input some commands in my map, they had an immediate effect. But still it doesn't allow to do that from code, yeah, it requires an external source for that :(

It's sad though, I was trying to do an automatic save on disconnect (for the player who disconnects) - by detecting the moment they start lagging, for example (the idea was to maybe run a sync periodic timer and a loop with TSA to check against each other to detect lag). In theory, the game has all the data to do that on disconnection.
 
Status
Not open for further replies.
Top