Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Sayhello-hello on Sat 20/03/2010 20:28:45

Title: Game is crashing during test
Post by: Sayhello-hello on Sat 20/03/2010 20:28:45
Hi,

it seems like my game is crashing when I try to run a test, although I'm not sure it's an actual crash because there's no error message, the game screen just goes black and there isn't anything I can do. Has anyone else had this problem and know how to solve this?
Title: Re: Game is crashing during test
Post by: barefoot on Sat 20/03/2010 20:34:18
It might be waiting for something to happen before it loads, possibly an event... but is unable to do so. Maybe you have 'when room first loads' event instead of 'after room fades in' event???

If you post your code here someone maybe able to help further.

barefoot
Title: Re: Game is crashing during test
Post by: Sayhello-hello on Sat 20/03/2010 21:01:11
I have used the "enters room before fade-in" event.

 function room_Load()
{
  if (cEgo.PreviousRoom == 26) {
    gIconbar.Visible = false;
cEgo.Say("Honey, I'm home!");
  cEgo.Walk(590, 223, eBlock);
  cEgo.Say("Honey?");
  cEgo.Walk(263, 438, eBlock);
  cEgo.Say("Hello?");
  cEgo.ChangeRoom(22);
  }
  else if (cEgo.PreviousRoom == 22) {
      gIconbar.Visible = true;
     }
}


So the first if-sentence is sort of a cutscene and leads to room 22, which is another kind of cutscene that then leads back to the room triggering the else/if sentence when the player is allowed to play.
Title: Re: Game is crashing during test
Post by: monkey0506 on Sat 20/03/2010 21:12:33
Unless I'm mistaken, isn't the room_Load function the "before fade-in" event?
Title: Re: Game is crashing during test
Post by: Crimson Wizard on Sat 20/03/2010 22:00:53
Quote from: monkey_05_06 on Sat 20/03/2010 21:12:33
Unless I'm mistaken, isn't the room_Load function the "before fade-in" event?
What monkey means, everything in that function happen while screen is black (faded out) :)
You should change to function "after fade-in".
Title: Re: Game is crashing during test
Post by: monkey0506 on Sat 20/03/2010 23:40:13
Actually yes, if I had properly read your post you explicitly said you were using the "before fade-in" event. If you think this through for just a moment here, you should be able to see the problem.. ::)

You're calling all these blocking Says and Walks before the screen fades in to show the new room. Change it to the "after fade-in" event and it should stop hanging up like that.
Title: Re: Game is crashing during test
Post by: Sayhello-hello on Sun 21/03/2010 09:11:25
Okay, I changed it and it worked! Thanks alot for the help. :)