Ok I am trying to create a script that shows a part of the map, but by some reason the Events don't appear, I copied the Spriteset_Map class and edited it to do what I want but It doesn't show the events. What have I done Wrong?
This requires the SDK.
Any help would be Much Apreciated. :P
This requires the SDK.
Code:
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc.
# It's used within the Scene_Map class.
#==============================================================================
class Scope < Spriteset_Map
SPRITE = "SCOPE"
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x,y,width,height,caller,range = 0)
#Sets the Scope Variables
@x = x
@y = y
@width = width
@height = height
@caller = caller
@caller_direction = @caller.direction
@range = range
#Sets the Sprite
=begin
bitmap1 = RPG::Cache.picture(SPRITE)
@sprite = Sprite.new
@sprite.bitmap = bitmap1
@sprite.x = x - 16
@sprite.y = y - 16
#@sprite.z = 6000
=end
super()
end
#--------------------------------------------------------------------------
# * Def x
#--------------------------------------------------------------------------
def x=(value)
@x = value
end
#--------------------------------------------------------------------------
# * Def x
#--------------------------------------------------------------------------
def y=(value)
@y = value
end
#--------------------------------------------------------------------------
# * Def z
#--------------------------------------------------------------------------
def z=(value)
@viewport1.z += value
@viewport2.z += value
@viewport3.z += value
# @sprite.z += value
end
#--------------------------------------------------------------------------
# * Def Dispose
#--------------------------------------------------------------------------
alias dispose_cg1 dispose
def dispose
dispose_cg1
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Viewport Initialization
#--------------------------------------------------------------------------
def init_viewports
# Make viewports
@viewport1 = Viewport.new(@x, @y,@width, @height)
@viewport2 = Viewport.new(@x, @y,@width, @height)
@viewport3 = Viewport.new(@x, @y,@width, @height)
@viewport2.z = 200
@viewport3.z = 5000
end
#--------------------------------------------------------------------------
# * Update Tilemap
#--------------------------------------------------------------------------
def update_tilemap
#Checks The Directions of the Caller
if @caller.direction != @caller_direction
#Resets the Position
@tilemap.ox = 9*32
@tilemap.oy = 9*32
@caller_direction = @caller.direction
end
#Checks Player Input
if Input.triggerd?(Input::PGUP)
#Cheks The caller Direction
case @caller.direction
when 2
@tilemap.oy += 2
when 8
@tilemap.oy -= 2
when 4
@tilemap.ox -= 2
when 6
@tilemap.ox += 2
end
elsif Input.triggerd?(Input::PGDN)
#Cheks The caller Direction
case @caller.direction
when 2
@tilemap.oy -= 2
when 8
@tilemap.oy += 2
when 4
@tilemap.ox += 2
when 6
@tilemap.ox -= 2
end
end
x = (@caller.x -1) * 32
y = (@caller.y - 1) * 32
@tilemap.ox =x
@tilemap.oy =y
# Update tilemap
# Update tilemap
@tilemap.update
end
end
Any help would be Much Apreciated. :P