Rave - Pi± 22 Cze, 2012 03:12 Temat postu: Skrypt na cienie nad graczemTak, dobrze czytacie. Udało mi się jako¶ odpalić Ace'a i teraz chciałbym skrypt na to aby postać była przykrywana przez cienie. Nie chcę pełnoprawnego skryptu na ¶wiatła, jak tutaj: http://www.ultimateam.pl/viewtopic.php?t=9144, tylko chcę aby gracz był przykrywany przez zwykłe, vx-owe cienie.Squall - Sob 23 Cze, 2012 11:40 Znalazłem co¶ takiego nie wiem czy dokładnie o to ci chodziło ale jak znajdę co¶ lepszego to wrzucę Aha tu dam ci jeszcze link do stronki z skryptami do ace może co¶ tam znajdziesz? http://rpgmaker.net/scripts/rmvxace/
$imported = {} if $imported.nil?
$imported["PRX-CharacterShadow"] = true
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.04.05 - Fixed an issue with shadow sprites not disposing properly.
# 2012.04.03 - Added Default values for Player, Followers, and Events.
# Also added some logic for hiding shadows when characters aren't
# visible.
# 2012.04.02 - First Draft Complete
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script will allow you to add a Shadow graphic underneath the player,
# followers, and any event you feel should have a shadow graphic.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open spot above Main.
#
# Each Game_CharacterBase and any object whose parent is Game_CharacterBase can
# have a shadow added under it's sprite by setting the shadow value to true.
#
# eg: To show the shadow graphic for the player, a Call Script such as
# $game_player.shadow = true
# will add the shadow. Conversely,
# $game_player.shadow = false
# will turn the shadow off.
#
# This will also work for Followers (the 'Caterpillar' characters) and any
# map event.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made for RPG Maker VX Ace and designed to be as modular as
# possible to avoid script conflicts. It is however possible that conflicts may
# occur with other scripts that make changes/use of the Game_CharacterBase or
# Sprite_Character.
#
#==============================================================================
module PRX
module SHADOW
#==========================================================================
# ▼ Settings
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# To use a shadow graphic other than the Shadow.png found in the System
# cache, change the following:
#==========================================================================
SHADOW_GRAPHIC = "Shadow" # The name of the Shadow file
#==========================================================================
# Change the following to have players, followers, or events use shadows
# by default
#==========================================================================
DEFAULT_ON_PLAYER = true # Set to 'true' for default shadows
DEFAULT_ON_FOLLOWER = true # Set to 'true' for default shadows
DEFAULT_ON_EVENT = false # Set to 'true' for default shadows
end # SHADOW
end # PRX
class Sprite_Character < Sprite_Base
#--------------------------------------------------------------------------
# * alias method update
#--------------------------------------------------------------------------
alias :prx_shadow_sprite_character_update :update
def update
prx_shadow_sprite_character_update
update_shadow
end
#--------------------------------------------------------------------------
# * alias method dispose
#--------------------------------------------------------------------------
alias :prx_shadow_sprite_character_dispose :dispose
def dispose
dispose_shadow
prx_shadow_sprite_character_dispose
end
#--------------------------------------------------------------------------
# * update_shadow : validate, draw if necessary, adjust position, destroy
#--------------------------------------------------------------------------
def update_shadow
if @character.shadow and !@character.transparent
if @character.is_a?(Game_Follower) and !@character.visible?
dispose_shadow if @shadow_sprite
return
end
start_shadow unless @shadow_sprite
@shadow_sprite.x = x
@shadow_sprite.y = y - @shadow_sprite.height
@shadow_sprite.z = z - 1
else
dispose_shadow if @shadow_sprite
end
end
#--------------------------------------------------------------------------
# * dispose_shadow : destroy
#--------------------------------------------------------------------------
def dispose_shadow
if @shadow_sprite
@shadow_sprite.dispose
@shadow_sprite = nil
end
end
end # < Sprite_Character
class Game_CharacterBase
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :shadow # Character Shadow
#--------------------------------------------------------------------------
# * Initialize Public Member Variables
#--------------------------------------------------------------------------
alias :prx_shadow_game_characterbase_init_public_members :init_public_members
def init_public_members
prx_shadow_game_characterbase_init_public_members
@shadow = PRX::SHADOW::DEFAULT_ON_PLAYER if self.is_a?(Game_Player)
@shadow = PRX::SHADOW::DEFAULT_ON_FOLLOWER if self.is_a?(Game_Follower)
@shadow = PRX::SHADOW::DEFAULT_ON_EVENT if self.is_a?(Game_Event)
@shadow = false if @shadow.nil?
end
end # < Game_CharacterBase
Rave - Sob 23 Cze, 2012 13:10 Squall, nie to skrypt na cienie pod graczami/eventami. Mi chodzi o te cienie co zostały wprowadzone w VX/VX Ace aby były rysowane ponad map±, ale pod obrazkami, menu, itp.Ayene - Sob 23 Cze, 2012 23:41 Nie wiem, czy dobrze zrozumiałam, ale możesz przecież skorzystać z tego skryptu na cienie, następnie wystarczy, że w jego kodzie zamienisz:
Kod:
@shadow_sprite.z = z - 1
na
Kod:
@shadow_sprite.z = z + 1
Rave - Nie 24 Cze, 2012 04:37 To może ja wytłumaczę na obrazkach.
Po lewej, tak jak jest obecnie, po prawej, tak jak chcę żeby było (przeróbka w GIMP-ie):
Ayene - Pon 25 Cze, 2012 17:54 Skryptem tego nie zrobisz. Proponowałabym Tobie usun±ć cienie całkowicie, zrobić je w obrazku png i nałożyć na cał± mapę, tak jak to się robi chociażby z promieniami słońca.