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
3 registered members (LucasJoshua, rht, 1 invisible), 30,443 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rht, MaliceTheMaker, Haitao_Ren, JimSimons, julienp
19249 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
playing one sound during a while loop (possible?) #144996
08/01/07 06:48
08/01/07 06:48
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline OP

Expert
aztec  Offline OP

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
Hey I just go a quick question I got 4 Moddel moving to their possition in one while loop.
So for now that work but know everytime one moddel reaches it target i´d like to play a sound.

My wuestion:
is it possible and how can I do it without getting loops

Regards
Aztec


Visit:
schwenkschuster-design.de
Re: playing one sound during a while loop (possible?) [Re: aztec] #144997
08/01/07 07:53
08/01/07 07:53
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
I encounter this problem all the time, when I want to call a function in a while loop but only have it execute once. I always do something like this:

Code:
 

var sound_played = 0;

function play_my_sound()
{
if(sound_played == on) { return; }
sound_played = on; // when it tries to run the second time, it will return

...
}

...
while(whatever)
{
play_my_sound();
...
wait(1);
}
sound_played = 0; // when the loop is over, reset the variable




Hope that helps.

Re: playing one sound during a while loop (possible?) [Re: LogantheHogan] #144998
08/01/07 08:08
08/01/07 08:08
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline OP

Expert
aztec  Offline OP

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
thx I´ll have a try


Visit:
schwenkschuster-design.de
Re: playing one sound during a while loop (possible?) [Re: aztec] #144999
08/02/07 10:31
08/02/07 10:31
Joined: Aug 2007
Posts: 16
Texas
bigshad226 Offline
Newbie
bigshad226  Offline
Newbie

Joined: Aug 2007
Posts: 16
Texas
better than what i could do


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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