ID:156122
 
How can I pause a game, stopping all loops, movement, ai, etc, and show the player a pause screen with an inventory. (obviously since this pauses its going to be single player).

Basically what I want is to pause the whole game but still accept player input so their able to mess with their inventory. Is there a way to do this without checking if the game is paused in every single loop? If no, I have a lot of work modifying my code...
HearMeRoar wrote:
Is there a way to do this without checking if the game is paused in every single loop?

There's no other way, it's a lot of copy paste, just add "while(paused) sleep(1)" (without quotes) in all proc/loops that must be paused.
In response to Ripiz
it might be a good idea to have a proc to decide if the game is paused or not, so later on you can change things if you have to. For example
var/paused
proc/check_pause()
if(paused) return 1
return 0

However, in this case the proc might not be necessary and the variable will be sufficient, but its always nice to be flexible.
In response to Donut_eater
There is no way, in any type of coding, to just make something that stops everything with no sort of coding elsewhere. You'd need to check if the game is paused in every proc or verb or what have you.
In response to Xyphon101
Thx Xyphon for telling me exactly what everyone else told me, your extremely helpful.
In response to HearMeRoar
HearMeRoar wrote:
Thx Xyphon for telling me exactly what everyone else told me, your extremely helpful.
No need to get snappy, I'm sorry that I was no help but that comment was uncalled for.
In response to Xyphon101
technically, you can't tell if I'm being snappy or not since I'm writing this and you can't tell my tone. I actually meant it in a dry sarcastic way, not a snappish way. although my comment was uncalled for, neither was yours. (and neither is this one)
In response to HearMeRoar
By uncalled for I didn't mean that it was useless, I meant there was no need in the sarcasm when I am actually trying to help you. But whatever, let's end it at that.
In response to Xyphon101
no
In response to HearMeRoar
Its usually the start button or escape.