Gamestudio Links
Zorro Links
Newest Posts
Issues with converting .csv to .t6
by jcl. 07/16/19 14:46
IG plugin initial release
by YG8. 07/16/19 10:02
First Steps for backtesting with ASCII data
by Charttrader. 07/16/19 08:50
New Zorro version 2.15
by jcl. 07/16/19 08:42
Beginners Workshop
by jcl. 07/15/19 06:29
Dukascopy plugin (yet another version)
by dh85. 07/15/19 05:03
lock profit without trail
by Grat. 07/14/19 15:53
What are you working on?
by rayp. 07/12/19 15:32
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
9 registered members (Peeyotch, chsmac85, AndrewAMD, MatPed, Grat, kvm, Matt_Aufderheide, YG8, 1 invisible), 677 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Charttrader, bjomu, catharticlapse, carmyss121, Evox
18255 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: 675
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 675
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: 675
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 675
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,234
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,234
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: 675
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 675
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