Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: MiteWiseacreLives! on Tue 16/12/2014 17:53:02

Title: Getting a warning file "Wait() was used in Player Enters Screen" [SOLVED]
Post by: MiteWiseacreLives! on Tue 16/12/2014 17:53:02
When I compile my game I get the following message in a warnings.txt file
Quote(in room 14): Wait() was used in Player Enters Screen - use Enters Screen After Fadein instead

apparently it comes from this bit of code:

Code (ags) Select
function room_Load()
{
  aPOL_lens_flare_short.Stop();
  cChar2.Transparency = 100;
  cChar2.FollowCharacter(null);
  cEgo.Move(316, 10, eBlock, eAnywhere);
  mouse.DisableMode(eModeAttack);
  cEgo.LockViewFrame(78, 2, 0);
  cEgo.SpeechView = 79;
}


Note: the game plays fine.
Searching the forums, found some vague clues that it may be regarding LockView ??? Nothing that really helps me..
If you use LockView after fade-in will there be a noticeable frame switch?
Title: Re: Getting a warning file "Wait() was used in Player Enters Screen"
Post by: Vincent on Tue 16/12/2014 17:59:47
Quote from: MiteWiseacreLives! on Tue 16/12/2014 17:53:02
use Enters Screen After Fadein instead

Okay, did you do that ?
Code (ags) Select

function room_AfterFadeIn()
{
  aPOL_lens_flare_short.Stop();
  cChar2.Transparency = 100;
  cChar2.FollowCharacter(null);
  cEgo.Move(316, 10, eBlock, eAnywhere);
  mouse.DisableMode(eModeAttack);
  cEgo.LockViewFrame(78, 2, 0);
  cEgo.SpeechView = 79;
}
Title: Re: Getting a warning file "Wait() was used in Player Enters Screen"
Post by: Cassiebsg on Tue 16/12/2014 18:19:57
You have a "eBlock" command there, try changing it to "eNoBlock"... ;)
Title: Re: Getting a warning file "Wait() was used in Player Enters Screen"
Post by: MiteWiseacreLives! on Tue 16/12/2014 18:20:37
Ok your right, I was being lazy and not doing the testing... little afraid to break something at this point.
Although, I did think it would be good for documentation to identify what actually triggers this.
This:
Code (ags) Select
  cEgo.Move(316, 10, eBlock, eAnywhere);
is bad in  room_Load() (eBlock == Wait ??)

Changed it to
Code (ags) Select
cEgo.x = 316;
cEgo.y = 10


and now AGS is happy again.

Edit:
Your totally right Cassiebsg
Title: Re: Getting a warning file "Wait() was used in Player Enters Screen"
Post by: Crimson Wizard on Tue 16/12/2014 18:25:33
You should not use any blocking function in Room_OnLoad, or game_start(). This is a general rule.
Title: Re: Getting a warning file "Wait() was used in Player Enters Screen"
Post by: Cassiebsg on Tue 16/12/2014 18:26:51
yes, with eBlock you telling your game to wait until your character reaches it's destination.
Title: Re: Getting a warning file "Wait() was used in Player Enters Screen"
Post by: MiteWiseacreLives! on Tue 16/12/2014 18:30:45
Yah, should have known better! Don't know why I didn't put it in the player.changeroom command either :-[

SOLVED