03-17-2015, 10:57 AM
He has post limit scroll add-on in this thread long time ago
Content Hidden
Code:
#============================================================================
# ** Game_System
#============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Aliased methods (F12 compatibility)
#--------------------------------------------------------------------------
unless @already_aliased_hm7_edm
alias hm7_reset_hm7_edm_game_system hm7_reset
@already_aliased_hm7_edm = true
end
#--------------------------------------------------------------------------
# * Attributes
#--------------------------------------------------------------------------
attr_accessor :hm7_limit_scroll
#--------------------------------------------------------------------------
# * Reset zoom and pivot
#--------------------------------------------------------------------------
def hm7_reset
hm7_reset_hm7_edm_game_system
self.hm7_limit_scroll = false
end
end
#============================================================================
# ** Game_Player
#============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Always center around the hero in mode 7
#--------------------------------------------------------------------------
def center(x, y)
unless $game_system.hm7 && !$game_system.hm7_limit_scroll
center_hm7_game_player(x, y)
return
end
$game_map.display_x = (x << 7) - CENTER_X
$game_map.display_y = (y << 7) - CENTER_Y
end
end
#============================================================================
# ** Game_Map
#============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Scroll Down
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_down(distance)
unless $game_system.hm7 && !$game_system.hm7_limit_scroll
scroll_down_hm7_game_map(distance)
return
end
# V.1.1 : integer values for better compatibility
@display_y = @display_y + distance.to_i
end
#--------------------------------------------------------------------------
# * Scroll Left
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_left(distance)
unless $game_system.hm7 && !$game_system.hm7_limit_scroll
scroll_left_hm7_game_map(distance)
return
end
# V.1.1 : integer values for better compatibility
@display_x = @display_x - distance.to_i
end
#--------------------------------------------------------------------------
# * Scroll Right
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_right(distance)
unless $game_system.hm7 && !$game_system.hm7_limit_scroll
scroll_right_hm7_game_map(distance)
return
end
# V.1.1 : integer values for better compatibility
@display_x = @display_x + distance.to_i
end
#--------------------------------------------------------------------------
# * Scroll Up
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_up(distance)
unless $game_system.hm7 && !$game_system.hm7_limit_scroll
scroll_up_hm7_game_map(distance)
return
end
# V.1.1 : integer values for better compatibility
@display_y = @display_y - distance.to_i
end
#--------------------------------------------------------------------------
# * Setup
# map_id : map ID
#--------------------------------------------------------------------------
def setup(map_id)
setup_hm7_game_map(map_id)
if width > 300 || height > 300
return
end
map_data = HM7::Data_Maps[$game_map.map_id]
for keyword in HM7::Maps_Settings.keys
if map_data.full_name.include?(keyword)
$game_system.hm7 = true
$game_system.hm7_reset
command_list = HM7::Maps_Settings[keyword]
$game_system.hm7_loop_x = command_list.include?("X")
$game_system.hm7_loop_y = command_list.include?("Y")
$game_system.hm7_animated = !command_list.include?("DA")
$game_system.hm7_lighting = !command_list.include?("DL")
$game_system.hm7_filter = !command_list.include?("DF")
$game_system.hm7_two_frames_refresh = command_list.include?("HF")
$game_system.hm7_less_cut = command_list.include?("E") # V.1.2.1
$game_system.hm7_no_black_cut = command_list.include?("DB") # V.1.2.1
$game_system.hm7_limit_scroll = command_list.include?("LS")
for command in command_list
if command.include?("R")
$game_system.hm7_resolution = command[/\d+/].to_i
$game_system.hm7_resolution = [[$game_system.hm7_resolution, 1].max, 3].min
end
if command.include?("HMAP")
$game_system.hm7_heightmap = sprintf("Heightmap_%03d", command[/\d+/].to_i)
end
if command.include?("#")
$game_system.hm7_alpha = command[/\d+/].to_i
$game_system.hm7_alpha = [[$game_system.hm7_alpha, 0].max, 80].min
end
if command.include?("%")
$game_system.hm7_theta = command[/\d+/].to_i
$game_system.hm7_theta = [[$game_system.hm7_theta, 0].max, 359].min
end
if command.include?("C")
$game_system.hm7_camera_mode = command[/\d+/].to_i
$game_system.hm7_camera_mode = [[$game_system.hm7_theta, 0].max, 3].min
end
if command.include?("AF")
$game_system.hm7_anim_freq = command[/\d+/].to_i
if $game_system.hm7_anim_freq == 0
$game_system.hm7_anim_freq = 20
end
$game_system.hm7_anim_freq = [[$game_system.hm7_anim_freq, 1].max, 999].min
end
end
return
end
end
$game_system.hm7 = map_data.full_name.include?("[HM7]")
$game_system.hm7_reset
$game_system.hm7_loop_x = map_data.full_name.include?("[X]")
$game_system.hm7_loop_y = map_data.full_name.include?("[Y]")
$game_system.hm7_animated = !map_data.full_name.include?("[DA]")
$game_system.hm7_lighting = !map_data.full_name.include?("[DL]")
$game_system.hm7_filter = !map_data.full_name.include?("[DF]")
$game_system.hm7_two_frames_refresh = map_data.full_name.include?("[HF]")
$game_system.hm7_less_cut = map_data.full_name.include?("[E]") # V.1.2.1
$game_system.hm7_no_black_cut = map_data.full_name.include?("[DB]") # V.1.2.1
$game_system.hm7_ov = map_data.full_name.include?("[OV]") # V.1.3
$game_system.hm7_limit_scroll = map_data.full_name.include?("[LS]")
if $game_system.hm7
map_data.full_name =~ /\[R(\d+)\]/i
$game_system.hm7_resolution = $1.to_i
$game_system.hm7_resolution = [[$game_system.hm7_resolution, 1].max, 3].min
map_data.full_name =~ /\[HMAP(\d+)\]/i
if $1.to_i > 0
$game_system.hm7_heightmap = sprintf("Heightmap_%03d", $1.to_i)
end
map_data.full_name =~ /\[#(\d+)\]/i
$game_system.hm7_alpha = $1.to_i
$game_system.hm7_alpha = [[$game_system.hm7_alpha, 0].max, 80].min
map_data.full_name =~ /\[%(\d+)\]/i
$game_system.hm7_theta = $1.to_i
$game_system.hm7_theta = [[$game_system.hm7_theta, 0].max, 359].min
map_data.full_name =~ /\[C(\d+)\]/i
$game_system.hm7_camera_mode = $1.to_i
$game_system.hm7_camera_mode = [[$game_system.hm7_camera_mode, 0].max, 3].min
map_data.full_name =~ /\[AF(\d+)\]/i
$game_system.hm7_anim_freq = $1.to_i
if $game_system.hm7_anim_freq == 0
$game_system.hm7_anim_freq = 20
end
$game_system.hm7_anim_freq = [[$game_system.hm7_anim_freq, 1].max, 999].min
end
end
end