Map Effects

; )

Archeia > Nope, there's no invert color function in it.

Whatever, I've made one as fast as I could : https://www.dropbox.com/s/o7i4u51dkschjor/InvertColors.dll

You put the dll in the System folder of your game and you add this script :

Code:
class Bitmap  InvertColors = Win32API.new('System/InvertColors','InvertColors','i','')  def invert_colors    InvertColors.call(__id__<<1) rescue nil    clear_rect(0, 0, 0, 0) # for internal use  endendclass Game_Map_Effects  attr_accessor :invert_colors  alias addon_clear clear  def clear    addon_clear    @invert_colors = false  end  alias addon_active? active?  def active?    @active and (@invert_colors or addon_active?)  endendclass Spriteset_Map_Effects  alias addon_refresh_bitmaps refresh_bitmaps  def refresh_bitmaps    addon_refresh_bitmaps    @effects_bitmaps[0].invert_colors if @data.invert_colors  endend
: )
This script is absolutely incredible!!!!!!
Amazing script!!

But what about aplying effects to other viewports too?

Let's say i use a custom viewport to draw some pictures and i want the effects to affect those too. How can i do that?

I tried changing the viewport in the script (@viewport1) for my own viewport but when i apply any effect i only see a black screen until the end of the effect :S

Not even the pictures that are showing in the viewport before the effect are shown just a black screen...
Update 1.4 :


- small optimizations


- reversed the behaviour of map_effects.back


- fixed bug of map_effects.memorize


- fixed bug of fluidity on some animations


https://www.dropbox.com/s/zpoxi8gn8ul38uq/Map%20Effects.rb


@uchihaponigon : take this last update, I've changed the way it works so you can add other viewports easily.


Line 488 : @map_effects ||= Spriteset_Map_Effects.new(@viewport1)


You can change it like that : @map_effects ||= Spriteset_Map_Effects.new(@viewport1, @viewport2)
i have a little question. Is there a way to make this script effect only the parallax layer? Like, say i had a black hole parallax displayed in the back ground, could "Radial Blur+Zoom 50% + Fade 50 + Animation 5" make it look like it was spinning? I would need it to affect only the parallax layer though.

Anyway, awesome script!!!!
Nope this script can't do that, it would need an other script in fact.
Is it possible to make items cause these effects for a certain period of time? Like poison or drugs, etc.
Yes but it's up to you to implement it. (parallel event, condition, wait, etc...)

With scripts it would look like :

Code:
class Game_Map  alias map_effects_states_update update  def update(main = false)    poisoned_effect = $game_party.members.any? {|actor| actor.state?(2)}    if @poisoned_effect != poisoned_effect      @poisoned_effect = poisoned_effect      if poisoned_effect        effects.set_wave(8, 180, 360, 60)      else        effects.set_wave(0, 0, 0, 60)      end    end    map_effects_states_update(main)  endend
But if you don't understand scripts I think it's better that you do it by yourself with events. : )
Yeah, I don't know how to script so I'm confused.

Could you check out the script I do have that works somewhat like this?

http://forums.rpgmakerweb.com/index.php?/topic/23235-drunk-script/

I'm trying to change the screen darkening effect and the map effects from a simple shake to something more on your level.

If it could only be one effect for all items, I would prefer "Wave 8px + opacity 50%" from your video.

Thanks a ton if you can help 🙂
First off I want to commend you on a phenomenal script! All this post processing WITHOUT an outside library! Awesome! Second I come with a question, something I've been thinking about for a while. Would it be possible to after you grab the picture, map it to say... A cylinder? Mathematically I guess you would just calculate the a bent surface you would then project the image onto? 

I'm asking because it would be pretty awesome to portray things like, the inside of a tower.
Thanks!
As you said, this script doesn't use an external library and so I can't do this type of distortion.
I only use built-in functions and it's already a bit slow, doing per pixel operation would be far too slow in ruby.
So I just added this script to my Script Editor, and I'm noticing my one scene seems to be buggin out on me now. I haven't actually started using the script yet, though. I haven't called on any commands. It also only seems to be this one scene, as it doesn't seem to have any adverse effects on other maps. I'm not sure if anyone else has run into any similar problems. I mostly wanted to use this script for this particular scene, so it's a bit disenheartening that it's the one that's messing up.

Update: I seemed to have resoled the problem. I made the map larger and the bugginess seems to have stopped. Apparently the default map size was too small for the script to run smoothly? Not entirely sure.
Normally it should work no matter the map size.

If you know how to reproduce the bug I'd like to have a look on it.
Normally it should work no matter the map size.

If you know how to reproduce the bug I'd like to have a look on it.
Smaller maps sort of jitter and bug out. A 17x13 room will start shaking and be all awkward if the player gets too close to a particular edge. This is a conflict with scripts that resize the screen dimensions. (Like Yanfly's Core Script.) For example, if I have a 640 x 418 screen size and 17x13 room, it doesn't really like it and will "loop" the map if you get close to the edge... and moving on the screen "jitters" around.

If you know of a way I could fix or adjust this, it would be appreciated. I know the solution so far is to just "resize the map" but it would be nice to have the flexibility for this script to just by plug and play.

(The stuff on the left is suppose to be on the right.)

kitchen1.jpg
Ok thanks,

Maybe there's something fixable about the "jittering" but anyway you'll have to resize the map if you don't want it to loop.

That's how the vx tilemap works, you're not supposed to have maps smaller than the screen and it's automaticaly looped (not something related to my script).
Yeah this script is absolutely breathtaking. Thank you. I'm probably going to be using this in tons of stuff now.
Hello Zeus, is it possible to make this do a grayscale filter over maps too?
Isn't this done with map_effects.set_tone(0, 0, 0, 255, 60) as shown in the demo? Correct me if I'm wrong  :T
Oh odd, I did check the demo and somehow missed that. It's probably because of being unable to sleep for 2 weeks straight and today's deadlines getting to me XD
You can already change the screen tone with this command :

Spoiler
0-4688c4c.png
And for performance sake, it'll be better. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/map-effects.13941/