Problem with PauseGame

Started by Mr Jake, Sat 03/07/2004 19:19:38

Previous topic - Next topic

Mr Jake

The problem being that the game doesnt pause :/

if (keycode==32){
Ã,  Ã,  if (IsGamePaused () == 1){
Ã,  Ã,  Ã,  Ã,  TintScreen (0,0,0);
Ã,  Ã,  Ã,  Ã,  GUIOff (6);
Ã,  Ã,  Ã,  Ã,  UnPauseGame();
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  else {
Ã,  Ã,  Ã,  Ã,  TintScreen (50, 50, 100);
Ã,  Ã,  Ã,  Ã,  PauseGame ();
Ã,  Ã,  Ã,  Ã,  GUIOn (6);
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã, }Ã,  Ã, 

This is inside 'on_key_press'

Ishmael

Try:

     else {
        TintScreen (50, 50, 100);
        GUIOn (6);
        Wait(1);
        PauseGame ();
        }
     }   


Just a thought... You could also try without the Wait.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Mr Jake

#2
it was like that without the wait before but it didnt work, I will try the Wait now :D

EDIT: Na da, still no workie

Ishmael

Don't ask where, but I gut this idea:

if (keycode==32) {
    if (IsGamePaused () == 0) {
        TintScreen (50, 50, 100);
        GUIOn (6);
        PauseGame ();
    } else {
        UnPauseGame();
        TintScreen (0,0,0);
        GUIOff (6);
    }
}   

I remember flipping the condition order helps a bit in some rare cases... or it's just me.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Mr Jake

#4
Nope :( didnt work :(

This is the current script:
if (keycode==32) {
Ã,  Ã,  if (IsGamePaused () == 0){
Ã,  Ã,  Ã,  Ã,  TintScreen (50, 50, 100);
Ã,  Ã,  Ã,  Ã,  GUIOn (6);
Ã,  Ã,  Ã,  Ã,  Wait (2);
Ã,  Ã,  Ã,  Ã,  PauseGame ();
Ã,  Ã,  Ã,  Ã,  } else {
Ã,  Ã,  Ã,  Ã,  GUIOff (6);
Ã,  Ã,  Ã,  Ã,  TintScreen (50, 50, 100);
Ã,  Ã,  Ã,  Ã,  Wait (2);
Ã,  Ã,  Ã,  Ã,  UnPauseGame ();
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã, }Ã,  Ã, 


EDIT: I wont even tell you what the problem was, its too stupid :D

TerranRich

What do you mean you won't tell us what the problem was? Is it fixed? If so, let us know so we can find you beat you down--- um, I mean edit your first post's icon to the thumbs-up. :P
Status: Trying to come up with some ideas...

Mr Jake

[size=10] I forgot to comment out the 'If (IsGamePaused() == 1) keycode 0;' line [/size]

Scorpiorus

In fact, it's not that stupid at all. These things can be difficult to think of since they are here in the script by default and as a result aren't paid much attention to.

A very similar problem I remember was with the 'handling inventory clicks in script' option - if it's ticked we can handle clicks by putting if(button==LEFT/RIGHTINV) code into the on_mouse_click but we usually add them after the if(button==LEFT/RIGHT) blocks which are inclosed within an if(IsGamePaused()==0) condition. Thus if an inventory GUi is set to PopupModal the inventory clicks won't work since IsGamePaused returns 1.

SMF spam blocked by CleanTalk