NOISE FILTER MODULE
Basically, if you ever wanted to have a wonderful noise filter present in games such as Dakota, Wretcher, McCarthy Chronicles, and every ags game that's worth something, you now, can.
Plus it's all created inside AGS, so no need for adding images, no sir. This is handled entirely with this petty engine.
Anyhoo, download link. Import the module, using one line, have fun.
http://duals.agser.me/Modules/Noisefilter.zip
Example:
function Noise(bool enabled, GUI*noise_ui, int speed);
enabled: set true or false to enable or disable the effect/UI
noise_ui: assign a ui to the noise effect. Set the ui to clickable=false and transparency close to 90, for better effect.
speed: Animation delay between the noise frames.
Noise(true, gNoise, 4); // Place this whenever, and it will enable the ui.
LICENSE:
Basically, credit me somewhere if you want and send me a copy of your game (if commercial)
I get this error:
Noisefilter.asc(17): Error (line 17): 'speed' is a global var; cannot use as name for local
Edited the int speed to noise_speed, as it appears to be clashing with a global variable, you have named, re-download and re-import.
Quote from: Dualnames on Wed 15/01/2014 06:28:04
Edited the int speed to noise_speed, as it appears to be clashing with a global variable, you have named, re-download and re-import.
Sorry to barge in, but it's the reason for putting module's internal global variables into a struct, so decreasing a chance of name conflicts, because you may have only one (or few) struct objects there with distinctive names.
Agreed, but arguably I can't say I wanted to bother with fixing this more than I did. It could end up being less of a mess, but I can't say I wanted to bother really.
Nope. Here's the error:
(http://i.imgur.com/p3T4dbU.jpg)
Use the noloopcheck on the initializenoise function, I've only tested on 320x200.
Yes, the noloopcheck works. Unfortunately, the noise filter, as amazing as it looks (especially in a higher res game) seems to cut fps down from 40 to 28... Is there any way to make it lighter on the system?
I've updated the module, so now it works in all resolutions, in my side of things the fps are 40 aka standard.
Lovely effect, well done! I can see this proving useful for quite a lot of games, really.
One tiny suggestion- in the Noise function "speed" is a bit midleading, since a higher number results in slower animation. Maybe make it "delay"?
Cool module. Thanks, Dualnames! Was using a GUI before and the slow down was awful.
@Ghost: Will do when I change the version for something more important. :PP
@SunnyPenguin: Thanks, man.
Someone asked me over a pm, and while I'm at it, might as well, let anyone who is, or planning to use this. So here follows the license for this.
LICENSE:
Legalese is http://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
In much simpler english: http://creativecommons.org/licenses/by-nc-sa/4.0/
Great module! Works perfectly!
Too bad I won't be able to use it because of the license... :~(
Quote from: tzachs on Fri 24/01/2014 08:55:53
Too bad I won't be able to use it because of the license... :~(
+1 ah well.
A non-commercial license for an AGS module is a bit odd. Of course it is entirely Dualnames prerogative.
Basically, I may have thought of this a bit on the wrong side. Whatever I was thinking. So yeah, let me fix that.
Dead simple to use, and works really well. Thanks!
Found a bug: since you don't provide a method to delete the dynamic sprites you created, if you reload the game, some weird stuff can happen.
Fixed this by adding the following method, and calling it before loading a game:
function CloseNoise()
{
int i = 0;
while (i < length)
{
if (nspr[i] != null) nspr[i].Release();
if (noisespr[i] != null) noisespr[i].Delete();
i++;
}
}