Nickname Input Process

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.
reading this... i suddenly have an idea for my game.

we can type the nickname anytime for our actor. and that nickname 'could' give stats/feature if match the 'special' nickname.

ex: by typing Silver Reaper will give 10% max hp, etc.

and the nickname will be discovered in game either by dialogue or doing main story / sidequest 😀 .
Thank you for this script, but too bad it does not change the nickname and not the name of the player.

Syyougo.
@estriole: Nickname cheatcodes or nickname stats!(Galve has his own nickname script for that I believe). That is a possiblility xD.


@Syyougo: I'm not sure what you are trying to say. The script does allow you to change the nicknames of your actors, as for changing player names, there is a built in event command for that.
I mean that the nickname is changed, but if you want the player invents his own name, how can we change the system? 

 

For the nickname matter to us, the name is most important in the game? This is seen when the character menu is displayed.
By default nicknames are pretty pointless, it's up to the developer to give power to them. Galv has a Nickname functionality script that adds bonus stats depending on the nickname. I have a script that adds bonus stats upon level ups depending on a nickname's composition. Think of nicknames as an unofficial 2nd class with no built in functionality, but can be extended via scripts. You just have to think of a use for it and implement it.
Thank you for your answer, I'll take care of it right away.

 

Syyougo.
I am using the nicknames as the characters' last names. Which comes into play later on in my game, but I'm trying to figure out how to display the nickname in the text output. I know that to use the actor's name you put /N[1], but how can you call up the nickname? I appreciate any help in advance! Thanks!
Fixed script format, credit Selchar.
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 below
#===============================================================================
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

Original thread: https://forums.rpgmakerweb.com/threads/nickname-input-process.20938/