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
1 registered members (TipmyPip), 18,574 guests, and 6 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
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