Mini Box Messaggio sopra gli eventi
Descrizione
Avete mai pensato di inserire un mini box contenente il testo che volete sulla testa dei chara (ad esempio per pensieri, dialoghi
fra eventi...)? Con questo script si può! Presenti tantissime personalizzazioni e possibilità!
Autore
Woratana (tradotto in italiano da me)
Allegati
Schreenshot:
Istruzioni per l'uso
Installare sotto Materials e sopra Main. Dentro allo script si trovano tutte le istruzioni ben dettagliate e le impostazioni.
Bugs e Conflitti Noti
N/A
Script:
#===============================================================
# ● [VX] ◦ Mini Box Messaggi sopra gli eventi ◦ □
# * Mostra testo sopra gli eventi *
#--------------------------------------------------------------
# ◦ Creato da Woratana [[email protected]]
# ◦ Dalla comunità di RPG Maker
# - Tradotto in Ita da Yoshi91
# ◦ Aggiornato il: 22/12/2008
# ◦ Versione: 2.0
#--------------------------------------------------------------
#==================================================================
# ** INFO **
#-----------------------------------------------------------------
# - Mostra testo sopra il giocatore o un evento.
# - Cambia l'opacità e la posizione della finestra (nello script).
# - Scegli se riprodurre un suono quando viene mostrato un mini-messaggio (nello script).
# - Fixato Bug nella versione 1.0 che dava errore quando parte una battaglia.
#==================================================================
# ** Istruzioni per l'uso **
#
#-----------------------------------------------------------------
# 1. Setta le impostazioni dello script nell'apposito spazio
# 2. Per scrivere ciò che apparirà nel box messaggi usa un chiama script:
# set_text(personaggio, nuovo_testo)
#
# - al posto di 'personaggio' si setterà dove apparirà:
# sostituirlo con -1 per farlo apparire sul giocatore, con 0 per farlo apparire
# sull'evento che si sta utilizzando e 1 e maggiore per farlo apparire su un
# evento che volete voi scrivendo l'ID di questo.
#
# - al posto di 'nuovo_testo' si digiterà il testo che verrà mostrato a schermo.
#
# - Il testo che si dovrà mostrare deve essere compreso fra ' oppure "
#
# Un esempio:
# set_text(10,'Ciao!')
#
# Con questo chiama script verrà mostrato Ciao sopra l'evento con ID 10.
#
#==================================================================
#PS: per sovrascrivere un mini messaggio basta usare un altro chiama script,
#così il vecchio messaggio viene sostituito da quello nell'ultimo chiama script,
#usando sempre lo stesso codice, senza dover settare qualcosa. Comodo, no?
#==================================================================
module Wora_CTB
#================================================================
# ** Inizio impostazioni
#----------------------------------------------------------------
TEXTBOX_SKIN = 'Window' # Nome della Windowskin in cui sarà mostrato il mini
# Messaggio. (bisogna inserire questa nella cartella
# System del vostro gioco, e scrivere Window per usare
# quella di base, che viene usata nel vostro gioco.
# Scrivi Window se setti TESTBOX_OPACITY a 0.
TEXTBOX_OPACITY = 0 # Opacità della windowskin usata per il mini messaggio:
# 0 minimo, 255 massimo.
# Setta 0 per non usare una Windowskin, 255 per averla
# solida e compatta.
TEXTBOX_X_OFFSET = 0 # Sposta la posizione del mini box orizzontalmente
# (usa + o -, per 0 non scrivere nè + nè -.)
# Scrivere - col trattino.
TEXTBOX_Y_OFFSET = -1 # Sposta la posizione del mini box verticalmente
# (usa + o -, per 0 non scrivere nè + nè -.)
# Scrivere - col trattino.
TEXTBOX_POPSOUND_MODE = 0 # Qui setta il metodo di riproduzione Suono (SE),
# ovvero:
# MODO 1- Non verrà riprodotto nessun SE quando verrà visualizzato il mini
# messaggio. (per settare questo scrivere 0).
# MODO 2- Verrà riprodotto il SE solo quando verrà mostrato il mini messaggio,
# infatti quando verra modificato questo non si sentirà il suono.(per settare
# questo scrivere 1).
# MODO 3- Verrà riprodotto il SE quando verrà visualizzato il mini messaggio
# e quando verrà sovrascritto da un altro.
TEXTBOX_POPSOUND = 'Decision1' # Setta qui il nome del SE
TEXTBOX_POPSOUND_VOLUME = 80 # Setta qui il volume del SE
TEXTBOX_POPSOUND_PITCH = 100 # Setta qui la velocità del SE
#----------------------------------------------------------------
# ** Fine impostazioni
#================================================================
#================================================================
#NON MODIFICARE LE RIGHE SEGUENTI SE NON SEI UNO SCRIPTER,
#SI POTREBBERO CAUSARE ERRORI!!!
#================================================================
end
$worale = {} if $worale.nil?
$worale['Chartbox'] = true
class Game_Interpreter
def set_text(evid, new_text)
target = get_character(evid)
target.text = new_text
end
end
class Sprite_Character < Sprite_Base
alias wora_chartbox_sprcha_upd update
alias wora_chartbox_sprcha_dis dispose
def update
wora_chartbox_sprcha_upd
@chartext = '' if @chartext.nil?
if @character.text != @chartext
@chartext = @character.text
$game_system.chartbox = {} if $game_system.chartbox.nil?
case @character.class
when Game_Player; char_id = -1
when Game_Event; char_id = @character.id
end
$game_system.chartbox[[$game_map.map_id, char_id]] = @chartext
if @chartext == ''
@textbox.visible = false if [email protected]?
else
if @textbox.nil?
@textbox = Window_CharTBox.new
RPG::SE.new(Wora_CTB::TEXTBOX_POPSOUND, Wora_CTB::TEXTBOX_POPSOUND_VOLUME,
Wora_CTB::TEXTBOX_POPSOUND_PITCH).play if Wora_CTB::TEXTBOX_POPSOUND_MODE > 0
else
RPG::SE.new(Wora_CTB::TEXTBOX_POPSOUND, Wora_CTB::TEXTBOX_POPSOUND_VOLUME,
Wora_CTB::TEXTBOX_POPSOUND_PITCH).play if Wora_CTB::TEXTBOX_POPSOUND_MODE == 2
end
@textbox.set_text(@chartext)
@textbox.visible = true
end
end
if @chartext != ''
@textbox.x = self.x - (@textbox.width / 2) + Wora_CTB::TEXTBOX_X_OFFSET
@textbox.y = self.y - self.oy - @textbox.height + Wora_CTB::TEXTBOX_Y_OFFSET
end
end
def dispose
@textbox.dispose if [email protected]? and [email protected]?
wora_chartbox_sprcha_dis
end
end
class Game_Character
attr_accessor :text
alias wora_chartbox_gamcha_ini initialize
def initialize(*args)
wora_chartbox_gamcha_ini(*args)
$game_system.chartbox = {} if $game_system.chartbox.nil?
case self.class
when Game_Player
my_text = $game_system.chartbox[[$game_map.map_id, -1]] if
!$game_system.chartbox[[$game_map.map_id, -1]].nil?
when Game_Event
my_text = $game_system.chartbox[[$game_map.map_id, @id]] if
!$game_system.chartbox[[$game_map.map_id, @id]].nil?
end
@text = my_text.nil? ? '' : my_text
end
end
class Game_System
attr_accessor :chartbox
end
class Game_Interpreter
alias wora_chartbox_gamint_com201 command_201 unless $@
def command_201
if $game_map.fog_reset
if @params[0] == 0; id_map = @params[1]
else; id_map = $game_variables[@params[1]]
end
$game_system.chartbox = {} if id_map != @map_id
end
wora_chartbox_gamint_com201
end
end
class Window_CharTBox < Window_Base
def initialize(x = 0, y = 0, w = 66, h = WLH+32)
super(x,y,w,h)
self.windowskin = Cache.system(Wora_CTB::TEXTBOX_SKIN)
self.opacity = Wora_CTB::TEXTBOX_OPACITY
end
def set_text(text)
if text != @text
text_w = self.contents.text_size(text).width
self.width = text_w + 32
create_contents
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, self.contents.width, WLH, text, 1)
@text = text
end
end
end
#=================================================================================
# [FINE SCRIPT] Mini Box Messaggi sopra i chara da Woratana [[email protected]]
#=================================================================================
Altri Dettagli
Ho rimosso una funzione (era inutile e non avevo capito a che servisse).
Ho fatto anche vari test su questa ma non cambiava niente.
Inoltre, per domande chiedetemi qui e vi risponderò.
Modificato da Yoshi91, 01 February 2013 - 20:08 PM.