1 registered members (7th_zorro),
1,390
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
step sound
#409678
10/20/12 18:13
10/20/12 18:13
|
Joined: Oct 2012
Posts: 22 Austria
WeTwoPlays
OP
Newbie
|
OP
Newbie
Joined: Oct 2012
Posts: 22
Austria
|
action player_all () { while(1) { camera_follow(me); my.pan += (mouse_force.x)*-5*time_step; var distance = (key_w-key_s)*11*time_step; c_move(me, vector(distance,0,0), NULL, GLIDE); var distance1 = (key_a-key_d)*11*time_step; c_move(me, vector(0,distance1,0), NULL, GLIDE); wait(1); } } wehen i use if (distance > 2) { media_loop("schritte.wav",NULL,100); wait(1); } the walk speed slows down extreamly..... what can i do? (Yes I'm a beginner)
|
|
|
Re: step sound
[Re: WeTwoPlays]
#409679
10/20/12 18:35
10/20/12 18:35
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
You can avoid that the step_sound ist played immediately again and again although it has been already started, when you check whether the sound is still playing: http://www.conitec.net/beta/asnd_playing.htmSOUND* step = step.wav; ... var step_handle = ent_playsound(my,step,100); //set a handle to the playing sound if(snd_playing(step_handle) == 0) // check whether the sound is still playing, if it is not playing, play it { snd_play(step_handle,100,0); }
|
|
|
Re: step sound
[Re: WeTwoPlays]
#409698
10/20/12 23:02
10/20/12 23:02
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Haha weather? I suggest you check the meaning of "whether", not "weather/ wheather", and read Pappenheimer's post again. I suggest you don't use the media_... but snd_... instructions, the latter have a few advantages. Additionally, if the sound is for the player, use snd_..., otherwise, for enemies and the like, use ent_playsound to achieve a 3dimensional sound effect (you can try to deactivate the doppler_effect, too, I don't like it).
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: step sound
[Re: Superku]
#409876
10/23/12 18:12
10/23/12 18:12
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
X
|
X
Joined: Jul 2008
Posts: 2,107
Germany
|
var step_handle = ent_playsound(my,step,100); //set a handle to the playing sound if(snd_playing(step_handle) == 0) // check whether the sound is still playing, if it is not playing, play it { snd_play(step_handle,100,0);
Or combine your walking animation percentage with the sound playing function.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|