Help - Search - Members - Calendar
Full Version: Tinting issues?
RPG RPG Revolution Forums > Scripting > Script Development and Support > RGSS2
Adrien.
So the following script allows me to use images that sit above the player in terms of the player walking under it. such images use the word [FIXED] as they are fixed in place. This script is generally used with parallaxing maps. when you have the ground level and then you use this script to set over head things like beams, tops of trees and what not.

How ever as you can see in the image, there is a tinting issue. The screen and the image must both be tinted as you can see from the event. How ever if you look at the base objects (the ground objects - trunks of trees) and then look at the "over layer" (tops of trees you can walk "behind or under") you'll notice a obvious tinting issue.

The script is posted bellow - your help is appreciated:


You see the obvious tint issue


Set up the event. We call the picture, we set the tint of both the screen AND the image


There is one thing with this script, it was altered so that other events like raid did not end up BEHIND the top layer picture, but stayed in front.

CODE
#==============================================================================
# Sprite_Picture
#==============================================================================

class Sprite_Picture < Sprite
  #--------------------------------------------------------------------------
  # Update (Overwrite)
  #--------------------------------------------------------------------------
  def update
    super
    if @picture_name != @picture.name
      @picture_name = @picture.name
      if @picture_name != ""
        self.bitmap = Cache.picture(@picture_name)
      end
    end
    
    if @picture_name == ""
      self.visible = false
    else
      fixed = @picture_name.include?("[FIXED]") ? true : false
      self.visible = true
      if @picture.origin == 0
        self.ox = 0
        self.oy = 0
        else
        self.ox = self.bitmap.width / 2
        self.oy = self.bitmap.height / 2
      end
    
      self.x = @picture.x
      self.y = @picture.y
      # added
      self.x += (self.ox - ($game_map.display_x / 8)) if fixed
      self.y += (self.oy - ($game_map.display_y / 8)) if fixed
      self.z = 100 + @picture.number
      self.z = -1 if fixed
      self.zoom_x = @picture.zoom_x / 100.0
      self.zoom_y = @picture.zoom_y / 100.0
      self.opacity = @picture.opacity
      self.blend_type = @picture.blend_type
      self.angle = @picture.angle
      self.tone = @picture.tone
    end
  end
end




Adrien.
help?
Night5h4d3
First off, please don't bump within 3 days of your previous post.
Secondly, you have:
CODE
self.z = -1 if fixed
which will obviously put the tint picture below pretty much everything, thus causing the clipping issue. change that value higher, and that'll fix your problem.
Adrien.
Will that kip other pictures and scripts like weather effects to remain ABOVE the fixed picture?

Still NOT working. I set it to 9999 just to test, other values were 100, 10, 500 and 1000

--> the self.x = -1 if fixed must remain -1 if the weather effects are to go OVER the fixed image and other pictures are to sit ABOVE the fixed image. This issue only seems to get buggy with specific maps. why I do not know. Some maps have this issue others do not.

Issues fixed.
Night5h4d3
I have to ask, what picture are you using for the tint? apart from that, are you using any other custom scripts? namely ones that modify spriteset_map?
Adrien.
QUOTE (Night5h4d3 @ Sep 1 2011, 10:21 AM) *
I have to ask, what picture are you using for the tint? apart from that, are you using any other custom scripts? namely ones that modify spriteset_map?



the issue was I was going: tint picture, tint screen fixed image

it should have been fixed image, screen, picture

changing that fixed the issue biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.