Getting a warning file "Wait() was used in Player Enters Screen" [SOLVED]

Started by MiteWiseacreLives!, Tue 16/12/2014 17:53:02

Previous topic - Next topic

MiteWiseacreLives!

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
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?

Vincent

Quote from: MiteWiseacreLives! on Tue 16/12/2014 17:53:02
use Enters Screen After Fadein instead

Okay, did you do that ?
Code: ags

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;
}

Cassiebsg

You have a "eBlock" command there, try changing it to "eNoBlock"... ;)
There are those who believe that life here began out there...

MiteWiseacreLives!

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
  cEgo.Move(316, 10, eBlock, eAnywhere);

is bad in  room_Load() (eBlock == Wait ??)

Changed it to
Code: ags
cEgo.x = 316;
cEgo.y = 10


and now AGS is happy again.

Edit:
Your totally right Cassiebsg

Crimson Wizard

You should not use any blocking function in Room_OnLoad, or game_start(). This is a general rule.

Cassiebsg

yes, with eBlock you telling your game to wait until your character reaches it's destination.
There are those who believe that life here began out there...

MiteWiseacreLives!

Yah, should have known better! Don't know why I didn't put it in the player.changeroom command either :-[

SOLVED

SMF spam blocked by CleanTalk