I need to play back a sound on a specific view/frame. I know I can assign a sound to a certain frame in the view editor, but I want a different sound in each room, so I want to be able to set this through the script. Here is what I tried:
if ((character[JOSH].view == 40) && (character[JOSH].frame == 6)) {
Ã, PlaySound(4);
}
I put this in 'repeatdly execute', but no sound!
How about running SetFrameSound (view, loop, frame, sound) in 'Player enters screen'?
Doh!
Thank you Ashen... :)
Or put it in the on_event function:
// main global script
function on_event (int event, int data) {
if (event == ENTER_ROOM) {
int newsound=0; // 0 = disable sound if no sound set for new room
if (data == 2) newsound = 7;
else if (data = 5) newsound = 9;
else if (data = 11) newsound = 2;
//...
SetFrameSound(40, 0, 6, newsound);
}
}