Pause game when Steam Overlay is Active Greenworks Plugin

0 favourites
  • 7 posts
From the Asset Store
Vintage steam pixels for your UI! 125 unique assets in a single pack!
  • Hello,

    I'm having trouble getting my game to pause when the Steam overlay is active. I am using the latest Greenworks Plugin and my NW.js and Steam SDK are the correct versions. Everything is working fine overlay opens and closes achievements work no problem. The only issue is when the overlay is open my game keeps running where I would like it to pause so the player doesn't fail. I have tried many different combinations with both "on overlay activated" and "is overlay enabled" and nothing works. I would assume on overlay activated > toggle "my boolean for pause" would be the way this works, but it doesn't. Every time I try something new for this I have to prepare all of the files for Steam which takes a few minutes and it's starting to get to me. I cannot share my files as my game is currently in prerelease sorry. This isn't make or break as you can just pause and then use the overlay, but it's inconvenient. Any help is greatly appreciated.

  • Well without seeing the project events... I'd first want to confirm via some sort of visible and/or audible indicator that 'on overlay activated' is firing when you expect it to (and only when you expect it to).

    Assuming your pause is set up and working as intended when used manually. Then I'd check your pause toggle to make sure nothing else is interfering with that and possibly unpausing on the same tick, as often happens.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey oosyrag Thank you for the quick response. I did try that with a text by setting visible/invisible also tried the same thing with a sprite. The pause function is working fine on it's own with normal controls even pauses if the controller dies. As far as the same tick thing I know exactly what you mean I've run into that before and I've gotten around it by using a wait 0.1 seconds before next event. This doesn't seem to work in this case it's almost as though the Steam Overlay activates but doesn't call back to the game and tell it "hey im on now" so my game just keeps going. This is my first time really messing with Steam API and the rest of it is all fine it's just this 1 thing.

  • So you said you tried with a text and sprite visibility, those didn't work either? So the on overlay activated trigger isn't firing at all and same with the overlay enabled condition? Sounds like this should go in a bug report on GitHub then.

  • Yeah that's what I'm thinking too. I searched everywhere for info on this and recompiled the game uploaded to steam like 10 times and was finally like yeah...forum time lol thank you for helping me troubleshoot. If I somehow figure it out I'll post the result here.

  • Ok so I found the solution....total user error on my part. As I mentioned I'm new to this and this was my first go around with Greenworks and the Steam API. This also ended up worse before it got better and I'm hoping to help prevent the same headaches for anyone who reads this in the future. When I went to make the game pause when overlay active I did have it set correctly, however when I compiled the project I not only still had this broken but also managed to break my achievements.. Now I didn't immediately check my project because I had also just reset all achievements on steam to re-test them and I thought that the command I ran "reset_all_stats <appid>" to do that had somehow broken something because my game was only in pre-release and not public. Before you end up feeling as dumb as I did and go 50 builds deep like me...here's what happened. Anyone who goes looking will see that you need 4 files from the Steam SDK that are compatible with your version of Greenworks and NW.js these are .dll and .lib files the first being in public>steam>lib> and then whichever OS you're building. You will notice in that folder win32 and win64 each have a folder. The other files are in redistributable_bin in this folder you will see a folder for win64 BUT no folder for win32. The 2 files not in a folder ARE the win32 .dll and .lib files. You can imagine that fishing for these files could get annoying every time you go to build..which is why I tried to be slick and put all these files into a folder so I could just copy/paste all at once into the package file. Here's where I messed up I was building for win64 but when I made my little "shortcut" I grabbed the 32 bit redistributables...yeah..so for the next 50 builds I was copying the wrong SDK files from my "shortcut" into my build which of course broke communication with Steam and caused everything to break including achievements. I hope this helps save someone from being dumb like me. Lesson to be learned here is that I know releasing your game is exciting and this is the final stretch before doing so, but chill, breathe and take your time because 2 files being wrong could ruin your world quick. Sorry for the long post I hope you all have a great day!

  • Thanks for the follow-up!

Jump to:
Active Users
There are 2 visitors browsing this topic (0 users and 2 guests)