Way to find out is gamesim on pause or no

Moderator: GZDoom Developers

User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Way to find out is gamesim on pause or no

Post by Apeirogon »

Last several days Im trying to make on zscript side simple OOP-like 2D drawer (or something like that), to get rid of over-complication of code arising when drawing a lot of pictures/text using render overlay/status bar draw/another function that able to draw something on screen.

I have this for now
https://github.com/MekBoss/gzdoom-2d-OOP
Its a WIP so it a little rough. Just a LITTLE.

Download it and run with Gzdoom.
After you run it and load a map it should start to draw fire with velocity pointed in the direction somewhere to the upper left corner of a screen. Problem is, there is no way to stop drawing in overlay when you open console or hit "Pause" button. I found a way to stop it when main menu is open, but thats it.
All other functions/variables which can say is game paused or no located beyond the Great Zscript Complinig Mountains, in C++. So, it would be great if such function would be exported to zscript.
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: Way to find out is gamesim on pause or no

Post by Player701 »

Apeirogon wrote:Last several days Im trying to make on zscript side simple OOP-like 2D drawer (or something like that), to get rid of over-complication of code arising when drawing a lot of pictures/text using render overlay/status bar draw/another function that able to draw something on screen.

I have this for now
https://github.com/MekBoss/gzdoom-2d-OOP
Its a WIP so it a little rough. Just a LITTLE
Perhaps you'd want to take a look at the UI code in my own project, where I have attempted something similar. Though I haven't done much work with animations - the main goal was to support simple customizable HUDs.

As for your suggestion, perhaps there could also be some way to override the logic that shows the M_PAUSE graphic when the game is paused? This way, not only it would be possible to detect whether the game is paused, but also do something about it (or not). This would of course only make sense for UI-only code.
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: Way to find out is gamesim on pause or no

Post by Player701 »

Could anyone please tell me why this was closed as a duplicate? I could not find any related suggestions, and it looks like I'm going to need this feature for some final optimizations in my mod in order to deal with this issue.
SanyaWaffles
Posts: 810
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields

Re: Way to find out is gamesim on pause or no

Post by SanyaWaffles »

I think it was added?
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: Way to find out is gamesim on pause or no

Post by Player701 »

OK, then how do I check if the game is currently paused? I could not find anything relevant in the ZScript code in gzdoom.pk3, so I will appreciate if someone could point me in the right direction.
SanyaWaffles
Posts: 810
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields

Re: Way to find out is gamesim on pause or no

Post by SanyaWaffles »

viewtopic.php?f=15&t=71467&p=1187800&hilit=paused#p1187800

I could have sworn this was added. Maybe a false memory, sorry x_x
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: Way to find out is gamesim on pause or no

Post by Player701 »

Thanks. I have no idea why it didn't turn up in my search results. Guess I will have to do a PR this weekend if I have the time for it.

Return to “Closed Feature Suggestions [GZDoom]”