Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,302 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
pickup sound not working right #309582
02/10/10 03:21
02/10/10 03:21
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
ok i have a simple pickup item, i want a sound to play while this item is being picked up. but instead of just playing once it loops, i must have it wrong:

action Ring_illumi_pickup
{

while (player == null) {wait (1);}
my.passable = on;
while (vec_dist (player.x, my.x) > 100) {wait (1);}
my.invisible = on;
my.lightred = 255;
my.lightgreen = 0;
my.lightblue = 0;
while (1)
{
snd_play (creepsnd, 80, 0);
wait(-3);{
snd_stop (creepsnd);}
}

can you guys help me out?

and yes i have "sound creepsnd = <creepsnd.wav>;" at the top:P


Last edited by Doc_Savage; 02/10/10 03:35.

Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: pickup sound not working right [Re: Doc_Savage] #309583
02/10/10 03:27
02/10/10 03:27
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

This part of your code will work forever

while (1)
{
snd_play (creepsnd, 80, 0);
wait(-3);{
snd_stop (creepsnd);}
}


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: pickup sound not working right [Re: Doc_Savage] #309584
02/10/10 03:29
02/10/10 03:29
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
var pickup_snd_handle = 0;

action Ring_illumi_pickup
{

while (player == null) {wait (1);}
my.passable = on;
while (vec_dist (player.x, my.x) > 100) {wait (1);}
while (1)
{
if(!snd_playing(pickup_snd_handle))
{
pickup_snd_handle = snd_play (creepsnd, 80, 0);
}
wait(-3);{
snd_stop (creepsnd);}
}

Re: pickup sound not working right [Re: Pappenheimer] #309586
02/10/10 03:35
02/10/10 03:35
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
oh my god pappen that works great! tell me, what did i do wrong?

EDIT: ok now the thing i made it do while pressing the f key dosent work, it only plays the sound again.

Last edited by Doc_Savage; 02/10/10 03:47.

Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.

Gamestudio download | 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