Hello! I'm using a very cool Zelda Screen Transitions script in my game. It's a script that breaks apart a big map into smaller segments and has a smooth scrolling animation between the segments, just like the original Zelda game.
Problem is my game has a world map too, and I don't want the world map to use this script, only the inner areas like caves and such.
So what can I do to turn off and on an entire script? My knowledge of scripts is pretty limited, but I can do small mods to a simple script. I've tried searching for a solution, but maybe I don't know what to look for... Thanks in advance!
Here's the script in case anyone wants to take a peek:
Problem is my game has a world map too, and I don't want the world map to use this script, only the inner areas like caves and such.
So what can I do to turn off and on an entire script? My knowledge of scripts is pretty limited, but I can do small mods to a simple script. I've tried searching for a solution, but maybe I don't know what to look for... Thanks in advance!
Here's the script in case anyone wants to take a peek:
#==============================================================================
# ** Classic Zelda Screen Transitions
#------------------------------------------------------------------------------
# * Created by: albertfish
# * Version: 1.0
# * Last edited: September 7, 2010
#------------------------------------------------------------------------------
# Version History:
# Version 1.0: September 7, 2010
# - Initial release
#------------------------------------------------------------------------------
# Description:
# This script mimics the screen transitions found in the 2D Zelda Games.
#------------------------------------------------------------------------------
# Features:
# - Separeated a large map in to small screen size parts and adds a smooth
# transition between the parts.
#------------------------------------------------------------------------------
# Install Instructions:
# Place this script above the main script and below the default scripts.
#==============================================================================
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc.
# It's used within the Scene_Map class.
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias af_czst_ssm_init initialize
def initialize
@x = ($game_player.x - $game_player.x % 20) * 128
@y = ($game_player.y - $game_player.y % 15) * 128
@amount_x = 0
@amount_y = 0
@scrolling = false
@prev_x = $game_player.x
@prev_y = $game_player.y
$game_map.display_x = @x
$game_map.display_y = @y
af_czst_ssm_init
end
#--------------------------------------------------------------------------
# * Scroll Right
#--------------------------------------------------------------------------
def scroll_right
@x += 128
@amount_x -= 1
if @amount_x <= 0
@scrolling = false
end
end
#--------------------------------------------------------------------------
# * Scroll Left
#--------------------------------------------------------------------------
def scroll_left
@x -= 128
@amount_x += 1
if @amount_x >= 0
@scrolling = false
end
end
#--------------------------------------------------------------------------
# * Scroll Up
#--------------------------------------------------------------------------
def scroll_up
@y -= 96
@amount_y -= 1
if @amount_y <= 0
@scrolling = false
end
end
#--------------------------------------------------------------------------
# * Scroll Down
#--------------------------------------------------------------------------
def scroll_down
@y += 96
@amount_y += 1
if @amount_y >= 0
@scrolling = false
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias af_czst_ssm_update update
def update
if !@scrolling
# Determine if the screen needs to scroll left or right
if $game_player.x % 20 == 0 && ($game_player.x - 19) * 128 > $game_map.display_x
@amount_x = 20
@scrolling = true
@prev_x += 1
elsif $game_player.x % 20 == 19 && ($game_player.x) * 128 < $game_map.display_x
@amount_x = -20
@scrolling = true
@prev_x -= 1
end
# Determine if the screen needs to scroll up or down
if $game_player.y % 15 == 0 && ($game_player.y - 14) * 128 > $game_map.display_y
@amount_y = -20
@scrolling = true
@prev_y += 1
elsif $game_player.y % 15 == 14 && ($game_player.y) * 128 < $game_map.display_y
@amount_y = 20
@scrolling = true
@prev_y -= 1
end
else @scrolling
# Scroll either left or right
if @amount_x > 0
scroll_right
elsif @amount_x < 0
scroll_left
end
# Scroll either up or down
if @amount_y < 0
scroll_down
elsif @amount_y > 0
scroll_up
end
$game_player.x = @prev_x
$game_player.y = @prev_y
end
$game_map.display_x = @x
$game_map.display_y = @y
@prev_x = $game_player.x
@prev_y = $game_player.y
af_czst_ssm_update
end
end
class Game_Character
def x=(x)
@x = x
end
def y=(y)
@y = y
end
end