I made a function like this for the HM7 some times ago. That shouldn't be too hard to transpose it to the NeoM7... But be aware that it means that map rotation should be excluded.
I'll see what I can do.
Ah, thank you for the response! Don't worry about the rotation issue, I won't need to rotate when the map is fixed.
I don't have a clue what time is at the moment, so if I sent you the PM after your reply then ignore it :)
Thank you again, I'm very excited about all this, I feel like I can finally get somewhere with my game's aesthetics!
Try this script (paste it below the NeoM7 scripts) :
Content Hidden
Code:
#============================================================================
# ** Game_System
#============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Aliased methods (F12 compatibility)
#--------------------------------------------------------------------------
unless @already_aliased_neoM7_center
alias neoM7_reset_neoM7_center_game_system neoM7_reset
@already_aliased_neoM7_center = true
end
#--------------------------------------------------------------------------
# * Attributes
#--------------------------------------------------------------------------
attr_accessor :neoM7_limit_scroll
#--------------------------------------------------------------------------
# * Reset zoom and pivot
#--------------------------------------------------------------------------
def neoM7_reset
neoM7_reset_neoM7_center_game_system
self.neoM7_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.neoM7 && !$game_system.neoM7_limit_scroll
center_neoM7_game_player(x, y)
return
end
$game_map.display_x = x * 128 - CENTER_X
$game_map.display_y = y * 128 - $game_system.neoM7_center_y
end
end
#============================================================================
# ** Game_Map
#============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Scroll Down
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_down(distance)
unless $game_system.neoM7 && !$game_system.neoM7_limit_scroll
scroll_down_neoM7_game_map(distance)
return
end
@display_y = @display_y + distance.to_i
end
#--------------------------------------------------------------------------
# * Scroll Left
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_left(distance)
unless $game_system.neoM7 && !$game_system.neoM7_limit_scroll
scroll_left_neoM7_game_map(distance)
return
end
@display_x = @display_x - distance.to_i
end
#--------------------------------------------------------------------------
# * Scroll Right
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_right(distance)
unless $game_system.neoM7 && !$game_system.neoM7_limit_scroll
scroll_right_neoM7_game_map(distance)
return
end
@display_x = @display_x + distance.to_i
end
#--------------------------------------------------------------------------
# * Scroll Up
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_up(distance)
unless $game_system.neoM7 && !$game_system.neoM7_limit_scroll
scroll_up_neoM7_game_map(distance)
return
end
@display_y = @display_y - distance.to_i
end
#--------------------------------------------------------------------------
# * Setup
# map_id : map ID
#--------------------------------------------------------------------------
def setup(map_id)
old_setup_neoM7(map_id)
if !$game_switches[$enable_neoM7_number]
$game_system.neoM7 = false
$game_system.neoM7_loop = false
$game_system.neoM7_animated = false
$game_system.neoM7_white_horizon = false
$game_system.neoM7_alpha = 0
$game_system.neoM7_theta = 0
$game_system.neoM7_horizon = 960
$game_system.neoM7_resolution = 1
$game_system.neoM7_filter = false
$game_system.neoM7_limit_scroll = false
return
end
map_data = $data_maps[$game_map.map_id]
for keyword in $neoM7_maps_settings.keys
if map_data.name2.include?(keyword)
command_list = $neoM7_maps_settings[keyword]
$game_system.neoM7 = command_list.include?("NM7")
$game_system.neoM7_loop = command_list.include?("L")
$game_system.neoM7_animated = command_list.include?("A")
$game_system.neoM7_white_horizon = command_list.include?("H")
$game_system.neoM7_filter = command_list.include?("F")
$game_system.neoM7_limit_scroll = command_list.include?("LS")
for command in command_list
if command.include?("R")
$game_system.neoM7_resolution = (command.slice(1, 1)).to_i
$game_system.neoM7_resolution = [[$game_system.neoM7_resolution, 1].max, 3].min
end
if command.include?("#")
$game_system.neoM7_alpha = (command.slice(1, 2)).to_i
$game_system.neoM7_alpha = [[$game_system.neoM7_alpha, 0].max, 89].min
end
if command.include?("%")
$game_system.neoM7_theta = (command.slice(1, 3)).to_i
$game_system.neoM7_theta = [[$game_system.neoM7_theta, 0].max, 359].min
end
end
return
end
end
$game_system.neoM7 = map_data.name2.include?("[NM7]")
$game_system.neoM7_loop = map_data.name2.include?("[L]")
$game_system.neoM7_animated = map_data.name2.include?("[A]")
$game_system.neoM7_white_horizon = map_data.name2.include?("[H]")
$game_system.neoM7_filter = map_data.name2.include?("[F]")
$game_system.neoM7_limit_scroll = map_data.name2.include?("[LS]")
if $game_system.neoM7
map_data.name2 =~ /\[R[ ]*([1-3]+)\]/i
$game_system.neoM7_resolution = $1.to_i
$game_system.neoM7_resolution = [[$game_system.neoM7_resolution, 1].max, 3].min
map_data.name2 =~ /\[#[ ]*([00-99]+)\]/i
$game_system.neoM7_alpha = $1.to_i
$game_system.neoM7_alpha = [[$game_system.neoM7_alpha, 0].max, 89].min
map_data.name2 =~ /\[%[ ]*([000-999]+)\]/i
$game_system.neoM7_theta = $1.to_i
$game_system.neoM7_theta = [[$game_system.neoM7_theta, 0].max, 359].min
end
end
end
Genius. You utter genius! This works great so far (I haven't tested transitioning between different maps with different settings yet), and the only minor issue is that when I set a new pivot/zoom value, the player has to walk across the map a bit before the map sticks in place. But this is hardly a problem, I can just make this happen during a slightly extended transition, which I have to do anyway so the pivot and zoom doesn't suddenly snap into place just after the transition, and to ensure all the graphical elements are in place before the player sees the map.
Thank you so much, MGC, I'll let you know how I progress with this idea, and if everything runs smoothly once I get the chance to test the other things.
Hey, i think NeoMode is complete and utter genius at its best . but I'm experiencing a problem with it however. when i use Neo mode the character sprite glitches halfway through the floor. is there anyway to fix this? also is it possible to use the SDK version of Caterpillar with Neomode (when i tried to use it, a prompt came up saying neomode has divided by zero?!?)lol
Hey, MGC.
I've run into an issue where if the map is any bigger than 20x15 tiles, the map moves with the hero, despite the zoom level, or being able to see the whole map on the screen. Is there a way that I might be able to set a tile of the map to centre on? Either as a value in the script based on MapID (you know, one of those lists with 001 => [019,014] that kind of thing) or in a script call or something?
Or maybe not exactly that, but whatever works best or is less of a hassle. If it would be easier to set it by pixels instead that would work fine.
Sorry about this, I hope I'm not causing too much bother ^^;
#============================================================================
# ** Game_Player
#============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Always center around the hero in mode 7
#--------------------------------------------------------------------------
def center(x, y)
if $game_system.neoM7_no_scroll
$game_map.display_x = $game_system.neoM7_no_scroll_x * 128 - CENTER_X
$game_map.display_y = $game_system.neoM7_no_scroll_y * 128 - $game_system.neoM7_center_y
return
end
unless $game_system.neoM7 && !$game_system.neoM7_limit_scroll
center_neoM7_game_player(x, y)
return
end
$game_map.display_x = x * 128 - CENTER_X
$game_map.display_y = y * 128 - $game_system.neoM7_center_y
end
end
#============================================================================
# ** Game_Map
#============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Scroll Down
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_down(distance)
if $game_system.neoM7_no_scroll
return
end
unless $game_system.neoM7 && !$game_system.neoM7_limit_scroll
scroll_down_neoM7_game_map(distance)
return
end
@display_y = @display_y + distance.to_i
end
#--------------------------------------------------------------------------
# * Scroll Left
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_left(distance)
if $game_system.neoM7_no_scroll
return
end
unless $game_system.neoM7 && !$game_system.neoM7_limit_scroll
scroll_left_neoM7_game_map(distance)
return
end
@display_x = @display_x - distance.to_i
end
#--------------------------------------------------------------------------
# * Scroll Right
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_right(distance)
if $game_system.neoM7_no_scroll
return
end
unless $game_system.neoM7 && !$game_system.neoM7_limit_scroll
scroll_right_neoM7_game_map(distance)
return
end
@display_x = @display_x + distance.to_i
end
#--------------------------------------------------------------------------
# * Scroll Up
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_up(distance)
if $game_system.neoM7_no_scroll
return
end
unless $game_system.neoM7 && !$game_system.neoM7_limit_scroll
scroll_up_neoM7_game_map(distance)
return
end
@display_y = @display_y - distance.to_i
end
#--------------------------------------------------------------------------
# * Setup
# map_id : map ID
#--------------------------------------------------------------------------
def setup(map_id)
old_setup_neoM7(map_id)
if !$game_switches[$enable_neoM7_number]
$game_system.neoM7 = false
$game_system.neoM7_loop = false
$game_system.neoM7_animated = false
$game_system.neoM7_white_horizon = false
$game_system.neoM7_alpha = 0
$game_system.neoM7_theta = 0
$game_system.neoM7_horizon = 960
$game_system.neoM7_resolution = 1
$game_system.neoM7_filter = false
$game_system.neoM7_limit_scroll = false
$game_system.neoM7_no_scroll = false
return
end
map_data = $data_maps[$game_map.map_id]
for keyword in $neoM7_maps_settings.keys
if map_data.name2.include?(keyword)
command_list = $neoM7_maps_settings[keyword]
$game_system.neoM7 = command_list.include?("NM7")
$game_system.neoM7_loop = command_list.include?("L")
$game_system.neoM7_animated = command_list.include?("A")
$game_system.neoM7_white_horizon = command_list.include?("H")
$game_system.neoM7_filter = command_list.include?("F")
$game_system.neoM7_limit_scroll = command_list.include?("LS")
$game_system.neoM7_limit_scroll = command_list.include?("NS")
for command in command_list
if command.include?("R")
$game_system.neoM7_resolution = (command.slice(1, 1)).to_i
$game_system.neoM7_resolution = [[$game_system.neoM7_resolution, 1].max, 3].min
end
if command.include?("#")
$game_system.neoM7_alpha = (command.slice(1, 2)).to_i
$game_system.neoM7_alpha = [[$game_system.neoM7_alpha, 0].max, 89].min
end
if command.include?("%")
$game_system.neoM7_theta = (command.slice(1, 3)).to_i
$game_system.neoM7_theta = [[$game_system.neoM7_theta, 0].max, 359].min
end
if command.include?("NS")
command =~ /NS[ ]*([000-999]+)\/([000-999]+)/i
$game_system.neoM7_no_scroll_x = $1.to_i
$game_system.neoM7_no_scroll_y = $2.to_i
end
end
return
end
end
$game_system.neoM7 = map_data.name2.include?("[NM7]")
$game_system.neoM7_loop = map_data.name2.include?("[L]")
$game_system.neoM7_animated = map_data.name2.include?("[A]")
$game_system.neoM7_white_horizon = map_data.name2.include?("[H]")
$game_system.neoM7_filter = map_data.name2.include?("[F]")
$game_system.neoM7_limit_scroll = map_data.name2.include?("[LS]")
$game_system.neoM7_no_scroll = map_data.name2.include?("[NS")
if $game_system.neoM7
map_data.name2 =~ /\[R[ ]*([1-3]+)\]/i
$game_system.neoM7_resolution = $1.to_i
$game_system.neoM7_resolution = [[$game_system.neoM7_resolution, 1].max, 3].min
map_data.name2 =~ /\[#[ ]*([00-99]+)\]/i
$game_system.neoM7_alpha = $1.to_i
$game_system.neoM7_alpha = [[$game_system.neoM7_alpha, 0].max, 89].min
map_data.name2 =~ /\[%[ ]*([000-999]+)\]/i
$game_system.neoM7_theta = $1.to_i
$game_system.neoM7_theta = [[$game_system.neoM7_theta, 0].max, 359].min
map_data.name2 =~ /\[NS[ ]*([000-999]+)\/([000-999]+)\]/i
$game_system.neoM7_no_scroll_x = $1.to_i
$game_system.neoM7_no_scroll_y = $2.to_i
end
end
end
And use in your maps names : [NSX/Y], where X and Y are the coordinates of the focused tile.
example : [NS10/8] will center the camera on the tile at coordinates (10, 8).
You deserve an award, MGC. I was squealing with joy when it worked. Everything fell into place ;u;
Thank you many times over, you've made my idea possible!
I regret that I have one more thing to ask about. The eight direction system in the script doesn't cover the actual movement in eight directions, does it? So far I think it only affects the facing of the sprite, which in turn is only affected by the rotation of the map. Is there a way of turning this into a working movement system?
I have tried using other movement systems, like the more frames and movement script DerVVulfman posted, but if I place them before Mode7 they're predictably overwritten, and in the case of the aforementioned script, if placed below Mode7, the player is no longer affected by Mode7 and walks around the whole screen, without the sprite resizing.
That system was a little bit too complex as well, I only wanted eight directional movement with a higher amount of frames and a separate standing pose.
I think this might be something I should ask about in a separate script request/support thread. I feel I've taken up enough of your time.
But thank you greatly for everything you've done so far, you genius, you! :)
class Sprite_Character < RPG::Sprite
if !@already_aliased_neoM7_transition
alias update_neoM7_transition_sprite_character update
@already_aliased_neoM7_transition = true
end
def update
if $scene.is_a?(Scene_Map)
update_neoM7_transition_sprite_character
else
update_neoM7_sprite_character
end
end
end