Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Wretched on Mon 27/02/2006 20:54:25

Title: Too many events error (FIXED)
Post by: Wretched on Mon 27/02/2006 20:54:25
I'm getting this 'too many events posted' bug, and have tracked it down.

I can force the error by doing this

player.Walk(40,639, eBlock,eWalkableAreas);
player.Walk(40,639, eBlock,eWalkableAreas);
player.Walk(40,639, eBlock,eWalkableAreas);
player.Walk(40,639, eBlock,eWalkableAreas);
player.Walk(40,639, eBlock,eWalkableAreas);

about 30 times.

(It's a tall scrolly room).

This is obviously an extreme test case, but in a game each time a line like this happens you get closer to the crash. So the crash can happen later unexpectedly where eveything usually worked.

I think if the walk function is unable to reach the position, or is already standing there, the event is not getting cleared.

edit: May or may not be important but code is in a use inventory on hotspot script, and the crash happens even when a few player.Changeroom(player.Room) calls have been made, inbetween.
Title: Re: Error:Too many events v2.71
Post by: Pumaman on Tue 28/02/2006 17:38:22
Can you clarify, does the error happen as soon as you run that script, or once the character reaches the destination?
Title: Re: Too many events error (AGS v2.71)
Post by: Wretched on Tue 28/02/2006 21:06:26
The player walks to the point, then it crashes

Ã,  int t=0;
Ã,  player.Walk(40, 469, eBlock, eWalkableAreas);
Ã,  Display("%d", t);
Ã,  t++;
Ã,  player.Walk(40, 469, eBlock, eWalkableAreas);
Ã,  Display("%d", t);
Ã,  t++;
Ã,  player.Walk(40, 469, eBlock, eWalkableAreas);
Ã,  Display("%d", t);
Ã,  t++;
Ã,  player.Walk(40, 469, eBlock, eWalkableAreas);
Ã,  Display("%d", t);
Ã,  t++;
Ã,  player.Walk(40, 469, eBlock, eWalkableAreas);
/*** crash too many events posted ***/


in fact it crashs on the 5th walk command. Although there were some other walks before this test code happens.
Title: Re: Too many events error (AGS v2.71)
Post by: IceMan on Wed 01/03/2006 16:23:43
I had a similar problem when I manually scripted a character to walk to a hotspot upon interaction.  I forgot that the hotspot already had a "Walk-to" point, so I think the game froze because it was trying to move the character twice at the same time.  Removing the "Walk-to" point fixed this, though.
Title: Re: Too many events error (AGS v2.71)
Post by: Wretched on Wed 01/03/2006 17:01:00
Ah yes, good point, that hotspot already had a walk-to point, I don't usually use them, and forgot about it.

I've removed the walk-to-points, and it still crashes.
Title: Re: Too many events error (AGS v2.71)
Post by: Pumaman on Wed 01/03/2006 20:04:13
Is 469 below the bottom screen Edge (ie. the Edge line in the Room Settings pane, not the actual screen size)?
Title: Re: Too many events error (AGS v2.71)
Post by: Wretched on Wed 01/03/2006 22:43:46
No, bottom screen edge is at 479.
Title: Re: Too many events error (AGS v2.71)
Post by: Pumaman on Thu 02/03/2006 18:48:28
Ok, I've replicated the problem, I'll look into it. Thanks for your help.

Edit by strazer:

AGS v2.72 Beta 5:
* Fixed "too many events posted" error if several commands like Walk were used in quick succession.