Hello everybody.
I have two precious custom scripts, in my project: Seer UK & OriginalWij's Fixed Pictures and Woratana's Pictures Below Characters. The former allows me to use pictures as parallaxes displayed over the default tiles, while the latter, given a range of pictures by ID, will put those pictures under characters and above tiles. The problem is that, when the map is too big to fit in the screen all at one time, the pictures whose ID is in the range choosen for Woratana's Pictures Below Characters won't be displayed until the origin of the pictures (the coordinates you select on dysplay image command) will be visible in game.
So far, I tried to put Woratana's script below Seer UK and OriginalWij's one, but the game freezes on opening returning an error in Woratana's script, so here is my question: could you help me find a way to make theese two scripts work finely together? Thank you in advance
P.S.: the scripts are in the spoilers.
#===============================================================
# ● [VXAce] ◦ Pictures under Characters ◦ □
# * Show pictures under characters on map but above map tiles *
#--------------------------------------------------------------
# ◦ by Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 22/02/2009
# ◦ Version: 1.0
#
# This works but not compatible with the other scripts
# Credits: Woratana, bug fixes by SuppaYami and Kread-Ex.
#--------------------------------------------------------------
# ◦ Update:
#--------------------------------------------------------------
# □ Version 1.0 (22/02/2009)
# - Unlimited numbers of picture under characters
#
#--------------------------------------------------------------
# ◦ Compatibility:
#--------------------------------------------------------------
# □ This script will rewrite 0 method(s):
#
#
# □ This script will alias 2 method(s):
# Spriteset_Map.create_pictures
# Sprite_Picture.update
#
# □ This script should work with most scripts
#
#--------------------------------------------------------------
# ◦ Installation:
#--------------------------------------------------------------
# 1) This script should be placed JUST AFTER ▼ Materials.
#
# □ Like this:
# ▼ Materials
# *Pictures under Characters
# ...
# ...
# ▼ Main Process
# Main
#
# 2) Setup this script in Setup Part below.
#
#--------------------------------------------------------------
# ◦ How to use:
#--------------------------------------------------------------
# □ Place this script and setup in the setup part.
#
#=================================================================
class Spriteset_Map
#=================================================================
# ++ Setup Part
#-----------------------------------------------------------------
FIRST_PICBELOW_ID = 1 # First ID of picture that will show below characters
LAST_PICBELOW_ID = 1 # Last ID of picture that will show below characters
# For example, if you set FIRST to 10 and LAST to 15, picture ID 10-15
# will show below characters on map.
#=================================================================
alias wora_picbelow_sprsetmap_crepic create_pictures
#--------------------------------------------------------------------------
# * Create Picture Sprite
#--------------------------------------------------------------------------
def update_pictures
$game_map.screen.pictures.each do |pic|
case pic.number
when FIRST_PICBELOW_ID..LAST_PICBELOW_ID
#puts 'below'
@picture_sprites[pic.number] ||= Sprite_Picture.new(@viewport1, pic)
else
@picture_sprites[pic.number] ||= Sprite_Picture.new(@viewport2, pic)
end
@picture_sprites[pic.number].update
## Mithran's pic fix code ~Kread
if pic.name == ""
$game_map.screen.pictures.remove(pic.number)
@picture_sprites[pic.number].dispose
@picture_sprites[pic.number] = nil
end
end
end
end
class Sprite_Picture < Sprite
alias wora_picbelow_sprpic_upd update
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update(*args)
wora_picbelow_sprpic_upd(*args)
## Override's Mithran Picture Fix ~Kread
if @picture.number.between?(Spriteset_Map::FIRST_PICBELOW_ID,
Spriteset_Map::LAST_PICBELOW_ID)
self.viewport = MA_FixPicture.send(:"spriteset_vp#{1}")
self.z = 50
end
end
end
#==============================================================================
# Fixed Pictures
#==============================================================================
# Author : Seer UK & OriginalWij
# Version : 1.2
#
# Credit: Seer UK
# OriginalWij (Original RGSS2 Script)
#==============================================================================
#==============================================================================
# To use:
# put the tag [FIXED] in the affected picture's filename
#==============================================================================
#==============================================================================
# What this does:
# fixes tagged pictures to the map (scrolls with the map)
#==============================================================================
#==============================================================================
# Sprite_Picture
#==============================================================================
class Sprite_Picture < Sprite
#----------------------------------------------------------------------------
# Update [ MOD ]
#----------------------------------------------------------------------------
def update
update_bitmap
update_origin
if @picture.name.include?("[FIXED]")
self.x = 0 - $game_map.display_x * 32
self.y = 0 - $game_map.display_y * 32
else
update_position
end
update_zoom
update_other
end
end