Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 1,390 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
step sound #409678
10/20/12 18:13
10/20/12 18:13
Joined: Oct 2012
Posts: 22
Austria
W
WeTwoPlays Offline OP
Newbie
WeTwoPlays  Offline OP
Newbie
W

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 Offline
Senior Expert
Pappenheimer  Offline
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.htm

SOUND* 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: Pappenheimer] #409680
10/20/12 18:42
10/20/12 18:42
Joined: Oct 2012
Posts: 22
Austria
W
WeTwoPlays Offline OP
Newbie
WeTwoPlays  Offline OP
Newbie
W

Joined: Oct 2012
Posts: 22
Austria
THX

Re: step sound [Re: WeTwoPlays] #409681
10/20/12 18:44
10/20/12 18:44
Joined: Oct 2012
Posts: 22
Austria
W
WeTwoPlays Offline OP
Newbie
WeTwoPlays  Offline OP
Newbie
W

Joined: Oct 2012
Posts: 22
Austria
BUT I HAVE NO WHEATHER

Re: step sound [Re: WeTwoPlays] #409684
10/20/12 20:09
10/20/12 20:09
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pardon?
Vielleicht mal in Deutsch?

Re: step sound [Re: Pappenheimer] #409693
10/20/12 22:11
10/20/12 22:11
Joined: Oct 2012
Posts: 22
Austria
W
WeTwoPlays Offline OP
Newbie
WeTwoPlays  Offline OP
Newbie
W

Joined: Oct 2012
Posts: 22
Austria
es soll aber für alle verständlich sein ich versuch
function step()
{
if (key_w)
{
media_loop("schritte.wav",NULL,100);
}
}

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 Offline
Senior Expert
Superku  Offline
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 Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Quote:
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;

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1