So I found a script that uses G_G's screenshot script to blur the map, and it works beautifully of course. Like all other troubleshoots, there is a catch. For some reason, the script only temp-saves the image the very first time it is called. After that, although the picture is erased, it only creates the first picture over and over. This is a problem because obviously the player is going to move around the map, so it makes the menu look wrong every time they open it after the first.
Script: http://www.gdunlimited.net/forums/topic/6780-blur-screen-script-rmxp/
Edit: I've just noticed that the screenshot part is not the problem. I checked and there is definitely a new screenshot on every call, the problem is that the script still uses the old picture.
I fixed it by changing this section:
# Set bitmap to screenshot
bitmap = RPG::Cache.picture('temp_screenshot.png')
@sprite[0] = Sprite.new
@sprite[0].bitmap = bitmap
(1...(8 * blur_val)).each {|i|
@sprite.push(Sprite.new)
@sprite[i].bitmap = bitmap
@sprite[i].opacity = opacity
dir = i % 8
To this:
# Set bitmap to screenshot
@bitmap = Sprite.new
@bitmap = RPG::Cache.picture('temp_screenshot.png')
@sprite[0] = Sprite.new
@sprite[0].bitmap = @bitmap
(1...(8 * blur_val)).each {|i|
@sprite.push(Sprite.new)
@sprite[i].bitmap = @bitmap
@sprite[i].opacity = opacity
dir = i % 8
and adding @bitmap.dispose
in the dispose def
RPG::Cache.picture literally does that, it caches the file. When you call it again, it will use the cached version so you have to dispose it if you want to reload the file on the next call.
BTW, the line "@bitmap = Sprite.new" is unnecessary.
I thought so, it seems that guy didn't realize that he wasn't disposing the bitmap at any point lol. Also, I still don't know why I ever need to use
@var = something.new I only learned to use that because I started learning to script through menus, which involved that line a lot.
'new' spawns a new object of the said class. It is basically a way to create a unique instance of the class that is separate from other instances of the same class. Take my Advance Wars project as an example. I have a 'class Tank' that defines some of the basic stats of the Tank like movement range, ammunition, vision, weapons, etc. When I build a new Tank, it gets stored in memory. But when I want to build another Tank, I need a new instance for that one too. I can't have these two Tanks use the same instance--that would be saying these two units have the same health, coordinates, etc.
Now a module is used when you need only ONE specific instance, not MANY. That is why scripts with configurations use a module since...well, it's pointless to create two instances of essentially the same configuration.
I am a human, thus call me Human.new(KK20). You are also a human, thus call you Human.new(Zexion). Although we are both human, we are not the same; thus, we have separate instances.
Time is a module. We don't have two different times ticking by (well, at least in the basic reality we live in).
Ohhh, I get it now :P It's basically what I just finished learning this semester lmao. Object oriented programming...I need to understand how to apply things I learn in different languages and programming in general... I'm not very good at that :P