Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Fixed my old sound emitter script - now works with no fps drops.

Author
Message
Hamburger
15
Years of Service
User Offline
Joined: 23rd Jun 2009
Location: Grand Rapids MI
Posted: 26th Aug 2011 20:00 Edited at: 26th Aug 2011 20:31
Hey guys, I found a solution to some fps drops that my old sound emitter script made a long time ago (http://forum.thegamecreators.com/?m=forum_view&t=179100&b=23)

But I fixed it. The systm actually uses two scripts, you place your dynamic entity and place the default repeatsound.fpi script where the appear script would be, and then you place this script....

script >>>


...in the main script field. This script tells the appear script when to fade out. You can adjust it by changing the soundscale value (you can have values that ere not integers too (like 1.6). It works with any dynamic entity.

To test the fps drop I set up the scripts with some crates in the scifi entity library and placed LOTS of them in the level, and the resource meter stayed at a constant 60 or so fps. The old one would lag down to sometimes 30 or less!

I would appreciate if some people would test this so I could find out how it would work on their end.

Here is the new main script again:



Enjoy.

EDIT: added state 1 to end of script
EDIT: removed state 1 because it made the soundscale not work for some reason

I actually just realized that there is a brief fps drop when the player spawns but it only lasts a couple seconds and then it goes to 60 fps, I bet on faster computers this wouldnt happen. Not a big deal.

[/href]

Login to post a reply

Server time is: 2024-11-24 06:04:17
Your offset time is: 2024-11-24 06:04:17