-Nombre Del Script: Poner nombre del Personaje Mejorado
-Versión Del Script: No lo sé e.e
-Rpg Maker: XP
-Introducción: Si el viejo sistema para poner el nombre a uno de los personajes les parece aburrido, pueden usar este otro.
-Características: -----
-Demo: Ninguno
-ScreenShot: No es necesaria
-Script:
-Instrucciones: Estan en el script
-Compatibilidad: En XP
-Créditos: a Falcao
Para hacer que funcione, sólo deben en el contenido del evento poner "PONER NOMBRE PERSONAJE"
Si ocurren errores me avisan
-Versión Del Script: No lo sé e.e
-Rpg Maker: XP
-Introducción: Si el viejo sistema para poner el nombre a uno de los personajes les parece aburrido, pueden usar este otro.
-Características: -----
-Demo: Ninguno
-ScreenShot: No es necesaria
-Script:
Código:
#========================================================================#
# #*****************# Name Input V 1.0 Falcao script Permite #
# #*** By Falcao ***# usar el teclado completo para editar #
# #*****************# el nombre de los personajes. #
# RMXP #
# makerpalace.onlinegoo.com Date 11/27/2009 #
#========================================================================#
#------------------------------------------------------------------------
# * Intrucciones
#
# Solo copiar y pegar el script encima de main
#
# Para correr el script basta con usar el comando 'Poner Nombre Personaje'
# situado en la tercera pagina de los comandos de evento
#
# Es importante saber que este script reemplaza el horrible script de
# poner nombre al personaje que viene por defecto.
#
# Licensia: Puede ser usado en juegos comerciales o no comerciales
#-------------------------------------------------------------------------
module FalVocab
# Usar mapa como fondo? cambiar true o false
Map_Background = true
# Comandos info vocabulario
Ins_enter = "Enter = Aplicar"
Ins_edit = "Abc = Editar"
Ins_erase = "Back = Borrar"
Ins_goedit = "Z = Volver a editar"
Ins_exit = "X = Salir"
# Actor info vocabulario
Actor_class = "Clase inicial"
Actor_level = "Level inicial"
Actor_exp_in = "Exp Inflacion"
end
module FalInput
Teclas = {
#Numbers
1=> [cero = 0x30, "0", "0"],
2=> [one = 0x31, "1", "1"],
3=> [two = 0x32, "2", "2"],
4=> [three = 0x33, "3", "3"],
5=> [four = 0x34, "4", "4"],
6=> [five = 0x35, "5", "5"],
7=> [six = 0x36, "6", "6"],
8=> [seven = 0x37, "7", "7"],
9=> [eight = 0x38, "8", "8"],
10=> [nine = 0x39, "9", "9"],
# Letras
11=> [a = 0x41, "A", "a"],
12=> [b = 0x42, "B", "b"],
13=> [c = 0x43, "C", "c"],
14=> [d = 0x44, "D", "d"],
15=> [e = 0x45, "E", "e"],
16=> [f = 0x46, "F", "f"],
17=> [g = 0x47, "G", "g"],
18=> [h = 0x48, "H", "h"],
19=> [i = 0x49, "I", "i"],
20=> [j = 0x4A, "J", "j"],
21=> [k = 0x4B, "K", "k"],
22=> [l = 0x4C, "L", "l"],
23=> [m = 0x4D, "M", "m"],
24=> [n = 0x4E, "N", "n"],
25=> [o = 0x4F, "O", "o"],
26=> [p = 0x50, "P", "p"],
27=> [q = 0x51, "Q", "q"],
28=> [r = 0x52, "R", "r"],
29=> [s = 0x53, "S", "s"],
30=> [t = 0x54, "T", "t"],
31=> [u = 0x55, "U", "u"],
32=> [v = 0x56, "V", "v"],
33=> [w = 0x57, "W", "w"],
34=> [x = 0x58, "X", "x"],
35=> [y = 0x59, "Y", "y"],
36=> [z = 0x5A, "Z", "z"],
# -- non- useless
37=> [back = 0x08, " ", " "],
38=> [space = 0x20, " ", " "],
39=> [caps = 0x14, " ", " "],
40=> [enter = 0x0D, " ", " "],
41=> [guion = 0x6D, "-", "-"],
# OEM
42=> [shift = 16, " ", " "],
43=> [oem1 = 189, "_", "_"],
44=> [oem2 = 222, "'", "'"],
45=> [oem3 = 188, ",", ","],
46=> [oem4 = 190, ".", "."],
47=> [oem5 = 191, "/", "/"],
}
Keyboard_Acces = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
def self.get_key(key)
Keyboard_Acces.call(key) & 0x01 == 1
end
end
class NameEdit < Window_Base
include FalVocab
def initialize(actor, char_max)
super(154, 50, 340, 100)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
@char_max = char_max
$falcao_apply = false
@text = ""
@wait_count = 0
@text_temp = []
@cursor_opa = 255
@caps_lock = 2
$registro_t = "Falcao"
self.opacity = 210
refresh
end
def refresh
self.contents.clear
self.contents.font.size = 20
draw_name
draw_cursor
self.contents.font.size = 14
if $falcao_apply
self.contents.font.color = disabled_color
else
self.contents.font.color = normal_color
end
self.contents.draw_text(0, 40, self.width, 32, Ins_enter)
self.contents.draw_text(120, 40, self.width, 32, Ins_edit)
self.contents.draw_text(220, 40, self.width, 32, Ins_erase)
end
def draw_name
self.contents.font.color = normal_color
for i in FalInput::Teclas.values
if FalInput.get_key(i[0])
next if i[0] == 16
if $falcao_apply; write_name; return; end
if i[0] == 0x14 and @caps_lock == 1
@caps_lock = 2
elsif i[0] == 0x14 and @caps_lock == 2
@caps_lock = 1
end
if i[0] == 0x0D #enter key
$falcao_apply = true
$game_system.se_play($data_system.decision_se)
if @text != ""
@actor.name = @text
$game_actors[@actor.id].name = @text
$registro_t = @text
end
return
end
unless i[0] == 0x08 or i[0] == 0x14 || @text_temp.size == @char_max
@text += i[@caps_lock]
@text_temp.push(@text)
end
if i[0] == 0x08 #Backspace
@text = @text_temp[@text_temp.size - 2]
@text_temp.delete_at(@text_temp.size - 1)
@text = "" if @text.nil?
end
end
end
write_name
end
def write_name
@cw = contents.text_size(@text).width + 115
x = 200 - @cw / 2
self.contents.draw_text(x, 0, self.width, 32, @text) rescue nil
return
end
def draw_cursor
return if $falcao_apply
@text_temp.size == @char_max ? add = -10 : add = 0
@wait_count += 1
case @wait_count
when 1; @cursor_opa = 255 # 1
when 15; @cursor_opa = 0 # 20
when 30; @wait_count = 0 # 50
end
x = 85 + @cw / 2
self.contents.fill_rect(x + add, 25, 8, 2, Color.new(192, 224, 255,
@cursor_opa))
end
end
class Actor_Info < Window_Base
include FalVocab
def initialize(actor)
super(154, 150, 340, 280)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 210
@actor = actor
refresh
end
def refresh
self.contents.clear
draw_actor_data
end
def draw_actor_data
self.contents.font.size = 20
cw = contents.text_size($registro_t).width + 115
nx = 200 - cw / 2
draw_actor_name(@actor, nx, 0)
self.contents.font.color = system_color
self.contents.draw_text(20, 120, self.width, 32, Actor_class )
self.contents.draw_text(20, 150, self.width, 32, Actor_level )
self.contents.draw_text(20, 180, self.width, 32, Actor_exp_in )
self.contents.font.color = normal_color
for clas in $data_classes
@clas_name = $data_classes[@actor.class_id]
end
self.contents.draw_text(170, 120, self.width, 32, @clas_name.name)
self.contents.draw_text(170, 150, self.width, 32, @actor.initial_level.to_s)
exp_inflacion(@actor.exp_inflation, 170, 190)
self.contents.font.size = 14
self.contents.font.color = normal_color
self.contents.draw_text(20, 220, self.width, 32, Ins_goedit)
self.contents.draw_text(170, 220, self.width, 32, Ins_exit)
end
def exp_inflacion(value, x, y)
self.contents.fill_rect(x, y, 90, 14, Color.new(0,0,0))
self.contents.fill_rect(x+1, y+1, 88*value/50, 6, Color.new(180,225,245))
self.contents.fill_rect(x+1, y+7, 88*value/50, 6, Color.new(20,160,225))
self.contents.draw_text(x + 92, y - 12, 48, 32, value.to_s)
end
end
class Sprite_Anime < RPG::Sprite
def initialize(viewport, x, y, character = nil)
super(viewport)
@character = character
@x = x; @y = y; @sx = 0; @counter = 0
create_bitmap
update
end
def update
super
update_src_rect
update_direction
end
def create_bitmap
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
def update_src_rect
@counter += 1
case @counter
when 10; @sx = 0 * @cw
when 20; @sx = 1 * @cw
when 30; @sx = 2 * @cw
when 40; @sx = 3 * @cw
@counter = 0
end
self.src_rect.set(@sx, 0, @cw, @ch)
end
def update_direction
self.x = @x + 158
self.y = @y + 130
self.z = 200
end
end
class Scene_Name
def initialize
@tone_rescue = $game_screen.tone
$game_screen.start_tone_change(Tone.new(-60, -60, -60, 25), 0)
end
def main
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport1.z = 200
FalVocab::Map_Background ? @spriteset = Spriteset_Map.new : nil
actor = $data_actors[$game_temp.name_actor_id]
@edit_name = NameEdit.new(actor, $game_temp.name_max_char)
@info_actor = Actor_Info.new(actor)
@sprite = Sprite_Anime.new(@viewport1,@info_actor.x,
@info_actor.y, actor)
Graphics.transition
loop do
Graphics.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose if [email protected]?
@edit_name.dispose
@viewport1.dispose
@sprite.dispose
@info_actor.dispose
$game_player.refresh
$game_screen.start_tone_change(@tone_rescue, 0)
end
def update
@viewport1.update
@sprite.update
if $falcao_apply
Input.update
@info_actor.refresh
end
@edit_name.refresh
if Input.trigger?(Input::A)
$game_system.se_play($data_system.buzzer_se)
@delay = 10
end
if @delay != nil; @delay -= 1
if (@delay == 1)
$falcao_apply = false; @delay = nil
end
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
end
end
class Font
alias falcaoBest3_font initialize
def initialize
falcaoBest3_font
if $scene.is_a?(Scene_Name)
self.name = "Georgia"
self.size = 20
end
end
end
-Instrucciones: Estan en el script
-Compatibilidad: En XP
-Créditos: a Falcao
Para hacer que funcione, sólo deben en el contenido del evento poner "PONER NOMBRE PERSONAJE"
Si ocurren errores me avisan
Última edición: