Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Calin Leafshade on Wed 28/10/2009 07:40:24

Title: Leaving regions
Post by: Calin Leafshade on Wed 28/10/2009 07:40:24
I have some puddles in a couple of rooms in McCarthy and when you enter and leave the region the script changes the footstep sounds to and from splashy sounds.

now, if you stand in the puddle and INTERACT with something the Leave_Region event isnt triggered until after the interaction, which means the splash sounds stay on until he has finished interacting.

Is this a bug or just a side effect of the way AGS processes events?
and how could i combat the problem?
Title: Re: Leaving regions
Post by: ThreeOhFour on Wed 28/10/2009 09:17:12
You might be able to get around this by using


if (Region.GetAtRoomXY(player.x, player.y) == region[1])
{
sound code
}
else ...


In your room's repeatedly_execute_always() script, instead of relying on the standard Region functions.

Depends on how you're changing the sound, possibly...
Title: Re: Leaving regions
Post by: Khris on Wed 28/10/2009 11:28:28
Or use the global rep_ex_always and put in a check for the correct rooms.

It's not really a bug, the problem is that entering/exiting regions doesn't get processed until after the current blocking event has finished.