Screen Effects

Started by Daxisheart, January 31, 2009, 06:34:27 pm

Previous topic - Next topic

Daxisheart

Jo.
I'm wondering if anyone has any scripts that can specifically do this effect: invert all the colors of the screen. As in, every single color would be its opposite. Think of it like taking a picture, go to tools/image, and invert colors. I have a way to do that already, but its only for still screens and a whole lot of work. If anyone can, make it into stuff like $game.system_invert(0,0,0) or something like that.

"Oh hey look godless stuff": ShowHide
What is really, really interesting is that while Abrahamic Christians give so much importance to their own free will, by their very definition of their God they deprive Him of free will.
The concept that He is not human and thus not derive the same morals as us really does not work. If his idea of morality, good or evil, is beyond us, is beyond our comprehension, why should we care? If he judges that not saving a woman from being raped a murdered a moral decision, then we should still trust him?
god i am such an atheist asshole.

I am on such a coolkid atheist rampage this week.

Calintz

So you are looking for an invert of color that will last while the character is playing??

Daxisheart

Yeah, I'm pretty sure that's what I'm looking for.
"Oh hey look godless stuff": ShowHide
What is really, really interesting is that while Abrahamic Christians give so much importance to their own free will, by their very definition of their God they deprive Him of free will.
The concept that He is not human and thus not derive the same morals as us really does not work. If his idea of morality, good or evil, is beyond us, is beyond our comprehension, why should we care? If he judges that not saving a woman from being raped a murdered a moral decision, then we should still trust him?
god i am such an atheist asshole.

I am on such a coolkid atheist rampage this week.

Calintz

Wow...
that will be interesting.

What do you need it for if you don't mind me asking??

Daxisheart

Lots of very weird things. My games tend to get a bit melodramatic and stuff where the character gets a lot of these revelations and goes half insane and all forth, and stuff like this thing right here would be just perfect for some of these (mostly evented) scenes. I don't plan to have the character actually move around during this, but it'll be interesting if I do. I even got the good sound effect for when this comes on.

Oh yeah, forgot to add: I want to want an actual time for this transition to occur, to make it configurable over a certain amount of time. Thanks.
"Oh hey look godless stuff": ShowHide
What is really, really interesting is that while Abrahamic Christians give so much importance to their own free will, by their very definition of their God they deprive Him of free will.
The concept that He is not human and thus not derive the same morals as us really does not work. If his idea of morality, good or evil, is beyond us, is beyond our comprehension, why should we care? If he judges that not saving a woman from being raped a murdered a moral decision, then we should still trust him?
god i am such an atheist asshole.

I am on such a coolkid atheist rampage this week.

Calintz

I suppose that would be quite interesting actually...

I hope someone with a moderate knowledge of scripting comes around and helps you. I would love to see what you do with this if you get it...

Fantasist

Will there be any movement during those inverted scenes? If no, it's very simple. If yes, I have an idea which might work. Tell me which.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Daxisheart

No, absolutely no movement is needed. This is more of a cutscene thing, so there's no need for movement. And please remember to take a certain amount of time to pass as the colors slowly invert, it's for a sound effect.

But imagine if it did have movement... cool...
"Oh hey look godless stuff": ShowHide
What is really, really interesting is that while Abrahamic Christians give so much importance to their own free will, by their very definition of their God they deprive Him of free will.
The concept that He is not human and thus not derive the same morals as us really does not work. If his idea of morality, good or evil, is beyond us, is beyond our comprehension, why should we care? If he judges that not saving a woman from being raped a murdered a moral decision, then we should still trust him?
god i am such an atheist asshole.

I am on such a coolkid atheist rampage this week.

Calintz

This would still be kinda neat...

Fantasist

I have exams the next 3 days. Probably I'll get this done the next weekend.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

I use inversion of images on the fly during boss battles because of the fading animation. Rather than inverting it all at once, I have a subsystem that inverts a portion of the battler each frame. It's a very time consuming operation and to save space I have used this trick.

If you need an inverted image for a static image, your best bet is to screenshot that scene and use the Show Picture event command for a moment along with transitions.

As I said, it's a very time consuming operation so I suggest you don't do it.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Daxisheart

Yeah, I have used this thing before, on my Nox Aeterna project. I even upted it a bit more on that. It is very time consuming, and the show picture stuff and all that is extremely annoying to me.

Either way, if I want to do this thing for a static image, if there's a moving fog, then it'll be totally messed up since at one moment the fog's moving and the next it's next. That's why I put up this request.
"Oh hey look godless stuff": ShowHide
What is really, really interesting is that while Abrahamic Christians give so much importance to their own free will, by their very definition of their God they deprive Him of free will.
The concept that He is not human and thus not derive the same morals as us really does not work. If his idea of morality, good or evil, is beyond us, is beyond our comprehension, why should we care? If he judges that not saving a woman from being raped a murdered a moral decision, then we should still trust him?
god i am such an atheist asshole.

I am on such a coolkid atheist rampage this week.

Fantasist

QuoteIf you need an inverted image for a static image, your best bet is to screenshot that scene and use the Show Picture event command for a moment along with transitions.

That's how I was going to implement it, but script-wise.

Quoteif there's a moving fog, then it'll be totally messed up since at one moment the fog's moving and the next it's next. That's why I put up this request.

@Bliz: Will the Graphics.freeze trick work on this?
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

How about the same trick you use for Ultimate Font Override? Make a class variable for sprites and change the blending according to it? So every sprite will have a negative blending when the flag is on...
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

It can be done simplier. Edit Sprite#initialize and set negative blending. But negative blending isn't the same as negative. :/
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

February 02, 2009, 10:37:25 am #16 Last Edit: February 02, 2009, 10:51:09 am by Fantasist
QuoteBut negative blending isn't the same as negative. :/

Yeah, but that's the most efficient way to achieve a similar effect. Working on their bitmaps is a bad idea, isn't it.

QuoteIt can be done simplier. Edit Sprite#initialize and set negative blending.

But that would make everything look strange... Besides, I tried and it's not working. I thought I had a wrong idea about what negative blending is, but that trick isn't working with the tone either... Meh, I'll look into it after the exams

PS: I modified the Death Image in Tons to get a good effect without the sprites :D Here it is:

Spoiler: ShowHide


#==============================================================================
# ** RPG::Cache
#==============================================================================
module RPG
  module Cache
   
    def self.death_image(battler)
      name = battler.battler_name + '_dead'
      if @cache[name] == nil
        b = Bitmap.new('Graphics/Battlers/' + battler.battler_name)
        b.invert!
        @cache[name] = b
      end
      return @cache[name]
    end
   
  end
end
#==============================================================================
# ** Bitmap
#==============================================================================
class Bitmap
 
  def invert
    w, h = self.width, self.height
    inv = Bitmap.new(w, h)
    (1..w).each{|x| (1..h).each{|y|
    color = self.get_pixel(x, y)
    next if color.alpha == 0
    r, g = 255 - color.red, 255 - color.green
    b, a = 255 - color.blue, color.alpha
    inv.set_pixel(x, y, Color.new(r, g, b, a))}}
    return inv
  end
 
  def invert!
    w, h = self.width, self.height
    (1..w).each{|x| (1..h).each{|y|
    color = self.get_pixel(x, y)
    next if color.alpha == 0
    r, g = 255 - color.red, 255 - color.green
    b, a = 255 - color.blue, color.alpha
    self.set_pixel(x, y, Color.new(r, g, b, a))
    }}
    return self
  end
 
end

# TONS Death Image

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

DEATH_IMAGE = nil # the battler file name of your death image

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# Sprite_DummyBattler
#==============================================================================

class Sprite_DummyBattler < RPG::Sprite
 
  attr_accessor :battler
 
  def update
    return if @battler == nil
    super
    if self.bitmap == nil
      #==================== MOD Begin =====================
      if DEATH_IMAGE
        self.bitmap = RPG::Cache.battler(DEATH_IMAGE, 0)
      else
        self.bitmap = RPG::Cache.death_image(@battler)
        self.tone.set(0, 128, 128) # <<< Set tone to cyan
      end
      #==================== MOD End =====================
      @width, @height = bitmap.width, bitmap.height
      self.ox, self.oy = @width / 2, @height
      self.opacity = 0 if @battler.dead? || @battler.hidden
    end
    if @battler_visible
      if !@battler.hidden && !@battler.dead? &&
          (@battler.damage == nil || @battler.damage_pop)
        escape
        @battler_visible = false
      elsif $game_temp.battle_main_phase
        self.opacity += 3 if self.opacity < 255
      elsif self.opacity > 207
        self.opacity -= 3
      end
    elsif @battler.damage == nil && @battler.dead?
      appear
      @battler_visible = true
    end
    if @battler != nil
      if $game_system.CENTER_BATTLER && @battler.is_a?(Game_Actor)
        self.x = case $game_party.actors.size
        when 1 then @battler.screen_x + 240
        when 2 then @battler.screen_x + 80 + @battler.index * 160
        when 3 then @battler.screen_x + 80
        when 4 then @battler.screen_x
        end
      else
        self.x = @battler.screen_x
      end
      self.y, self.z = @battler.screen_y, @battler.screen_z
    end
  end
 
end



What do you think? Of course, the cyan doesn't give exact results, but it's close enough.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

Better take my monochrome inverter from CP (maximally optimized of course).

class Bitmap
 
  def invert
    (0...self.width).each {|x| (0...self.height).each {|y| invert_pixel(x, y)}}
  end
 
  def invert_pixel(x, y)
    c = get_pixel(x, y)
    return if c.alpha == 0
    if c.red > c.green
      if c.red > c.blue
        max = c.red
        min = (c.blue < c.green ? c.blue : c.green)
      else
        max = c.blue
        min = (c.red < c.green ? c.red : c.green)
      end
    elsif c.green > c.blue
      max = c.green
      min = (c.blue < c.red ? c.blue : c.red)
    else
      max = c.blue
      min = (c.red < c.green ? c.red : c.green)
    end
    med = (max + min) / 2
    if med > 128
      c.red, c.green, c.blue = 128-med/2, 383-med*3/2, 383-med*3/2
    else
      c.red, c.green, c.blue = 255-med*3/2, 255-med/2, 255-med/2
    end
    set_pixel(x, y, c)
  end
 
end
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Calintz

How is this coming along??

Daxisheart

Yeah, how are things coming along?
Not that I need it. I'm weeks away from starting on mapping and eventing.
"Oh hey look godless stuff": ShowHide
What is really, really interesting is that while Abrahamic Christians give so much importance to their own free will, by their very definition of their God they deprive Him of free will.
The concept that He is not human and thus not derive the same morals as us really does not work. If his idea of morality, good or evil, is beyond us, is beyond our comprehension, why should we care? If he judges that not saving a woman from being raped a murdered a moral decision, then we should still trust him?
god i am such an atheist asshole.

I am on such a coolkid atheist rampage this week.