sound while moving

Started by kantor_98, Sat 02/05/2009 18:27:21

Previous topic - Next topic

kantor_98

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.

RickJ

The view editor allows you to play specific sounds for specific frames.  Perhaps that is what you are looking for.

kantor_98

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

RickJ

Then I guess I don't understand what you are asking or trying to do.  Sorry?


kantor_98

I like, as a basic example, toassociate, footsteps sounds to a character, while he is walking, but silence when he is not walking.

RickJ

Then check out what I suggested.  Attach the fotstep sounds to the individual frames.  That's what it's for.

kantor_98

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 ?

RickJ

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.

kantor_98

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.

kantor_98

I try to make it, but at first try, I failed. No matter, I will still try.

Dualnames

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

Code: ags

if (character.Room==player.Room) {
if (character.Moving==true) {
if (character.Frame== frameyouwantgoeshere) {
PlaySound(soundhere);
}
}

}
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Trent R

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
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

SMF spam blocked by CleanTalk