MELINHEAD'S PROFILE

Search

Filter

Drekirökr - Dusk of the Dragon

Sorry to hear you've been struggling, boss. This is my first time seeing this game, and it looks amazing. I'm definitely going to download and play soon.

We all have our projects that will haunt us for decades, lol. Only continue if it's still rewarding to you.

Could have sworn I'd done this before...

author=InfectionFiles
Hey there! Welcome to RMN! (officially)


Thank you, kind sir (or madam)! :)

[RMXP] Drago Smooth Scroller Conflict

Hi all.

Been using Drago Smooth Scroller script, and it's wonderful.


#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
# Drago Smooth Scroller
# Version: 2.00
# Author : LiTTleDRAgo
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
($imported ||= {}) = 2.00
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants and map scrolling. Refer to "$game_player" for the one
# instance of this class.
#==============================================================================
ModPlayer = $BlizzABS ? BlizzABS::Controller : Game_Player
class ModPlayer
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
@@smooth_scroller_update = $BlizzABS ? :update_moving : :update
$@ || alias_method(:smooth_scroller_update, @@smooth_scroller_update)
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
define_method(:"#{@@smooth_scroller_update}") do |*args|
$game_temp.instance_variable_set(:@prevent_map_scroll,true)
smooth_scroller_update(*args)
$game_temp.instance_variable_set(:@prevent_map_scroll,false)
if $BlizzABS
scroll_map_update(player.real_x,player.real_y) if args.at(0) != nil
else
scroll_map_update(@real_x, @real_y)
end
end unless $xrxs_xas
#--------------------------------------------------------------------------
# * Scroll Map Update
#--------------------------------------------------------------------------
def scroll_map_update(real_x,real_y)
real_x, real_y = @real_x, @real_y if $xrxs_xas
if real_y - $game_map.display_y > (tile_y = ($BlizzABS ? CY : CENTER_Y)+ 64)
$game_map.scroll_down(real_y > $game_map.height*128 - tile_y ?
(($game_map.height - (tile_y/64))*128 - $game_map.display_y) / 16.0 :
((real_y - $game_map.display_y - tile_y) / 16.0))
end
if real_x - $game_map.display_x < (tile_x = ($BlizzABS ? CX : CENTER_X)+ 64)
$game_map.scroll_left(real_x < tile_x ? $game_map.display_x / 16.0 :
(($game_map.display_x + tile_x - real_x)/16.0))
end
if real_x - $game_map.display_x > tile_x
$game_map.scroll_right(real_x > $game_map.width*128 - tile_x ?
(($game_map.width - (tile_x/64))*128 - $game_map.display_x)/16.0 :
(real_x - $game_map.display_x - tile_x )/16.0)
end
if real_y - $game_map.display_y < tile_y
$game_map.scroll_up(real_y < tile_y ? $game_map.display_y / 16.0 :
(($game_map.display_y + tile_y - real_y)/16.0))
end
end
end

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles the map. It includes scrolling and passable determining
# functions. Refer to "$game_map" for the instance of this class.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :prevent_map_scroll
#--------------------------------------------------------------------------
# * Display X, Display Y (rounded value)
#--------------------------------------------------------------------------
.each do |m|
$@ || alias_method(:"ss_display_#{m}",:"display_#{m}")
define_method(:"display_#{m}") { send(:"ss_display_#{m}").round }
end
#--------------------------------------------------------------------------
# * Scroll Down, Scroll Up, Scroll Left, Scroll Right
#--------------------------------------------------------------------------
.each do |m|
$@ || alias_method(:"ss_scroll_#{m}", :"scroll_#{m}")
define_method(:"scroll_#{m}") do |*args|
return if $game_temp.instance_variable_get(:@prevent_map_scroll)
send(:"ss_scroll_#{m}",*args)
end
end unless $xrxs_xas
end


Problem is, it conflicts with RMXP's native scroll map function. It doesn't allow the map to scroll at all, unfortunately.

Map scrolling is essential to some of my events, so I'm wondering if there's a way to turn the script on and off via events.

Or perhaps there's a more functional script for RMXP similar to this one...

Could have sworn I'd done this before...

Hi everyone. Longtime lurker, but I could have sworn I've used the forums before... Can't seem to find a post history, though. Maybe I've slipped into another dimension again ;)

Anyhow, I was developing an overly-ambitious game back in 2008, and every once in a while I have the urge to delve back in for a short period until life gets in the way again. It's a vicious cycle :)

Mostly, I ask really newb questions about scripting, lol. Some day I might post my unfinished project so people can get their hopes up and then never see it come to fruition.
Pages: 1