Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Eon_Star on Tue 31/08/2021 20:11:12

Title: Region Sounds Script (2 different walk Sounds for one room)
Post by: Eon_Star on Tue 31/08/2021 20:11:12
Hi Folks!

I was trying to set different sounds to the different regions. First I set this code together (from other scripts in the forum):

Code (ags) Select


function room_RepExec()
{
if (Region.GetAtRoomXY(player.x, player.y) == region[1]) {
     
      {
if(cLiza.x >=369 && (cLiza.Frame==3 || cLiza.Frame==6)) 
{     
aWalk_on_Sand.Play(eAudioPriorityHigh);


}
      }
}
}



Then I set my characters walking view sounds (The related sound to the related frame). The result is good. So I have two different walking sounds for one room.

You can give it a try if you need. Happy programming guys.

Cheeres