Custom Resolution Compatibility Plug-Ins
Authors: ForeverZer0
Version: 1.0
Type: Misc Add-on
Key Term: Misc Add-on
IntroductionThis is a listing of compatibility fixes for my Custom Resolution (http://forum.chaos-project.com/index.php?topic=7814.0) script. I broke this off from the main thread to make it a little easier to find what your looking for, and to avoid character limits and be able to keep them in spoilers. I plan on keeping this as updated as possible, so hopefully we might see a few games that use a screen size other than 640x480.
Requests/SubmissionsIf you want a fix to a script that is not included, feel free to submit a request. I will likely make fixes to any requests, so long as the script is not some obscure one that has never been heard of. Please use this template when making requests:
[b]Script:[/b] <PLACE SCRIPT NAME HERE>
[b]Link:[/b] <PROVIDE A LINK TO THE SCRIPT>
[b]Issue:[/b] <SHORT DESCRIPTION OF WHAT COMPATIBILITY ISSUE NEEDS FIXED>
If you have created a compatibility fix for a specific script, either PM me or post it as a reply and I will inlude it in the main post, with full credit to you.
Compatibility FixesWeather System
Compatibility fix for default weather system.
- Place this script anywhere you like above main. (Plug & Play)
#===============================================================================
# ** RPG::Weather
#-------------------------------------------------------------------------------
# Compatibility fix for default weather system.
#===============================================================================
class RPG::Weather
def update
return if @type == 0
for i in 1..@max
sprite = @sprites[i]
if sprite == nil
break
end
if @type == 1
sprite.x -= 2
sprite.y += 16
sprite.opacity -= 8
elsif @type == 2
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
elsif @type == 3
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 8
end
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 64 || x < -50 || x > SCREEN[0] + 150 ||
y < -300 || y > SCREEN[1] + 32
sprite.x = rand(SCREEN[0] + 160) - 50 + @ox
sprite.y = rand(SCREEN[1] + 320) - 200 + @oy
sprite.opacity = 255
end
end
end
end
Compatibility fix for Advanced Weather (Ccoa's), Advanced Weather (http://forum.chaos-project.com/index.php?topic=5980.0) (Zer0's)(Versions 1.2 and under), and MAWS (http://forum.chaos-project.com/index.php/topic,5710.0.html).
- Find the following lines in the "update" method:
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 64 or x < -50 or x > 750 or y < -300 or y > 500
sprite.x = rand(800) - 50 + @ox
sprite.y = rand(800) - 200 + @oy
sprite.opacity = 255
end
Replace them with this:
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 64 || x < -50 || x > SCREEN[0] + 150 ||
y < -300 || y > SCREEN[1] + 32
sprite.x = rand(SCREEN[0] + 160) - 50 + @ox
sprite.y = rand(SCREEN[1] + 320) - 200 + @oy
sprite.opacity = 255
end
Compatibility fix for Advanced Weather 2.0 and higher (generated with the WeatherCreator (http://forum.chaos-project.com/index.php?topic=7731.0)).
- Find the following lines in the "update" method.
@sprites.each {|sprite|
sprite.update
x, y = sprite.x - @ox, sprite.y - @oy
if sprite.opacity < 64 || x < -50 || x > 750 || y < -300 || y > 500
# Determine coordinates at which sprite will reappear.
if OFFSCREEN_TYPES.include?(@type)
if rand(2) == 0
sprite.x = rand(60) + (rand(2) == 0 ? -60 : 640) + @ox
sprite.y = rand(800) - 200 + @oy
else
sprite.x = rand(800) - 50 + @ox
sprite.y = rand(60) + (rand(2) == 0 ? -60 : 480) + @oy
end
else
sprite.x = rand(800) - 50 + @ox
sprite.y = rand(800) - 200 + @oy
end
sprite.opacity = 255
end
}
Replace them with this:
@sprites.each {|sprite|
sprite.update
x, y = sprite.x - @ox, sprite.y - @oy
if sprite.opacity < 64 || x < -50 || x > 750 || y < -300 || y > 500
# Determine coordinates at which sprite will reappear.
if OFFSCREEN_TYPES.include?(@type)
if rand(2) == 0
sprite.x = rand(60) + (rand(2) == 0 ? -60 : SCREEN[0]) + @ox
sprite.y = rand(800) - 200 + @oy
else
sprite.x = rand(800) - 50 + @ox
sprite.y = rand(60) + (rand(2) == 0 ? -60 : SCREEN[1]) + @oy
end
else
sprite.x = rand(SCREEN[0] + 160) - 50 + @ox
sprite.y = rand(SCREEN[1] + 320) - 200 + @oy
end
sprite.opacity = 255
end
}
Message System
Default Message System
- Place code anywhere below Window_Message
#===============================================================================
# ** Window_Message
#-------------------------------------------------------------------------------
# Compatibility fix for default message system.
#===============================================================================
class Window_Message < Window_Selectable
alias zer0_reolution_message_fix_init initialize
def initialize
zer0_reolution_message_fix_init
self.x = (SCREEN[0] - self.width) / 2
self.y = SCREEN[1] - (self.height + 16)
end
alias zer0_reolution_message_fix_reset reset_window
def reset_window
zer0_reolution_message_fix_reset
if $game_temp.in_battle
self.y = 16
else
self.y = case $game_system.message_position
when 0 then 0
when 1 then (SCREEN[1] - self.height) / 2
when 2 then SCREEN[1] - (self.height + 16)
end
end
end
end
Compatability fix for Multiple Message Windows (Non-SDK) (http://forum.chaos-project.com/index.php?topic=5907.0)
- Place code anywhere below default message system and MMS script.
#===============================================================================
# ** Window_Message
#-------------------------------------------------------------------------------
# Compatibility fix for Multiple Message Windows (Non-SDK).
#===============================================================================
class Window_Message < Window_Selectable
alias zer0_reolution_message_fix_init initialize
def initialize
zer0_reolution_message_fix_init
self.x = (SCREEN[0] - self.width) / 2
self.y = SCREEN[1] - (self.height + 16)
end
alias zer0_reolution_message_fix_reset reset_window
def reset_window
zer0_reolution_message_fix_reset
if $game_temp.in_battle
self.y = 16
else
self.y = case $game_system.message_position
when 0 then 0
when 1 then (SCREEN[1] - self.height) / 2
when 2 then SCREEN[1] - (self.height + 16)
end
end
end
def reposition
if $game_temp.in_battle
if 'abcd'.include?(@float_id) # must be between a and d
@float_id = @float_id[0] - 97 # a = 0, b = 1, c = 2, d = 3
return if $scene.spriteset.actor_sprites[@float_id] == nil
sprite = $scene.spriteset.actor_sprites[@float_id]
else
@float_id -= 1 # account for, e.g., player entering 1 for index 0
return if $scene.spriteset.enemy_sprites[@float_id] == nil
sprite = $scene.spriteset.enemy_sprites[@float_id]
end
char_height = sprite.height
char_width = sprite.width
char_x = sprite.x
char_y = sprite.y - char_height/2
else # not in battle...
char = (@float_id == 0 ? $game_player : $game_map.events[@float_id])
if char == nil
# no such character
@float_id = nil
return
end
# close message (and stop event processing) if speaker is off-screen
if char.screen_x <= 0 || char.screen_x >= SCREEN[0] ||
char.screen_y <= 0 || char.screen_y > SCREEN[1]
terminate_message
$game_system.map_interpreter.command_115
return
end
char_height = RPG::Cache.character(char.character_name,0).height / 4
char_width = RPG::Cache.character(char.character_name,0).width / 4
# record coords of character's center
char_x = char.screen_x
char_y = char.screen_y - char_height/2
end
params = [char_height, char_width, char_x, char_y]
# position window and message tail
vars = new_position(params)
x = vars[0]
y = vars[1]
# check if any window locations need to be "flipped"
if @location == 4 && x < 0
# switch to right
@location = 6
vars = new_position(params)
x = vars[0]
if (x + self.width) > SCREEN[0]
# right is no good either...
if y >= 0
# switch to top
@location = 8
vars = new_position(params)
else
# switch to bottom
@location = 2
vars = new_position(params)
end
end
elsif @location == 6 && (x + self.width) > SCREEN[0]
# switch to left
@location = 4
vars = new_position(params)
x = vars[0]
if x < 0
# left is no good either...
if y >= 0
# switch to top
@location = 8
vars = new_position(params)
else
# switch to bottom
@location = 2
vars = new_position(params)
end
end
elsif @location == 8 && y < 0
# switch to bottom
@location = 2
vars = new_position(params)
y = vars[1]
if (y + self.height) > SCREEN[1]
# bottom is no good either...
# note: this will probably never occur given only 3 lines of text
x = vars[0]
if x >= 0
# switch to left
@location = 4
vars = new_position(params)
else
# switch to right
@location = 6
vars = new_position(params)
end
end
elsif @location == 2 && (y + self.height) > SCREEN[1]
# switch to top
@location = 8
vars = new_position(params)
y = vars[1]
if y < 0
# top is no good either...
# note: this will probably never occur given only 3 lines of text
x = vars[0]
if x >= 0
# switch to left
@location = 4
vars = new_position(params)
else
# switch to right
@location = 6
vars = new_position(params)
end
end
end
x = vars[0]
y = vars[1]
tail_x = vars[2]
tail_y = vars[3]
# adjust windows if near edge of screen
if x < 0
x = 0
elsif (x + self.width) > SCREEN[0]
x = SCREEN[0] - self.width
end
if y < 0
y = 0
elsif (y + self.height) > SCREEN[1]
y = SCREEN[0] - self.height
elsif $game_temp.in_battle && @location == 2 && (y > ((SCREEN[1]/2) - self.height))
# when in battle, prevent enemy messages from overlapping battle status
# (note that it could still happen from actor messages, though)
y = (SCREEN[1]/2) - self.height
tail_y = y
end
# finalize positions
self.x = x
self.y = y
@tail.x = tail_x
@tail.y = tail_y
end
end
Compatibility fix for Ccoa's UMS.
- Place code anywhere below Window_Message and the UMS.
#===============================================================================
# ** Window_Message
#-------------------------------------------------------------------------------
# Compatibility fix for Ccoa's UMS.
#===============================================================================
class Window_Message < Window_Selectable
def initialize
# x-coordinate depends on justification
if $game_system.window_justification == RIGHT
x = SCREEN[0] - self.width
elsif $game_system.window_justification == LEFT
x = 0
else # center
x = (SCREEN[0] - $game_system.window_width) / 2
end
# y-coordinate depends on height
y = SCREEN[1] - $game_system.window_height - 16
super(x, y, $game_system.window_width, $game_system.window_height)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.z = 9998
@fade_in = false
@fade_out = false
@contents_showing = false
# face graphic sprite
@face = Sprite.new
@face.opacity = 0
@face.z = self.z + 1
@face_offset = 0
# choice window
@choice_window = Window_Choice.new([])
@choice_window.back_opacity = self.back_opacity
# comic sprite
@comic = Sprite.new
@comic.opacity = 0
@comic.z = self.z + 1
if $game_system.comic_style == TALK1
@comic.bitmap = RPG::Cache.windowskin("talk1")
elsif $game_system.comic_style == TALK2
@comic.bitmap = RPG::Cache.windowskin("talk2")
else # thought
@comic.bitmap = RPG::Cache.windowskin("thought")
end
# window image sprite
@window_back = Sprite.new
@window_back.opacity = 0
@window_back.z = self.z - 1
if $game_system.window_image != nil
@window_back.bitmap = $game_system.window_image
end
# name window
@name_window = Window_Name.new
@name_window.z = self.z + 1
@pause_time = 0
@wait = 0
@show = false
@face_frame = 0
end
def reset_window (change_opacity = true)
# x-coordinate depends on justification
if $game_system.message_event == -1
if $game_system.window_justification == RIGHT
self.x = SCREEN[0] - $game_system.window_width
elsif $game_system.window_justification == LEFT
self.x = 0
else # center
self.x = (SCREEN[0] - self.width) / 2
end
else
if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
# center on player
event_x = $game_player.screen_x
else
# center on the event specified
event_x = $game_map.events[$game_system.message_event].screen_x
end
self.x = event_x - self.width / 2
@comic.x = self.x + (self.width / 2) + 4
end
if $game_temp.in_battle
self.y = 16
else
if $game_system.message_event == -1
case $game_system.message_position
when 0 # up
self.y = 16
when 1 # middle
self.y = (SCREEN[0] - $game_system.window_height) / 2
when 2 # down
self.y = SCREEN[1] - $game_system.window_height - 24
end
else
if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
# above player
self.y = $game_player.screen_y - self.height - 48
else
# above event specified
self.y = $game_map.events[$game_system.message_event].screen_y - self.height - 48
end
@comic.y = self.y + self.height - 2
@comic.angle = 0
end
end
if self.y < 0 + ($game_system.name == "" ? 0 : 16)
if $game_system.comic_enabled
if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
self.y = $game_player.screen_y - 16
else
self.y = $game_map.events[$game_system.message_event].screen_y - 16
end
@comic.angle = 180
@comic.y = self.y + 2
@comic.x = self.x + (self.width / 2) - 4
else
self.y = 0 + ($game_system.name == "" ? 0 : 16)
end
elsif self.y > SCREEN[1] - self.height
self.y = SCREEN[1] - self.height
end
if self.x < 0
self.x = 0
elsif self.x > (SCREEN[1] + 40) - self.width - 48
self.x = SCREEN[0] - self.width
end
if change_opacity
if $game_system.message_frame == 0 and $game_temp.message_text != ""
self.opacity = $game_system.opacity
else
self.opacity = 0
end
self.back_opacity = $game_system.back_opacity
end
# window back stuff
if $game_system.window_image != nil
@window_back.bitmap = RPG::Cache.windowskin($game_system.window_image)
@window_back.x = self.x
@window_back.y = self.y
end
# face stuff
if $game_system.face_graphic != ""
# the player has chosen to show a face graphic
if @done and $game_system.resting_face != ""
@face.bitmap = RPG::Cache.picture($game_system.face_graphic + $game_system.resting_face)
if @face_frame * $game_system.face_frame_width >= @face.bitmap.width
@face_frame = 0
end
else
@face.bitmap = RPG::Cache.picture($game_system.face_graphic)
end
# picture y-coordinate
if $game_system.face_graphic_position == ABOVE
@face.y = self.y - @face.bitmap.height
@face_offset = 0
elsif $game_system.face_graphic_position == CENTER
delta = (@face.bitmap.height - self.height) / 2
@face.y = self.y - delta
if $game_system.animated_faces
@face_offset = $game_system.face_frame_width + 16
else
@face_offset = @face.bitmap.width + 16
end
elsif $game_system.face_graphic_position == BOTTOM
@face.y = self.y + self.height - @face.bitmap.height
if $game_system.animated_faces
@face_offset = $game_system.face_frame_width + 16
else
@face_offset = @face.bitmap.width + 16
end
else # side
delta = (@face.bitmap.height - self.height) / 2
@face.y = self.y - delta
@face_offset = 0
end
# picture x-coordinate
if $game_system.face_graphic_justification == LEFT
if $game_system.face_graphic_position == SIDE
@face.x = self.x - @face.bitmap.width
else
@face.x = self.x + 10
end
else # right side
if $game_system.animated_faces
offset = @face.bitmap.width - $game_system.face_frame_width
else
offset = 0
end
if $game_system.face_graphic_position == SIDE
@face.x = self.x + self.width + offset
else
@face.x = self.x + self.width - @face.bitmap.width - 10 + offset
@face_offset = 0
end
end
if $game_system.animated_faces
@face.src_rect = Rect.new(@face_frame * $game_system.face_frame_width, 0, $game_system.face_frame_width, @face.bitmap.height)
if @done and $game_system.resting_face != ""
pause = $game_system.resting_animation_pause
else
pause = $game_system.animation_pause
end
if Graphics.frame_count % pause == 0
@animate_face = true
end
if @animate_face
if Graphics.frame_count % 3 == 0
@face_frame += 1
if @face_frame * $game_system.face_frame_width >= @face.bitmap.width
@face_frame = 0
@animate_face = false
end
end
end
end
end
# name window
if $game_system.name != ""
@name_window.x = self.x
@name_window.y = self.y - 36
@name_window.set_name($game_system.name)
end
# If choice
if $game_temp.choice_max > 0
@choice_window.set_choices($game_temp.choices)
# determine x and y coords for choice window
if $game_system.choice_justification == LEFT
@choice_window.x = self.x
else
@choice_window.x = self.x + self.width - @choice_window.width
end
if $game_system.choice_position == ABOVE
# check to make sure there is enough room above the textbox
if self.y < @choice_window.height
# not enough room above, place below
@choice_window.y = self.y + self.height
else
# draw above
@choice_window.y = self.y - @choice_window.height
end
elsif $game_system.choice_position == BOTTOM
# check to make sure there is enough room below the textbox
if (SCREEN[1] - self.y - self.height) < @choice_window.height
# not enough room below, place above
@choice_window.y = self.y - @choice_window.height
else
# draw below
@choice_window.y = self.y + self.height
end
else # side
if $game_system.choice_justification == LEFT
# check to make sure there's room on the left side
if self.y < @choice_window.width
# not enough room on the side, check to make sure there's room below
if (SCREEN[1] - self.y - self.height) < @choice_window.height
# not enough room below, place above
@choice_window.y = self.y - @choice_window.height
else
# draw below
@choice_window.y = self.y + self.height
end
else
# place on the left side
@choice_window.y = self.y
@choice_window.x = self.x - @choice_window.width
end
else # right
# check to make sure there's room on the right side
if ((SCREEN[0] + 40) - (self.y + self.width)) < @choice_window.width
# not enough room on the side, check to make sure there's room below
if (SCREEN[1] - self.y - self.height) < @choice_window.height
# not enough room below, place above
@choice_window.y = self.y - @choice_window.height
else
# draw below
@choice_window.y = self.y + self.height
end
else
# place on the left side
@choice_window.y = self.y
@choice_window.x = self.x + self.width
end
end
end
end
# If number input
if $game_temp.num_input_variable_id > 0
if @input_number_window == nil
digits_max = $game_temp.num_input_digits_max
number = $game_variables[$game_temp.num_input_variable_id]
@input_number_window = Window_InputNumber.new(digits_max)
@input_number_window.number = number
end
# determine x and y coords for number input window
if $game_system.choice_justification == LEFT
@input_number_window.x = self.x
else
@input_number_window.x = self.x + self.width - @input_number_window.width
end
if $game_system.choice_position == ABOVE
# check to make sure there is enough room above the textbox
if self.y < @input_number_window.height
# not enough room above, place below
@input_number_window.y = self.y + self.height
else
# draw above
@input_number_window.y = self.y - @choice_window.height
end
elsif $game_system.choice_position == BOTTOM
# check to make sure there is enough room below the textbox
if (SCREEN[1] - self.y - self.height) < @input_number_window.height
# not enough room below, place above
@input_number_window.y = self.y - @input_number_window.height
else
# draw below
@input_number_window.y = self.y + self.height
end
else # side
if $game_system.choice_justification == LEFT
# check to make sure there's room on the left side
if self.y < @input_number_window.width
# not enough room on the side, check to make sure there's room below
if (SCREEN[1] - self.y - self.height) < @input_number_window.height
# not enough room below, place above
@input_number_window.y = self.y - @input_number_window.height
else
# draw below
@input_number_window.y = self.y + self.height
end
else
# place on the left side
@input_number_window.y = self.y
@input_number_window.x = self.x - @choice_window.width
end
else # right
# check to make sure there's room on the right side
if ((SCREEN{0} + 40) - (self.y + self.width)) < @input_number_window.width
# not enough room on the side, check to make sure there's room below
if (SCREEN[1] - self.y - self.height) < @input_number_window.height
# not enough room below, place above
@input_number_window.y = self.y - @input_number_window.height
else
# draw below
@input_number_window.y = self.y + self.height
end
else
# place on the left side
@input_number_window.y = self.y
@input_number_window.x = self.x + self.width
end
end
end
end
end
end
#===============================================================================
# ** Window_Slave
#===============================================================================
class Window_Slave
alias zer0_resolution_ums_init initialize
def initialize(text)
zer0_resolution_ums_init(text)
# x-coordinate depends on justification
if @justification == RIGHT
self.x = SCREEN[0] - self.width
elsif @justification == LEFT
self.x = 0
else # center
self.x = (SCREEN[0] - self.width) / 2
end
# y-coordinate depends on height
self.y = SCREEN[1] - $game_system.window_height - 16
end
def reset_window (change_opacity = true)
# x-coordinate depends on justification
if @message_event == -1
if @justification == RIGHT
self.x = SCREEN[0] - self.width
elsif @justification == LEFT
self.x = 0
else # center
self.x = (SCREEN[0] - self.width) / 2
end
else
if @message_event == 0 or $game_map.events[@message_event] == nil
# center on player
event_x = $game_player.screen_x
else
# center on the event specified
event_x = $game_map.events[@message_event].screen_x
end
self.x = event_x - self.width / 2
@comic.x = self.x + (self.width / 2) + 4
end
if $game_temp.in_battle
self.y = 16
else
if @message_event == -1
case @message_position
when 0 # up
self.y = 16
when 1 # middle
self.y = (SCREEN[1] - self.height) / 2
when 2 # down
self.y = SCREEN[1] - self.height - 24
end
else
if @message_event == 0 or $game_map.events[@message_event] == nil
# above player
self.y = $game_player.screen_y - self.height - 48
else
# above event specified
self.y = $game_map.events[@message_event].screen_y - self.height - 48
end
@comic.y = self.y + self.height - 2
end
end
if self.y < 0 + (@name == "" ? 0 : 16)
self.y = 0 + (@name == "" ? 0 : 16)
elsif self.y > SCREEN[1] - self.height
self.y = SCREEN[1] - self.height
end
if self.x < 0
self.x = 0
elsif self.x > (SCREEN[0] + 40) - self.width - 48
self.x = SCREEN[0] - self.width
end
if change_opacity
if $game_system.message_frame == 0
self.opacity = 255
else
self.opacity = 0
end
self.back_opacity = $game_system.back_opacity
end
# face stuff
if @face_graphic != ""
# the player has chosen to show a face graphic
if @done and $game_system.resting_face != ""
@face.bitmap = RPG::Cache.picture(@face_graphic + $game_system.resting_face)
if @face_frame * $game_system.face_frame_width >= @face.bitmap.width
@face_frame = 0
end
else
@face.bitmap = RPG::Cache.picture(@face_graphic)
end
# picture y-coordinate
if @face_graphic_position == ABOVE
@face.y = self.y - @face.bitmap.height
@face_offset = 0
elsif @face_graphic_position == CENTER
delta = (@face.bitmap.height - self.height) / 2
@face.y = self.y - delta
if $game_system.animated_faces
@face_offset = $game_system.face_frame_width + 16
else
@face_offset = @face.bitmap.width + 16
end
elsif @face_graphic_position == BOTTOM
@face.y = self.y + self.height - @face.bitmap.height
if $game_system.animated_faces
@face_offset = $game_system.face_frame_width + 16
else
@face_offset = @face.bitmap.width + 16
end
else # side
delta = (@face.bitmap.height - self.height) / 2
@face.y = self.y - delta
@face_offset = 0
end
# picture x-coordinate
if @face_graphic_justification == LEFT
if @face_graphic_position == SIDE
@face.x = self.x - @face.bitmap.width
else
@face.x = self.x + 10
end
else
if $game_system.animated_faces
offset = @face.bitmap.width - $game_system.face_frame_width
else
offset = 0
end
if @face_graphic_position == SIDE
@face.x = self.x + self.width + offset
else
@face.x = self.x + self.width - @face.bitmap.width - 10 + offset
@face_offset = 0
end
end
if $game_system.animated_faces
@face.src_rect = Rect.new(@face_frame * $game_system.face_frame_width, 0, $game_system.face_frame_width, @face.bitmap.height)
if @done and $game_system.resting_face != ""
pause = $game_system.resting_animation_pause
else
pause = $game_system.animation_pause
end
if Graphics.frame_count % pause == 0
@animate_face = true
end
if @animate_face
if Graphics.frame_count % 3 == 0
@face_frame += 1
if @face_frame * $game_system.face_frame_width >= @face.bitmap.width
@face_frame = 0
@animate_face = false
end
end
end
end
end
# name window
if @name != "" and @name != nil
@name_window.set_name(@name)
@name_window.x = self.x
@name_window.y = self.y - 36
end
# If choice
if $game_temp.choice_max > 0
@choice_window.set_choices($game_temp.choices)
# determine x and y coords for choice window
if $game_system.choice_justification == LEFT
@choice_window.x = self.x
else
@choice_window.x = self.x + self.width - @choice_window.width
end
if $game_system.choice_position == ABOVE
# check to make sure there is enough room above the textbox
if self.y < @choice_window.height
# not enough room above, place below
@choice_window.y = self.y + self.height
else
# draw above
@choice_window.y = self.y - @choice_window.height
end
elsif $game_system.choice_position == BOTTOM
# check to make sure there is enough room below the textbox
if (SCREEN[1] - self.y - self.height) < @choice_window.height
# not enough room below, place above
@choice_window.y = self.y - @choice_window.height
else
# draw below
@choice_window.y = self.y + self.height
end
else # side
if $game_system.choice_justification == LEFT
# check to make sure there's room on the left side
if self.y < @choice_window.width
# not enough room on the side, check to make sure there's room below
if (SCREEN[1] - self.y - self.height) < @choice_window.height
# not enough room below, place above
@choice_window.y = self.y - @choice_window.height
else
# draw below
@choice_window.y = self.y + self.height
end
else
# place on the left side
@choice_window.y = self.y
@choice_window.x = self.x - @choice_window.width
end
else # right
# check to make sure there's room on the right side
if ((SCREEN[0] + 40) - (self.y + self.width)) < @choice_window.width
# not enough room on the side, check to make sure there's room below
if (SCREEN[1] - self.y - self.height) < @choice_window.height
# not enough room below, place above
@choice_window.y = self.y - @choice_window.height
else
# draw below
@choice_window.y = self.y + self.height
end
else
# place on the left side
@choice_window.y = self.y
@choice_window.x = self.x + self.width
end
end
end
end
end
end
Blizz-ABS (and add-ons)
Fix for the main Blizz-ABS scripts. (Not tested with old versions)
- Place code below all Blizz-ABS parts and below Custom Resolution script.
module BlizzABS
#===============================================================================
# ** Controller
#===============================================================================
class Controller
CX = ((SCREEN[0] / 2) - 16) * 4
CY = ((SCREEN[1] / 2) - 16) * 4
def center(x, y, flag = false)
pix = flag ? $BlizzABS.pixel : 1
x, y = x * 128 / pix, y * 128 / pix
m_x = ($game_map.width - $game_map.tile_size[0]) * 128
m_y = ($game_map.height - $game_map.tile_size[1]) * 128
ox, oy = x - CX, y - CY
if ox > m_x
$game_map.display_x = m_x
elsif ox < 0
$game_map.display_x = 0
else
$game_map.display_x = ox
end
if oy > m_y
$game_map.display_y = m_y
elsif oy < 0
$game_map.display_y = 0
else
$game_map.display_y = oy
end
end
end
#===============================================================================
# ** Utility
#===============================================================================
class Utility
def get_fullscreen_area
return Rect.new($game_map.display_x / 4, $game_map.display_y / 4,
SCREEN[0], SCREEN[1])
end
def get_player_radius
if $game_player.screen_x > (SCREEN[0] / 2)
x_max = $game_player.screen_x
else
x_max = SCREEN[0] - $game_player.screen_x
end
if $game_player.screen_y > (SCREEN[1] / 2)
y_max = $game_player.screen_y
else
y_max = SCREEN[1] - $game_player.screen_y
end
return Math.hypot(x_max, y_max) / 32
end
end
end
#===============================================================================
# ** Sprite
#===============================================================================
class Sprite
def in_screen?
return (self.x.between?(0, SCREEN[0]-1) && (self.y-16).between?(0, SCREEN[1]-1))
end
end
#===============================================================================
# ** Game_Character
#===============================================================================
class Game_Character
def in_abseal_range?
factor = BlizzABS::Config::ABSEAL_FACTOR < 1 ? 1 :
BlizzABS::Config::ABSEAL_FACTOR.to_i
return false if @real_x < $game_map.display_x - factor * 128
return false if @real_y < $game_map.display_y - factor * 128
return false if @real_x >= $game_map.display_x + (SCREEN[0]*4) + factor * 128
return false if @real_y >= $game_map.display_y + (SCREEN[1]*4)+ factor * 128
return true
end
end
#===============================================================================
# ** Map_Battler < Game_Character
#===============================================================================
class Map_Battler < Game_Character
def in_screen?
return (((@real_x - $game_map.display_x - 64) / 4).between?(0, SCREEN[0]) &&
((@real_y - $game_map.display_y - 64) / 4).between?(0, SCREEN[1]))
end
end
#===============================================================================
# ** Map_Remote < Map_Battler
#===============================================================================
class Map_Remote < Map_Battler
def out_of_screen?(add = 0)
return (self.real_x - $game_map.display_x + add < 0 ||
self.real_x - $game_map.display_x + add > (SCREEN[0]*4) ||
self.real_y - $game_map.display_y + add < 0 ||
self.real_y - $game_map.display_y + add > (SCREEN[1]*4))
end
end
#===============================================================================
# ** HUD < Sprite
#===============================================================================
class HUD < Sprite
alias zer0_resolution_hud_position_init initialize
def initialize(viewport = nil)
zer0_resolution_hud_position_init(viewport)
case BlizzABS::Config::HUD_POSITION
when 0 then self.x, self.y = 4, 4
when 1 then self.x, self.y = SCREEN[0] - self.bitmap.width - 4, 4
when 2 then self.x, self.y = 4, (SCREEN[1] - 116)
end
end
end
#===============================================================================
# ** Minimap < Sprite
#===============================================================================
class Minimap < Sprite
def initialize
width, height = SCREEN[0] / 4, SCREEN[1] / 4
super(Viewport.new(SCREEN[0]-width-4, SCREEN[1]-height-4, width, height))
@autotile = $BlizzABS.cache.image('minimap_autotile')
create_passable_floor
self.x = self.y = 0
viewport.z = 5000
@events, @names = check_events
create_sevents
self.visible = true
update
end
def update(override = false)
create_passable_floor if @map_id != $game_map.map_id
ev = check_events
if @events != ev[0] || @names != ev[1]
@events, @names = ev
destroy_sevents
create_sevents
end
if $game_system.minimap < 2
self.ox, self.oy = $game_map.display_x / 16, $game_map.display_y / 16
elsif !($game_system.turn_button && Input.press?(Input::Turn)) || override
if self.bitmap.width > SCREEN[0]
border = $game_player.real_x/16 - (SCREEN[0] / 2)
border_x = self.bitmap.width - SCREEN[0]
if border < 0
self.ox = 0
elsif border > border_x
self.ox = border_x
else
self.ox = border
end
else
self.ox = self.bitmap.width/2 - (SCREEN[0] / 2)
end
if self.bitmap.height > SCREEN[1]
border = $game_player.real_y/16 - (SCREEN[1] / 2)
border_y = self.bitmap.height - SCREEN[1]
if border < 0
self.oy = 0
elsif border > border_y
self.oy = border_y
else
self.oy = border
end
else
self.oy = self.bitmap.height/2 - (SCREEN[1] / 2)
end
end
@sevents.each_index {|i|
if $game_system.minimap == 2 || @events[i].update?
@sevents[i].x = self.x + @events[i].real_x / 16
@sevents[i].y = self.y + @events[i].real_y / 16
@sevents[i].ox, @sevents[i].oy = self.ox, self.oy
if @names[i] != '' && !@events[i].dropped? &&
(@events[i].is_a?(Map_Actor) ||
!@events[i].name.clone.gsub!('\box') {''})
@sevents[i].src_rect.set((@events[i].direction - 2) * 7, 0, 14, 14)
@sevents[i].ox += 3
@sevents[i].oy += 3
end
end}
end
end
#===============================================================================
# ** Scene_Map
#===============================================================================
class Scene_Map
def update_minimap
return if @minimap == nil
if $game_system.minimap < 2
@minimap.update
return
end
unless @minimap.viewport.rect.width == SCREEN[0] &&
@minimap.map_id == $game_map.map_id
@minimap.viewport.rect.set(0, 0, SCREEN[0], SCREEN[1])
@minimap.update(true)
else
@minimap.update
end
if $game_system.turn_button && Input.press?(Input::Turn) &&
!$game_system.map_interpreter.running? && !@move_route_forcing &&
!$game_temp.message_window_showing
if @minimap.bitmap.width > SCREEN[0]
if Input.repeat?(Input::RIGHT)
if @minimap.ox + SCREEN[0] < @minimap.bitmap.width
$game_system.se_play($data_system.cursor_se)
@minimap.ox += 32
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if @minimap.ox > 0
$game_system.se_play($data_system.cursor_se)
@minimap.ox -= 32
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
if @minimap.bitmap.height > SCREEN[1]
if Input.repeat?(Input::DOWN)
if @minimap.oy + SCREEN[1] < @minimap.bitmap.height
$game_system.se_play($data_system.cursor_se)
@minimap.oy += 32
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::UP)
if @minimap.oy > 0
$game_system.se_play($data_system.cursor_se)
@minimap.oy -= 32
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
end
end
def initialize_selection
object, r, type, sprites = $game_temp.select_data
enemy, dead, all = $BlizzABS.util.get_scope_data(object.scope)
if $tons_version != nil && object.is_a?(RPG::Skill) &&
($tons_version >= 6.02 && $game_system.TARGET_EM_ALL &&
FULL_TARGET_IDS.include?(object.id))
target_all = all = true
end
sprites.each {|sprite| sprite.z += 1000000}
@index = 0
Graphics.freeze
tone = $game_screen.tone
@spriteset.viewport1.tone = Tone.new(tone.red - 32, tone.green - 32,
tone.blue - 32, tone.gray)
$game_system.se_play($data_system.decision_se)
@win = Window_Help.new
@win.z, @win.opacity = 10000, 192
@ranges = [Sprite.new(@spriteset.viewport1),
Sprite.new(@spriteset.viewport1)]
@ranges[0].z = @ranges[1].z = 950000
color = (target_all ? Color.new(255, 255, 255, 96) : enemy ?
Color.new(255, 0, 0, 96) : Color.new(0, 128, 255, 96))
if type == BlizzABS::BEAM && all
@ranges[0].bitmap = Bitmap.new(SCREEN[0], SCREEN[1])
@ranges[1].bitmap = Bitmap.new(SCREEN[0]-2, SCREEN[1]-2)
@ranges[0].bitmap.fill_rect(0, 0, SCREEN[0], SCREEN[1],
Color.new(255, 255, 0, 160))
@ranges[0].bitmap.fill_rect(1, 1, SCREEN[0]-2, SCREEN[1]-2,
Color.new(0, 0, 0, 0))
@ranges[1].x = @ranges[1].y = 1
@ranges[1].bitmap.fill_rect(0, 0, SCREEN[0]-2, SCREEN[1]-2, color)
else
@ranges[0].bitmap = Bitmap.new(r * 2 + 32, r * 2 + 32)
@ranges[1].bitmap = Bitmap.new(r * 2 + 32, r * 2 + 32)
@ranges[0].x, @ranges[0].y = $game_player.screen_x, $game_player.screen_y
@ranges[1].x, @ranges[1].y = $game_player.screen_x, $game_player.screen_y
@ranges[0].ox, @ranges[0].oy = r + 16, r + 32
@ranges[1].ox, @ranges[1].oy = r + 16, r + 32
@ranges[0].bitmap.draw_circle(0, 0, r.to_i + 16, Color.new(255, 255, 0, 160))
@ranges[0].bitmap.draw_circle(1, 1, r.to_i + 15, Color.new(0, 0, 0, 0))
@ranges[1].bitmap.draw_circle(1, 1, r.to_i + 15, color)
end
if all
sprites.each {|sprite| sprite.select = 1}
@win.set_text(BlizzABS::Cache::WORDAll, 1)
else
sprites[0].select = 1
@win.set_text(sprites[0].character.battler.name, 1)
end
@ranges[1].color.set(255, 255, 0, (16 - Graphics.frame_count % 32).abs * 8 )
Graphics.transition
end
end
If using v97, or get an error about tile_size is undefined, append this to the script above:
class Game_Map
attr_reader :tile_size
alias initiate_tile_size_for_babs initialize
def initialize
@tile_size = [SCREEN[0], SCREEN[1]].collect {|n| (n / 32.0).ceil }
initiate_tile_size_for_babs
end
end
NotesPlease report any bugs/issues/suggestions. I will be happy to fix them.
Enjoy!
You made the impossible, you're the man, bla bla blah. We all approve your genius, Now let's do something useful.
I've tested this with the Blizz ABS, RMX-OS, half of the Tons of Addons enabled, Multiple Message Windows, CCTS, Ryex's Collapsing CMS, and many, many other scripts (even some yet unnamed made by me) in my project and NOTHING DID CRASH. Well, at least after I've repaired the MMS issue: The initialize method of the Window_Message class needs an 'msgindex' argument. Also the initialization called in the Scene_Map has an argument of 0 specified. Fix:
alias zer0_resolution_message_fix_init initialize
def initialize(msgindex)
zer0_resolution_message_fix_init(msgindex)
self.x = (SCREEN[0] - self.width) / 2
self.y = SCREEN[1] - (self.height + 16)
end
All we need is a pair of brackets and some characters inside ;)
So, nothing did crash. But... There are some major issues with the Blizz-ABS:
1. HUD is too 'low' and it's not visible (same for the RMX-OS chat window, both covered with map)
2. Blizz-ABS battlers have similar issue - there is no priority of their 'upper' parts, if you're 'north' to the enemy, his head doesn't cover your legs.
Well, they are not
that major, but still this is a must-fix.
And my personal objection:
The player's character appears at the same position of the screen as in the 640x480 resolution instead of the center of the current resolution's rectangle.
I think the only problem are the relative z coordinates. F0 should fix that easily. :)
I am in the middle of making the BABS fixes. I have already addressed the following in it:
- HUD placement.
- Minimap placement
- Minimap will be drawn to scale to fit the screen. I t will always be 160 pixels wide, but the height will change to match the aspect ratio of the screen.
- Centering of player (almost, one last bug to work there)
The biggest problem thus far is with the pixel movement and the pre-cached priorities. Since the priorities are pre-cached and saved, but the pixel-rate can be altered at run-time, the coordinates will no longer be correct. I'm working on a solution though, just didn't get it finished yet, so never fear.
I actually have one last bug to work out with the original script, hence it is not yet version 1.0. There are instances where the priorities will mess up when multiple characters are lined up vertically, with a priority 1 tile sandwiching them on the same axis. The bottom character will be drawn over the lowest tile (at least his legs).
EDIT: I just attempted to fix the argument error that [Luke] pointed out above (thank you, by the way), and I get the 403 Error. Is it possible for a mod to fix it for me, please?
EDIT2:
I finished(?) the Blizz-ABS compatibility plug-in, but once again the 403. I will attempt to post it tomorrow. There is a computer at work that
sometimes lets me post and modify my own topics.
Blizz-ABS (and add-ons)
Fix for the main Blizz-ABS scripts. (Not tested with old versions)
- Place code below all Blizz-ABS parts and below Custom Resolution script.
module BlizzABS
#===============================================================================
# ** Controller
#===============================================================================
class Controller
CX = ((SCREEN[0] / 2) - 16) * 4
CY = ((SCREEN[1] / 2) - 16) * 4
def center(x, y, flag = false)
pix = flag ? $BlizzABS.pixel : 1
x, y = x * 128 / pix, y * 128 / pix
m_x = ($game_map.width - $game_map.tile_size[0]) * 128
m_y = ($game_map.height - $game_map.tile_size[1]) * 128
ox, oy = x - CX, y - CY
if ox > m_x
$game_map.display_x = m_x
elsif ox < 0
$game_map.display_x = 0
else
$game_map.display_x = ox
end
if oy > m_y
$game_map.display_y = m_y
elsif oy < 0
$game_map.display_y = 0
else
$game_map.display_y = oy
end
end
end
#===============================================================================
# ** Utility
#===============================================================================
class Utility
def get_fullscreen_area
return Rect.new($game_map.display_x / 4, $game_map.display_y / 4,
SCREEN[0], SCREEN[1])
end
def get_player_radius
if $game_player.screen_x > (SCREEN[0] / 2)
x_max = $game_player.screen_x
else
x_max = SCREEN[0] - $game_player.screen_x
end
if $game_player.screen_y > (SCREEN[1] / 2)
y_max = $game_player.screen_y
else
y_max = SCREEN[1] - $game_player.screen_y
end
return Math.hypot(x_max, y_max) / 32
end
end
end
#===============================================================================
# ** Sprite
#===============================================================================
class Sprite
def in_screen?
return (self.x.between?(0, SCREEN[0]-1) && (self.y-16).between?(0, SCREEN[1]-1))
end
end
#===============================================================================
# ** Game_Character
#===============================================================================
class Game_Character
def in_abseal_range?
factor = BlizzABS::Config::ABSEAL_FACTOR < 1 ? 1 :
BlizzABS::Config::ABSEAL_FACTOR.to_i
return false if @real_x < $game_map.display_x - factor * 128
return false if @real_y < $game_map.display_y - factor * 128
return false if @real_x >= $game_map.display_x + (SCREEN[0]*4) + factor * 128
return false if @real_y >= $game_map.display_y + (SCREEN[1]*4)+ factor * 128
return true
end
end
#===============================================================================
# ** Map_Battler < Game_Character
#===============================================================================
class Map_Battler < Game_Character
def in_screen?
return (((@real_x - $game_map.display_x - 64) / 4).between?(0, SCREEN[0]) &&
((@real_y - $game_map.display_y - 64) / 4).between?(0, SCREEN[1]))
end
end
#===============================================================================
# ** Map_Remote < Map_Battler
#===============================================================================
class Map_Remote < Map_Battler
def out_of_screen?(add = 0)
return (self.real_x - $game_map.display_x + add < 0 ||
self.real_x - $game_map.display_x + add > (SCREEN[0]*4) ||
self.real_y - $game_map.display_y + add < 0 ||
self.real_y - $game_map.display_y + add > (SCREEN[1]*4))
end
end
#===============================================================================
# ** HUD < Sprite
#===============================================================================
class HUD < Sprite
alias zer0_resolution_hud_position_init initialize
def initialize(viewport = nil)
zer0_resolution_hud_position_init(viewport)
case BlizzABS::Config::HUD_POSITION
when 0 then self.x, self.y = 4, 4
when 1 then self.x, self.y = SCREEN[0] - self.bitmap.width - 4, 4
when 2 then self.x, self.y = 4, (SCREEN[1] - 116)
end
end
end
#===============================================================================
# ** Minimap < Sprite
#===============================================================================
class Minimap < Sprite
def initialize
width, height = SCREEN[0] / 4, SCREEN[1] / 4
super(Viewport.new(SCREEN[0]-width-4, SCREEN[1]-height-4, width, height))
@autotile = $BlizzABS.cache.image('minimap_autotile')
create_passable_floor
self.x = self.y = 0
viewport.z = 5000
@events, @names = check_events
create_sevents
self.visible = true
update
end
def update(override = false)
create_passable_floor if @map_id != $game_map.map_id
ev = check_events
if @events != ev[0] || @names != ev[1]
@events, @names = ev
destroy_sevents
create_sevents
end
if $game_system.minimap < 2
self.ox, self.oy = $game_map.display_x / 16, $game_map.display_y / 16
elsif !($game_system.turn_button && Input.press?(Input::Turn)) || override
if self.bitmap.width > SCREEN[0]
border = $game_player.real_x/16 - (SCREEN[0] / 2)
border_x = self.bitmap.width - SCREEN[0]
if border < 0
self.ox = 0
elsif border > border_x
self.ox = border_x
else
self.ox = border
end
else
self.ox = self.bitmap.width/2 - (SCREEN[0] / 2)
end
if self.bitmap.height > SCREEN[1]
border = $game_player.real_y/16 - (SCREEN[1] / 2)
border_y = self.bitmap.height - SCREEN[1]
if border < 0
self.oy = 0
elsif border > border_y
self.oy = border_y
else
self.oy = border
end
else
self.oy = self.bitmap.height/2 - (SCREEN[1] / 2)
end
end
@sevents.each_index {|i|
if $game_system.minimap == 2 || @events[i].update?
@sevents[i].x = self.x + @events[i].real_x / 16
@sevents[i].y = self.y + @events[i].real_y / 16
@sevents[i].ox, @sevents[i].oy = self.ox, self.oy
if @names[i] != '' && !@events[i].dropped? &&
(@events[i].is_a?(Map_Actor) ||
!@events[i].name.clone.gsub!('\box') {''})
@sevents[i].src_rect.set((@events[i].direction - 2) * 7, 0, 14, 14)
@sevents[i].ox += 3
@sevents[i].oy += 3
end
end}
end
end
#===============================================================================
# ** Scene_Map
#===============================================================================
class Scene_Map
def update_minimap
return if @minimap == nil
if $game_system.minimap < 2
@minimap.update
return
end
unless @minimap.viewport.rect.width == SCREEN[0] &&
@minimap.map_id == $game_map.map_id
@minimap.viewport.rect.set(0, 0, SCREEN[0], SCREEN[1])
@minimap.update(true)
else
@minimap.update
end
if $game_system.turn_button && Input.press?(Input::Turn) &&
!$game_system.map_interpreter.running? && !@move_route_forcing &&
!$game_temp.message_window_showing
if @minimap.bitmap.width > SCREEN[0]
if Input.repeat?(Input::RIGHT)
if @minimap.ox + SCREEN[0] < @minimap.bitmap.width
$game_system.se_play($data_system.cursor_se)
@minimap.ox += 32
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if @minimap.ox > 0
$game_system.se_play($data_system.cursor_se)
@minimap.ox -= 32
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
if @minimap.bitmap.height > SCREEN[1]
if Input.repeat?(Input::DOWN)
if @minimap.oy + SCREEN[1] < @minimap.bitmap.height
$game_system.se_play($data_system.cursor_se)
@minimap.oy += 32
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::UP)
if @minimap.oy > 0
$game_system.se_play($data_system.cursor_se)
@minimap.oy -= 32
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
end
end
def initialize_selection
object, r, type, sprites = $game_temp.select_data
enemy, dead, all = $BlizzABS.util.get_scope_data(object.scope)
if $tons_version != nil && object.is_a?(RPG::Skill) &&
($tons_version >= 6.02 && $game_system.TARGET_EM_ALL &&
FULL_TARGET_IDS.include?(object.id))
target_all = all = true
end
sprites.each {|sprite| sprite.z += 1000000}
@index = 0
Graphics.freeze
tone = $game_screen.tone
@spriteset.viewport1.tone = Tone.new(tone.red - 32, tone.green - 32,
tone.blue - 32, tone.gray)
$game_system.se_play($data_system.decision_se)
@win = Window_Help.new
@win.z, @win.opacity = 10000, 192
@ranges = [Sprite.new(@spriteset.viewport1),
Sprite.new(@spriteset.viewport1)]
@ranges[0].z = @ranges[1].z = 950000
color = (target_all ? Color.new(255, 255, 255, 96) : enemy ?
Color.new(255, 0, 0, 96) : Color.new(0, 128, 255, 96))
if type == BlizzABS::BEAM && all
@ranges[0].bitmap = Bitmap.new(SCREEN[0], SCREEN[1])
@ranges[1].bitmap = Bitmap.new(SCREEN[0]-2, SCREEN[1]-2)
@ranges[0].bitmap.fill_rect(0, 0, SCREEN[0], SCREEN[1],
Color.new(255, 255, 0, 160))
@ranges[0].bitmap.fill_rect(1, 1, SCREEN[0]-2, SCREEN[1]-2,
Color.new(0, 0, 0, 0))
@ranges[1].x = @ranges[1].y = 1
@ranges[1].bitmap.fill_rect(0, 0, SCREEN[0]-2, SCREEN[1]-2, color)
else
@ranges[0].bitmap = Bitmap.new(r * 2 + 32, r * 2 + 32)
@ranges[1].bitmap = Bitmap.new(r * 2 + 32, r * 2 + 32)
@ranges[0].x, @ranges[0].y = $game_player.screen_x, $game_player.screen_y
@ranges[1].x, @ranges[1].y = $game_player.screen_x, $game_player.screen_y
@ranges[0].ox, @ranges[0].oy = r + 16, r + 32
@ranges[1].ox, @ranges[1].oy = r + 16, r + 32
@ranges[0].bitmap.draw_circle(0, 0, r.to_i + 16, Color.new(255, 255, 0, 160))
@ranges[0].bitmap.draw_circle(1, 1, r.to_i + 15, Color.new(0, 0, 0, 0))
@ranges[1].bitmap.draw_circle(1, 1, r.to_i + 15, color)
end
if all
sprites.each {|sprite| sprite.select = 1}
@win.set_text(BlizzABS::Cache::WORDAll, 1)
else
sprites[0].select = 1
@win.set_text(sprites[0].character.battler.name, 1)
end
@ranges[1].color.set(255, 255, 0, (16 - Graphics.frame_count % 32).abs * 8)
Graphics.transition
end
end
I can't modify my own post, so here it is.
I added it into the first post.
* hugs *
Sorry I don't speak an perfectly English but... houston we have a problem
Script: Gamba SBABS
Link: http://www.mundorpgmaker.com/forum/index.php?topic=54718.0
Issue: The events follow the character if it is to the left and return to normal when the player "see" where the event has started
Why are you posting a link to a non-English forum? Probably it's a form of ABSEAL. And I bet that kind of a script needs a huge plug-in. Find somebody on that forum who's well-known with that ABS and will make a CR plugin. I know it's a breakthrough and ForeverZer0 is an interforumational scripting celebrity (or will be) since he published a script that was considered by another scripting god (Blizzard) as very difficult to make ("Scripts that are not possible and why they aren't"), but, still, he cannot make plugins for all the scripts in the world...
...probably :D He did make CRS, so I doubt there's anything impossible to him :P
I'm not promising anything on this one. I WILL take a look through it, but I am not going to translate all that just to understand what each method is doing. If something pops out at me, I will make a fix for it, though.
Using Google Translate:
This is a mixed with XAS ABS and RTH ABS.
Plug-ins have no incompatibility with the script.
Yes, it is also recognized worldwide ForeverZer0
It's compatible with yours CCTS?
Yes, it should be.
CCTS does not actually change to many graphical things, it simple controls existing things. You will definitely want to get the weather plug-in, though, so that the weather displays across the entire screen.
I'm having problem with blizzABS.I'm using resolution 896x704. After the title screen the game crashes with a error with Multiple Message and his fix it crashes like this:
Error in script Blizz ABS Part2, in 2219 line 'NoMethodError'
undefined method 'refresh' for #<Game_Player:0x8b98e78>
With only Blizz and his fix it crashes like this:
Error in script Custom Resolution, in 429 in line 'ZeroDivisionError'
divided by zero
Sorry 'bout the English, I'm Brazilian ^^
Your scripts are not in the right order.
I'm having a wierd bug, and I have no idea how to fix it.
My resolution is 320x240 exactly half the size that it used to be.
It seems to be cutting off the rest of the map! I can't really describe it so here's a picture!
(http://img197.imageshack.us/img197/7403/erroruo.png)(http://img40.imageshack.us/img40/659/error2eq.png)
And yes there is quite a bit more to the map than this!
I've tried removing the charset script and messaging script, and still this happens. The other scripts are menu scripts, which still work perfectly fine(just to big now with the smaller res.) What could this be?
Oh, i found out that if i make the map bigger, it fixes the above bug!
But now i have discovered that I can't use animated panoramas anymore! In my game, the character visits megaman's world, and there are animated backgrounds in it, but when i use this script it gives me an error.
"Script:'Custom Resolution' line 551: NoMethodError occurred.
undefined method 'width' for nil:NilClass"
It only happens when i animate panoramas by using an event and doing
change picture
wait 4 frames
change picture
wait 4 frames
is there any way to fix it?
I'm getting a divide my zero error on line 429 of the main custom resolution script when using the latest version of Blizz-ABS, the custom resolution script and the compatibility plugin.
I've got the scripts in the right order, as far as I know, and it's on a new project with no other custom scripts. I haven't changed any of the settings.
My script order:
ABS1
ABS2
ABS3
Custom Resolution
ABS Compatibility
They are all below the default scripts and above Main.
Any help would be much appreciated.
Do you have the pixel_rate in Blizz-ABS set to 0?
Quote from: ForeverZer0 on July 08, 2012, 11:34:34 am
Do you have the pixel_rate in Blizz-ABS set to 0?
In part one of Blizz-ABS it says "PIXEL_MOVEMENT_RATE = 0".
EDIT: it's version 2.84 without any of the settings changed, if that helps.
Just change the line above where it says "if $BlizzABS" to "if $BlizzABS && $game_system.pixel_rate != 0"
That's brilliant! Thank you! :D
Hello good sir,
I have trouble with making the Chrono Trigger CMS compatible with your script.
I have absolutely no experience with ruby. however, I tried to figure out how to offset the x-position of the elements manually. so that the menu stays in the middle of the screen:
(http://www.abload.de/img/screen0hq3u.png)
This worked fine so far, but I have two problems I see myself unable to solve.
First problem:
(http://www.abload.de/img/screen20xo9g.png)
As you can see, the list of the skills are not positioned in the right window as they are supposed to.
I was unable to find the line where the position is set.
Second problem:
(http://www.abload.de/img/screen3l1rqr.png)
For some reason the cursor is behind everything else. Without the script it is at the front.
I cannot really see what the problem is. :(
The code I have so far:
http://velima.lima-city.de/code.txt (http://velima.lima-city.de/code.txt)
As you can see, I di not change the absolute values but I added a "241+" to every x-position so I can change it afterwards more easily.
I am looking forward to your support and I apologize for any grammar mistakes I might have made :/
Greets,
hgcln
Have you tried playing around with the script position. I too have a custom menu and this script did mess it up (as expected). Some errors were fixed on their own when i moved my menu script above it. I am referring to the cursor part, because if the code on the menu script isn't wrong and it works without this script, it might just be a placement issue, otherwise it could be just incompatibility :P
Found an error with the custom script.
If I use the RPGXP editor for my project, I get an error that says "script hanging" after I start a preview of the game.
If I use Game.exe I do not get that error and the title screen does show up but it doesn't stretch out. If I hit new game I get this error.
"Script'Custom Resolution' line 342: NoMethodError occured. undefined method '[]' for nil:NilClass"
Is there a script conflict or are you just talking about the Custom Resolution script in general (in which case, your post should have been posted in that thread)?
The error points to updating autotiles. Did you make sure to run the game in debug first to create a cache file?
I went as far as I can go by making a copy of my project and deleting all custom scripts such as Blizz ABS, Tons, Advance Weather etc. I still get the "Script is hanging" error after I preview the project.
I even went to do the same by using Game.exe and getting that error code that I previously posted. Also, because I got the error, I couldn't make my own data file that is needed for this to run so instead I had to try and get the data file from the resolution demo
Now, in the demo for the resolution script, I can do a preview just fine but of course, I do not get a title screen, it just goes straight to the game. In my project, I can get to the title screen with game.exe but after I hit new game, I get that error code that I just posted.
Google searches say that it's most likely the computer. Restart the computer and see if that does anything first.
Do you have a lot of map files in your game?
I got alot of map files but I need to go look and see them again. My project is on another computer but I think it was near 760. I could be wrong, it is definatly above 760 or something close.
That's probably the reason. When you start the game in debug mode, does it show a black screen for a few seconds before popping up "Script is hanging"? Doing this will probably help:
Find this line near the bottom of the script
priority_data[map_id], autotile_data[map_id] = table, animated
And put
just below it but within the bracket, like so
priority_data[map_id], autotile_data[map_id] = table, animated
Graphics.update
}
Thank you KK20, it worked!
Unfortunatly, there is another error. Zexion posted it and I thought I should also say that I encountered the same too and I haven't seen any solutions of his and my error yet.
"Script:'Custom Resolution' line 551: NoMethodError occurred.
undefined method 'width' for nil:NilClass"
I get this error only when I have an event that deals with changing panoramas. If there is nothing involving changing a panorama, then the error doesn't appear.
In the script, find the Plane class. Then find the method def bitmap=
It should now look like this (I added the return if tile.nil?):
def bitmap=(tile)
@bitmap = tile
return if tile.nil?
# Calculate the number of tiles it takes to span screen in both directions.
xx = 1 + (SCREEN[0].to_f / tile.width).ceil
yy = 1 + (SCREEN[1].to_f / tile.height).ceil
# Create appropriately sized bitmap, then tile across it with source image.
plane = Bitmap.new(@bitmap.width * xx, @bitmap.height * yy)
(0..xx).each {|x| (0..yy).each {|y|
plane.blt(x * @bitmap.width, y * @bitmap.height, @bitmap, @bitmap.rect)
}}
# Set the bitmap to the sprite through its super class (Sprite).
super(plane)
end
got a problem with UMS :/ Neither is the window centered, nor do the scripts work inside :c
wat do?
(http://i.imgur.com/eonGcuJ.png)
Around line 780
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# x-coordinate depends on justification
if $game_system.window_justification == RIGHT
x = 640 - self.width
elsif $game_system.window_justification == LEFT
x = 0
else # center
x = (640 - $game_system.window_width) / 2
end
# y-coordinate depends on height
y = 480 - $game_system.window_height - 16
Change the 640 and 480 to whatever screen resolution your game is using. And what do you mean by the scripts inside? As far as I can tell, you put /inc when it should be \inc
so i did this:
def initialize
# x-coordinate depends on justification
if $game_system.window_justification == RIGHT
x = 1248 - self.width
elsif $game_system.window_justification == LEFT
x = 0
else # center
x = (1248 - $game_system.window_width) / 2
end
# y-coordinate depends on height
y = 704 - $game_system.window_height - 16
i fixed it from /inc to \inc (stupidity)
but still.
(http://i.imgur.com/7SWbFyr.png)
(http://i.imgur.com/QH1Qmae.png)
i do not understand. it just seems so logical that it should work but i have no clue why it doesnt ._.
this is my textbox:
(http://i.imgur.com/HBXoAtw.png)
i would like it to be permanent size when it comes to the talking
(my first idea but i cant figure out how to reposition the text)
(http://i.imgur.com/Dyq99ni.png)
and the name should be above the textbox in the greyish area and instead of faces, pictures behind the box.
Hmm..okay how about CTRL + H and do the following changes:
640 replaced with 1248
680 replaced with 1288
480 replaced with 704
What happens after that?
nothing changed :/
I dunno. Doing that worked fine for me?
(http://i.imgur.com/nwB6Rja.png)
i feel cursed :I i'll try to fix it and find the solution to the problem!!!
EDIT: ill try to re-insert Window_Message and the Fix for it and the Fix for the UMS and the UMS itself.
EDIT II: dunno how but i got this error now:
Script 'UMS COMP' (the ums fix) line 348: NoMethodError occured.
undefined method `SCREEN' for#<Window_Message:0x98fff18>
Line 348
if ((SCREEN{0} + 40) - (self.y + self.width)) < @input_number_window.width
NVM FIXXED IT. i just deleted the UMS Fix and it works fine. i still changed the coordinates in the original code and it looks fine as hell!
Hello! I would really appreciate if someone can help me with this.
I'm not sure if this is an incompatibility issue (my guess is that ForeverZer0's Complete Climate and Time System is causing the problem), but everytime I run my game with the Custom Resoultion script if I move my character the screen is freezing. This thing happens faster if I use the button for running (Blizz-Abs feature). After 5-10 seconds of freeze I get an error : Script is hanging. Is it because of CCTS? Or is something else that makes it to crash?
Script list in order:
Blizz-Abs Addons
CCTS
GUILLAUME777's Multi-Slot
Zer0_CMS
Blizz-ABS
Z-HUD
LiTTleDRAgo Show event name
Custom Resoultion
Blizz-ABS compatibilty with custom res
Also...the map is moving...I put a video on YT to exemplify my issue:
Looks like you are using some sort of smooth scroll script. At this time, the only fix to that is to replace all floats in the script to integers. So remove anything after a decimal point in the number (such as change 16.0 into 16). The effect will be reduced, but it still passes.
Reason: The tilemap script currently works on using a bunch of sprites. To make the effect of moving, the tiles' x/y values are changed. The smooth scrolling script will subtract the x/y values with floats.
tile.x -= 3.5623874 #or some odd number like that
The real problem is the rounding that occurs.
If you were to subtract a sprite's X value by, say, 0.2, it will round up to the nearest integer (or 1). Smooth scroll scripts always, on every frame, keep subtracting these X values, even when you are standing still. It's kinda hard to explain, but trust me on that.
So think about it: every frame, you're subtracting the tiles' X/Y value by a number less than 1, but it still treats this number as if it were a 1. That explains the ghostly movement of the tiles disappearing offscreen and, as a result of having the sprites not being in the right coordinates, creates an error.
Wow....Thanks for helping.
I needed to turn my music off to understand what it happens. I couldn't focus on any word with the sound in my head. So...I understand the "rounding" of the variables...but I don't understand in which script should I change it...
EDIT: Ok! I figured out. Now it's working properly! Thank you very much! I love you! :haha:
Accidently deleted my post when I was going to edit it. Anyway, I am using 0.97
However, Blizz ABS plugin no longer works. I tested it on 0.96 and it worked well there but then I get this error on 0.97.
Script Custom Resolution for Blizz ABS line 14 Nomethoderror occurred
undefined method tile_size for #<game_map:0xedd44e0>
I can get through just fine but the reason why I'm not using 0.96 is because of some wall clipping issue when going behind walls with priority tiles.
class Game_Map
attr_reader :tile_size
alias initiate_tile_size_for_babs initialize
def initialize
@tile_size = [SCREEN[0], SCREEN[1]].collect {|n| (n / 32.0).ceil }
initiate_tile_size_for_babs
end
end
Just put those at the bottom of the Blizz ABS Compatibility, thank you so much!