I like to play a sound (mp3 or midi) while the main character is moving/walking.
I try to use in the repeatdeley execute rutine the code
if (cEgo.Moving) {
PlayMP3File ("sound7.mp3");
}
where sound 7 is the sound. But it start to play without stopping.
I a using an ancient AGS (2.71).
Help please !
Thank you.
The view editor allows you to play specific sounds for specific frames. Perhaps that is what you are looking for.
Well, maybe not really. Because the character can remain on the intermediary position, and the sound shall stop, because the character is not moving. Is there possible to identify if the character is moving, other than I tryed ? Thank you
Then I guess I don't understand what you are asking or trying to do. Sorry?
I like, as a basic example, toassociate, footsteps sounds to a character, while he is walking, but silence when he is not walking.
Then check out what I suggested. Attach the fotstep sounds to the individual frames. That's what it's for.
OK, i try to do this. But I don't know how to insert / associate sound to a frame. I repeat, I use an old version, the 2.71. It is possible to associate a sound to a frame in that version ?
It's an old feature so it ought to be there. Under each frame there is a field for sound number and a field for delay. Don't remember if it's right or left click to modify but it should be easy enough to figure out.
Btw, you probably should consider upgrading to V2.72 as it is more complete and bug free. I am not aware of any disadvantages in upreading.
Thank you very much. I will try and announce you what I have realised. I never used this feathure. It seems to work with right click on the text under the frame.
I try to make it, but at first try, I failed. No matter, I will still try.
Quote from: kantor_98 on Sat 02/05/2009 20:41:02
I try to make it, but at first try, I failed. No matter, I will still try.
Oh, well if you have so much trouble try putting this on the repeatedly execute section of the game
if (character.Room==player.Room) {
if (character.Moving==true) {
if (character.Frame== frameyouwantgoeshere) {
PlaySound(soundhere);
}
}
}
Quote from: Dualnames on Sun 03/05/2009 01:18:05
Oh, well if you have so much trouble try putting this on the repeatedly execute section of the game
May need to be rep_exec_always, if there ever any eBlock walk commands.
~Trent