Leaving regions

Started by Calin Leafshade, Wed 28/10/2009 07:40:24

Previous topic - Next topic

Calin Leafshade

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?

ThreeOhFour

#1
You might be able to get around this by using

Code: ags

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

Khris

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.

SMF spam blocked by CleanTalk