• 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.

[Question] TriggerSleepAction in Reforged and before

Status
Not open for further replies.
Level 3
Joined
Jan 6, 2016
Messages
12
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?
 
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 3
Joined
Jan 6, 2016
Messages
12
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