Toyota Membro
Mensagens : 54 Créditos : 13 Idade : 27 Localização : Rio de Janeiro - RJ Frase Pessoal : " Scripter dos Makers "
| Assunto: CharBox v 1.2 ( Caixa de Momes ) Sáb Jan 30, 2010 5:58 pm | |
| Esse script é perfeito e muito útil! Ele faz com que apareça uma caixa( com alguma coisa escrita, você escolhe! ) em cima de um evento ( Personagem, Evento e etc. ) Foto: Modificações: Apenas Modifique na parte Modificações Charbox Intruções: Cole o Script acima de Main, no menu de scripts ( aperte F11 ) Script: - Código:
-
#=============================================================== # [VX] CharBox v1.2 # * Mostra uma caixa de texto acima do personagem * #-------------------------------------------------------------- # Criado por Woratana [woratana@hotmail.com] # Traduzido e Modificado por Toyota ( DJJ, MRM, RMB, RRM ) # Criado em: 21/05/2008 # Versão: 1.2 #--------------------------------------------------------------
#================================================================== # ** Atualizações ** #----------------------------------------------------------------- # - Mostrar Caixa de Nome acima do Evento ( personagem/evento ) # - Escolher a Opacidade e Posição (no script) # - Escolher som da caixa de nome (no script)
#================================================================== # ** Como Usar ** # * Use o comando de evento "Chamar Script" Para algum trcho de script abaixo. #----------------------------------------------------------------- # 1. Configure esse script nas Configurações abaixo. # 2. Para escolher o texto na caixa, chame o script abaixo # set_text(Personagem, texto) # # set_text(personagem, texto) # set_text(10,'Olá!') #* personagem: Qual personagem você quer que fale esse texto? #** -1 para 'jogador', 0 para 'Este evento', e 1 ou mais para o ID do evento # # 3.Para Limpar o texto escreva: # set_text(personagem, '') #==================================================================
module Wora_CTB #================================================================ # ** [Inicio] CharBox Configurações ** #---------------------------------------------------------------- SAVE_TEXT = true # Salvar o texto na caixa? (true(sim) ou false(não) # Se sim, o texto sempre ficará, até se você sair e voltar pro mapa. TEXTBOX_SKIN = 'Window' # Nome do Windowskin usado, da pasta 'System' TEXTBOX_OPACITY = 255 # Opacidade (0 - 255) TEXTBOX_X_OFFSET = 0 # Horizontal (+ or -) TEXTBOX_Y_OFFSET = -1 # Vertical (+ or -) TEXTBOX_POPSOUND_MODE = 2 # SEEfeito Sonoro)para tocar quando a caixa aparece, # ou o texto muda: # 0 para nenhum, 1 para quando a caixa aparece na primeira vez, # e 2 dois para quando a caixa aparecer e mudar o texto. TEXTBOX_POPSOUND = 'Decision1' #Nome de SE TEXTBOX_POPSOUND_VOLUME = 80 # Volume de SE TEXTBOX_POPSOUND_PITCH = 100 # Pitch de SE #---------------------------------------------------------------- # ** [Final] CharBox Configurações ** #================================================================ 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 # If there is new text @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 # Salvar novo texto $game_system.chartbox[[$game_map.map_id, char_id]] = @chartext if @chartext == '' # Se o novo texto for vazio ('') @textbox.visible = false if !@textbox.nil? else # Se o novo texto for vazio: Mudar Texto 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 !@textbox.nil? 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
unless Wora_CTB::SAVE_TEXT 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 end #=============================================================== # Window_CharTBox: Versão editada de Window_Help #=============================================================== 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 #================================================================== # [Final] VX Character Textbox por Woratana [woratana@hotmail.com] #================================================================== Créditos: Woratana ( Criação ) Toyota ( Tradução, Modificação e Disponibilização ) Se quiser ajuda fale algo! Desembucha! | |
|
AND_RYO Moderador
Mensagens : 177 Créditos : 19 Idade : 31 Localização : RS Frase Pessoal : O Conselheiro dos Makers...
| Assunto: Re: CharBox v 1.2 ( Caixa de Momes ) Sáb Jan 30, 2010 6:14 pm | |
| Deve ser interessante em games online...Parabéns ai Toyota! | |
|
traver Membro
Mensagens : 106 Créditos : 7 Idade : 26 Localização : Goiás
| Assunto: Re: CharBox v 1.2 ( Caixa de Momes ) Sáb Jan 30, 2010 6:28 pm | |
| ficou bom msm é tbm acho q ficaria ótimo em games onlines!! | |
|
Conteúdo patrocinado
| Assunto: Re: CharBox v 1.2 ( Caixa de Momes ) | |
| |
|