Gamestudio Links
Zorro Links
Newest Posts
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
FXCM => AVA Trade Plugin???
by Martin_HH. 11/17/26 17:02
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (LucasJoshua, 1 invisible), 45,486 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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