Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
snd_playing issue A8 #477437
06/26/19 17:59
06/26/19 17:59
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
This is more of a report than a question. I am updating my game from A7 to A8.

This issue only seems to matter in Published games, and will not appear when run through WED.

It happens if I use snd_playing() to check if a sound handle is currently playing. If I have not already assigned that handle to play a sound, then it seems it will crash the game.

Previously this worked okay, and I would run looping sounds by checking if the sound was playing first, then, if it had stopped, or had not started yet, I would play the sound. For some reason, using snd_loop caused other problems for me, especially when I had many of them playing, so I would play my looping sounds with snd_play, and just perform this check in the entity while loop. In a few cases, I had certain sounds that did not loop continually, but would play sporadically, like when you fire your jet pack, for instance. So the jet pack sound would loop as long as you were holding "space" but until you used it, it would not play the sound. This is the case in which I found this problem.

The fix seems to be to simply assign the handle with a snd_play when it is declared, so snd_playing recognizes the variable as a sound handle.

Re: snd_playing issue A8 [Re: Dooley] #477438
06/26/19 19:17
06/26/19 19:17
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
Ah... this is only a problem if your variable is not initialized to 0.

Re: snd_playing issue A8 [Re: Dooley] #477443
06/27/19 09:39
06/27/19 09:39
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Next time you will know that everything should be initialized grin

Re: snd_playing issue A8 [Re: txesmi] #477446
06/27/19 15:53
06/27/19 15:53
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
I'm wondering how A7 was able to handle this, but A8 is not. In any case, I figure it is probably good for the game, the old version might not have crashed right away, but maybe it opened up some memory leak because of this. There were some seemingly random crashes happening in the old version, that I never could pin down.


Moderated by  HeelX, Spirit 

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