01-26-2009, 12:27 PM (This post was last modified: 11-21-2010, 09:46 AM by Charlie Fleed.)
Minichars by Charlie Fleed Version 1.01 (12-1-2008)
Introduction
The script resizes and shifts the player's sprite so that it fits with most of the world-map tilesets.
I'm pretty sure there must be something similar out there but i wasn't able to find it. Hope it isn't too buggy... i did it very hastily :P.
Instructions
Put an event called "world map" in all the maps in which you want the player resized.
EDIT (v1.01) put the names of the graphics files of the characters that you want resized in the MINICHARS array.
Script
v1.01
Code:
#==============================================================================
# ** Minichars by Charlie Fleed
#
# Version: 1.01
# Author: Charlie Fleed
#==============================================================================
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
class Sprite_Character < RPG::Sprite
attr_accessor :shifted
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
class Spriteset_Map
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias minichars_initialize initialize
def initialize
# Original call
minichars_initialize
for sprite in @character_sprites
if $game_temp.in_world_map and MINICHARS.include?(sprite.character.
character_name)
sprite.zoom_x=0.7
sprite.zoom_y=0.7
sprite.oy+=10
sprite.shifted=true
else
sprite.zoom_x=1
sprite.zoom_y=1
end
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias minichars_update update
def update
# Original call
minichars_update
for sprite in @character_sprites
if $game_temp.in_world_map and MINICHARS.include?(sprite.character.
character_name)
sprite.zoom_x=0.7
sprite.zoom_y=0.7
sprite.oy+=10 unless sprite.shifted == true
sprite.shifted = true
else
sprite.zoom_x=1
sprite.zoom_y=1
end
end
end
end
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
class Game_Temp
attr_accessor :in_world_map
end
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
class Game_Map
alias minichars_setup setup
def setup(map_id)
minichars_setup(map_id)
# Support for mini-chars in world map
if is_world_map()
$game_temp.in_world_map=true
else
$game_temp.in_world_map=false
end
end
def is_world_map()
for id in 0..@events.length
if @events[id]!=nil
if @events[id].event.name=="world map"
return true
end
end
end
return false
end
end
#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
class Game_Event
attr_reader :event
end