Nickname Input Process
Selchar
Introduction
This script creates a scene, more or less a copy of the built in Name Input scene, that allows players to create their own Nicknames for their Actors in game.
Features
- Creates a Nickname Input Scene
Screenshots
Spoiler
How to Use
Place this script into the Script Editor below ▼ Materials and above ▼ Main. Then use the scriptcall nickname_input_processing(actor_id, max_char_length)
Script
Spoiler Code:
#=============================================================================== #Script: Nickname Input Processing #Author: Selchar #------------------------------------------------------------------------------- =begin This is a simple Nickname version of the Name Input Processing event command, allowing for giving Actors any nickname one desires #------------------------------------------------------------------------------- Script Call #------------------------------------------------------------------------------- nickname_input_processing(id, length) Where id is the ID of the actor you want to give a new Nickname to, and length is how long you want to cap the nickname's character count, which defaults to 15. Example: nickname_input_processing Will setup Actor 1 with a char_count of 15 nickname_input_processing(4, 5) Will setup Actor 4 with a char_count of 5 =end #=============================================================================== #Please do not modify anything bel #=============================================================================== class Window_NickNameEdit < Window_NameEdit def initialize(actor, max_char) super(actor, max_char) @default_name = @name = actor.nickname[0, @max_char] @index = @name.size deactivate refresh end end class Scene_NickName < Scene_MenuBase def prepare(actor_id, max_char) @actor_id = actor_id @max_char = max_char end def start super @actor = $game_actors[@actor_id] @edit_window = Window_NickNameEdit.new(@actor, @max_char) @input_window = Window_NameInput.new(@edit_window) @input_window.set_handler:)ok, method:)on_input_ok)) end def on_input_ok @actor.nickname = @edit_window.name return_scene end end class Game_Interpreter def nickname_input_processing(id = 1, length = 15) return if $game_party.in_battle if $data_actors[id] SceneManager.call(Scene_NickName) SceneManager.scene.prepare(id, length) Fiber.yield end end end 复制代码
FAQ
Q: Are there any compatibility issues?
A: None that I'm aware of, tho it does inherit from the built in Name Input Process scene, so changes to that may apply to this as well.
Q: Commercial/Non-Commercial?
A: Anything goes.
Credit and Thanks
Selchar
Author's Notes
Tested and compatible with
EST - Input Name with Keyboard , regardless of script order.
本贴来自国际rpgmaker官方论坛作者:Selchar处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/nickname-input-process.20938/