Help - Search - Members - Calendar
Full Version: Bug script mapp 3
RPG RPG Revolution Forums > Scripting > Script Development and Support
vanjoss
hello me again but this time is different I have a problem with Premiere this Escript'm making maps with photoshop and this is what happens things are placed above and below as it should not be here I leave the script
have that I can do it or you are the experts


help mee!! rolleyes.gif
fx mapp
#=========================================================================
=====
# 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.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
Kread-EX
But... this script is only to fix the picture on the screen, to avoid it moving with the player. To display parallax maps, you need to use, well, a parallax for the first layer. The picture is only for the overlays.
vanjoss
use a question like this script do not understand can explain it to me!
There are instructions how to do it but I can capture the event editor to see how active the z value please!

Explain to me how to use
CODE
#=========================================================================
=====
#    Fix Pictures to Map
#    Version: 1.1
#    Author: modern algebra (rmrk.net)
#    Date: August 15, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This allows you to set the position of a picture by the X and Y position
#   of the map, rather than the screen, so that the picture won't move with you
#   when the screen scrolls. It also has a couple other features, such as
#   allowing you to set the Z value to show below characters, or below the
#   tiles to add another parallax (kind of).
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Paste this script into its own slot above Main and below Materials in the
#   Script Editor (F11).
#
#    This switch is run by two switches and one variable that you specify.
#   They are:
#      FPM_SWITCH - This switch toggles the fix pictures feature. When this
#          switch is ON and a picture is shown, then that picture will be fixed
#          to the map coordinates you specify, not to the screen. This means
#          that if the screen scrolls, the picture will not scroll with it. It
#          is useful if you want to use a picture as an additional map layer,
#          or as a parallax. Note that this still sets it to pixels, so if you
#          want a picture to show up at the map coordinates 1, 2, you would set
#          it to 32, 64. To specify which switch should be used to control this
#          feature, go to line 56 and change the value to the ID of the switch
#          you want to use to control this feature.
#      FPM_Z_VARIABLE - This allows you to set the priority of the picture.
#          When showing a picture, the value of this ariable will determine the
#          z value of the picture. When the variable with this ID is set to 0,
#          the pictures are shown at their normal z value. Setting this
#          variable to 1 will place it below characters but above non-star
#          tiles. Setting this variable to 2 will draw the picture above all
#          tiles and characters except for "Above Characters" Events. Setting
#          it to 3 will put it below all tiles and characters but above the
#          parallax. Setting it to 4 will put it below everything, including
#          the parallax. Setting it to any other value directly sets the z of
#          that sprite to that value. To specify which variable controls this
#          feature, go to line 58 and set FPM_Z_VARIABLE to the ID of the
#          variable you want to use.
#==============================================================================
FPM_SWITCH = 1         # See line 22
FPM_Z_VARIABLE = 1     # See line 32
#==============================================================================
# ** Game_Picture
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    attr_reader - map_locked
#    aliased method - initialize, show
#==============================================================================

class Game_Picture
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader :map_locked
  attr_reader :fpm_viewport
  attr_reader :fpm_z
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malg_fixpicmp_initz_6yh3 initialize
  def initialize (*args)
    @map_locked = false
    @fpm_viewport = false
    malg_fixpicmp_initz_6yh3 (*args) # Run Original Method
    @fpm_z = 100 + self.number
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Show Picture
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_fxpm_showpic_2dx4 show
  def show (*args)
    ma_fxpm_showpic_2dx4 (*args) # Run Original Method
    @map_locked = $game_switches[FPM_SWITCH]
    @fpm_viewport = ($game_variables[FPM_Z_VARIABLE] != 0) && ($game_variables[FPM_Z_VARIABLE] <= 300)
    if @fpm_viewport
      @fpm_z = case $game_variables[FPM_Z_VARIABLE]
      when 1 then 0
      when 2 then 200
      when 3 then -50
      when 4 then -150
      else
        @fpm_z = $game_variables[FPM_Z_VARIABLE]
      end
    else
      @fpm_z = 100 + self.number
    end
  end
end

#==============================================================================
# ** Sprite_Picture
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new attr_accessor - fpm_vp1, fpm_vp2
#    aliased method - update
#==============================================================================

class Sprite_Picture
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :fpm_vp1
  attr_accessor :fpm_vp2
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Frame Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_fpm_updt_oxoy_5tb3 update
  def update (*args)
    pic_name = @picture_name
    ma_fpm_updt_oxoy_5tb3 (*args) # Run Original Method
    if pic_name != @picture_name
      self.viewport = @picture.fpm_viewport ? @fpm_vp1 : @fpm_vp2
      @picture_name = pic_name if self.viewport.nil?
      self.ox, self.oy = 0, 0 # Reset OX and OY for new picture
    end
    if @picture.map_locked
      self.ox, self.oy = $game_map.display_x / 8, $game_map.display_y / 8
    end
    self.z = @picture.fpm_z
  end
end

#==============================================================================
# ** Spriteset_Map
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - create_pictures
#==============================================================================

class Spriteset_Map
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Pictures
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malg_fxpix_crtpi_5oq1 create_pictures
  def create_pictures (*args)
    malg_fxpix_crtpi_5oq1 (*args) # Run Original Method
    @picture_sprites.each { |sprite|
      sprite.fpm_vp1 = @viewport1
      sprite.fpm_vp2 = @viewport2
    }
  end
end
vanjoss
Please explain with a screenshot, the event needs to be done for this script
Kread-EX
I really don't know how to explain better than the instructions. I don't even know what kind of screenshot to make! Judging by your screenshot, you should try to set FPM_Z_VARIABLE to 2. The best thing to do is probably to experiment.
I'd wish I could explain you in Portuguese so you'd understand better but I don't speak it at all.

>_<
vanjoss
QUOTE (Kread-EX @ Jun 16 2011, 11:46 AM) *
I really don't know how to explain better than the instructions. I don't even know what kind of screenshot to make! Judging by your screenshot, you should try to set FPM_Z_VARIABLE to 2. The best thing to do is probably to experiment.
I'd wish I could explain you in Portuguese so you'd understand better but I don't speak it at all.

>_<

but if I did not like using a variable or just put the variable and you really do not understand these instructions
Kread-EX
Whether you want to use a variable or not is irrelevant. The configuration part is mandatory.
CODE
FPM_SWITCH = 1         # See line 22
FPM_Z_VARIABLE = 1     # See line 32

FPM_Z_VARIABLE will determine the Z position of the picture in relation to tiles and events. You have to set it correctly, whether you like it or not. Try to set it to 2 for now.
vanjoss
QUOTE (Kread-EX @ Jun 16 2011, 09:45 PM) *
Whether you want to use a variable or not is irrelevant. The configuration part is mandatory.
CODE
FPM_SWITCH = 1         # See line 22
FPM_Z_VARIABLE = 1     # See line 32

FPM_Z_VARIABLE will determine the Z position of the picture in relation to tiles and events. You have to set it correctly, whether you like it or not. Try to set it to 2 for now.

Ok i already understood but between one battle and this i left that is?
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.