Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Slasher on Mon 16/09/2013 06:47:25

Title: SOLVED: Repeated condition in AfterFadeIn
Post by: Slasher on Mon 16/09/2013 06:47:25
Hi,

I'm having a spot of trouble with my main room: Room 1

Everything works ok until I get to this part AfterFadeIn():

Code (ags) Select

}
else if (cSpaceman.PreviousRoom==24)
{
  AudioChannel *channel = aScuttling_creature.Play();
 
  int soundPos = -80;
  while (soundPos < 80)
{
  channel.Panning = soundPos;
  soundPos++;
  Wait(100);

// if I take all the audio and panning out it works fine else this condition all gets repeated. Adding a Bool does not seem to alter the repeating.

cSpaceman.Say("Hey! Something just brushed passed!");
 
game.speech_text_align =eAlignLeft;
Button23.Animate(5,0, 2, eRepeat);
cSpace.SayAt(3, 300, 200, "Captain. The bridge deck appears to have been breached by an unknown entity.");
Button23.NormalGraphic=414;
game.speech_text_align =eAlignCentre;
cSpaceman.Say("Something is on this ship  and I fear our journey could be jeopardized. SAL: activate force field.");

game.speech_text_align =eAlignLeft;
Button23.Animate(5,0, 2, eRepeat);
cSpace.SayAt(3, 300, 200, "Force field activated Captain.");
Button23.NormalGraphic=414;
game.speech_text_align =eAlignCentre;
cSpaceman.Say("Whatever it is it's not leaving this ship!")
}
}




Can you see / help with an errors / corrections please.

Thank you


Title: Re: Repeated condition in AfterFadeIn
Post by: MiteWiseacreLives! on Mon 16/09/2013 08:19:10
It looks like your While statement is missing a closing brace } , also Wait(100) is a pretty long pause for a 160 cycle loop... 2 1/2 seconds * 160?
Title: Re: Repeated condition in AfterFadeIn
Post by: Slasher on Mon 16/09/2013 09:22:36
Blast it! I did miss the closing brace and redone Wait to Wait (1) >:(

Thanks  MiteWiseacreLives!

Title: Re: SOLVED: Repeated condition in AfterFadeIn
Post by: Snarky on Mon 16/09/2013 13:53:06
The reason you didn't spot this mistake yourself is that you're not using proper indenting.