Name box connected to Faceset

So I'm currently using Yanfly's, Ace message system for displaying Name boxes.
https://yanflychannel.wordpress.com/rmvxa/core-scripts/ace-message-system/

I find it very tedious having to write '\n<name>' in every text to display the characters' name box(especially in a conversation between more than 2 people. Or if their name is super long). Is there some way to display a characters 'name box' automatically when it's 'faceset' is selected in the text? OR, It doesn't have to specifically work this way. I just want a way to display a characters' name box automatically without tediously having to type 'n<Sebastian The Third>' in every text.
What you can do is use command “\n[x]” To automatically display the nth character’s name.

So far example: If I wanted to display characters 5’s name I’d Type. “\n<ln[5]>” And that should save you the tedium of typing in such long names.
What you can do is use command “\n[x]” To automatically display the nth character’s name.

So far example: If I wanted to display characters 5’s name I’d Type. “\n<ln[5]>” And that should save you the tedium of typing in such long names.

Yeah I know that. But I was wondering if there was a way to have it like this:
bump
The general problem here is that for an automatic, you need some way to get the name from somewhere. You'll need to specify how that should work before anyone can write any script.

That said, most Ace-scripters already moved on and no longer program scripts for Ace, so your chances to get this without some form of compensation to get a scripter interested is lower as well.

One way that might make this simple enough is to choose to use the filename of the face as the automatic actor name, but that means you'll have to split your facesheets into single face per file. However with this limitation the code for such a script would be simplified enough that some one might decide to write it.
The way the MV plugin works can't be reproduced in Ace as easily...

Edit: I hate that autocorrection to wrong words when typing on Android devices....
I'm not sure if there's a script already or of it has to be written, but you can copy/paste from a separate notepad in the meantime.
One way that might make this simple enough is to choose to use the filename of the face as the automatic actor name, but that means you'll have to split your facesheets into single face per file. However with this limitation the code for such a script would be simplified enough that some one might decide to write it.
The way the MV plugin works can't be reproduced in Ace as easily...

That’s exactly what I need though. Splitting the face sheets won’t be a bother for me. I guess my only problem is finding someone who would write out the script for me.
Easy enough to do. Place the following below Yanfly's Message System.

Spoiler
Code:
#===============================================================================
#Script: Yanfly Message Addon - Auto Name Window Names
#Author: Selchar
#Requestor: mylafter
#-------------------------------------------------------------------------------
=begin
This is a simple addon to Yanfly's Message System allowing for automatic name
window setup based on the name and index of the used faceset image.  Setup is
in the Selchar::Namebox module below.
Examples:

  Names["Actor1"] = [:All, "Ralph"]
 
  The above will set all indexes/faces of the Actor1 Faceset image to Ralph, so any
  and all faces from it will show Ralph in the Name Window.
 
  Names["Actor3"] = [
      $game_actors[1].name,
      "",
      "Yanfly",
      ]
     
  The above will set the first 3 indexes/faces of the Actor3 Faceset image.
  The first face is set to the name of Actor 1
  The second face is actually skipped since it's blank.
  The third face will be set to Yanfly.
 
  Names["Actor2"] = [
  "\\c[1]\\n[4]"
  ]
 
  Escape codes can also be used, just remember the extra \.  The above will
  set the first index/face of the Actor2 Faceset image to Actor 4's name, with
  colored text using color index 1(blue)
 
  If the escapecode \n<x> is already used in the textbox to designate a name, it
  will take priority over the image.
=end

module Selchar
  module NameBox
    Names = {}  #Do not remove
    def self.names_init
     #Names[Faceset name] = []
     
      Names["Actor1"] = [:All, "Hello World"]
      Names["Actor4"] = [
      $game_actors[1].name,
      "\\n[2]",
      "Terrence",
      "Top-Right Corner",
      "\\c[1]\\n[4]",
      "5",
      "Six",
      "Last",
      ]
      Names["Actor3"] = [:All, "Goodbye World"]
    end
  end
end
#===============================================================================
# Rest of the Script
#===============================================================================
$imported = {} if $imported.nil?
$imported[:Yanfly_Auto_Nameboxes] = true

unless $imported["YEA-MessageSystem"]
  msgbox("Yanfly's Message System not detected,
exiting")
  exit
end

module Selchar::NameBox
  @init = false
  def self.name(faceset, index)
    if @init == false
      self.names_init
      @init = true
    end
   
    return "" unless Names[faceset]
    return Names[faceset][1] if Names[faceset][0] == :All
    return Names[faceset][index] if Names[faceset][index]
    return ""
  end
end

class Window_Message < Window_Base
  alias :sel_start_name_window :start_name_window
  def start_name_window
    if @name_text == ""
      @name_text = Selchar::NameBox.name($game_message.face_name, $game_message.face_index)
    end
    sel_start_name_window
  end
end
Aw man, I did a version as well, haha. Oh well, good practice for me.

I made it so that actors will automatically have their namebox drawn based on the name set in the database or in-game. This means that if you change their name at any point, it will reflect this. You can also turn automatic nameboxes on or off.

Spoiler
Code:
=begin
#============================================================================
#   AMN Auto Nameboxes
#   Version 1.0
#   Author: AMoonlessNight
#   Requires: Yanfly Engine Ace - Ace Message System
#   Date: 27 Apr 2018
#   Latest: 27 Apr 2018
#===========================================================================#
#   UPDATE LOG
#---------------------------------------------------------------------------#
# 27 Apr 2018 - created the script
#===========================================================================#

This script makes it so that a namebox will automatically appear for each
actor in the database, based on their face image.

You can also set up other automatic nameboxes in the editable region below.


To turn off automatic nameboxes, use the script call:
$game_system.autonameboxes = false

To turn them back on, use the script call:
$game_system.autonameboxes = true

They are set to true by default.

Nameboxes set in the message text will take priority over the names set below.


Based on an MV Plugin by SumRndmDde: http://sumrndm.site/automatic-name-boxes/

=end

module AMN_Auto_Nameboxes
  Autonameboxes = {

#==============================================================================
# ** EDITABLE REGION BELOW
#------------------------------------------------------------------------------
#  Change the values in the area below to suit your needs.
#==============================================================================

# Please note that these names take priority over any actor names

  :autoname_1   => {
              :name       =>  "Ralph",
              :facename   =>  "Actor1",
              :index      =>  0,
              },

  :autoname_2   => {
              :name       =>  "Ulrika",
              :facename   =>  "Actor1",
              :index      =>  3,
              },

  :autoname_3   => {
              :name       =>  "Bennett",
              :facename   =>  "Actor2",
              :index      =>  2,
              },
                  
  :autoname_4   => {
              :name       =>  "Ylva",
              :facename   =>  "Actor2",
              :index      =>  5,
              },

  # Copy and paste as needed
  :autoname_5   => {       #   <-- Make sure to give each one a unique number
              :name       =>  "Vera",  # The name you want in the namebox
              :facename   =>  "Actor3", # The name of the face file in Graphics/Faces
              :index      =>  1,        # The index of the face file:
                                          # 0–3 top row, left–right
                                          # 4–7 bottom row, left–right
              },  # <= DO NOT REMOVE

#==============================================================================
# ** END OF EDITABLE REGION
#------------------------------------------------------------------------------
#  Please do not edit below this point unless you know what you are doing.
#==============================================================================

  } # <= DO NOT REMOVE
 
end

$imported = {} if $imported.nil?
if !$imported["YEA-MessageSystem"]
  msg = "                                           IMPORTANT:\n"
  msg += "                 Auto Nameboxes by A-Moonless-Night\n"
  msg += " \n"
  msg += "This script requires Yanfly's Yanfly Engine Ace - Ace Message System.\n"
  msg += "Please download it from https://yanflychannel.wordpress.com/rmvxa/"
  msgbox(msg)
  exit
end

#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles system data. It saves the disable state of saving and
# menus. Instances of this class are referenced by $game_system.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :autonameboxes            # use auto nameboxes
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias amn_autonamebox_gamesystem_init   initialize
  def initialize
    amn_autonamebox_gamesystem_init
    @autonameboxes = true
  end
 
end

class Game_Interpreter
 
  #--------------------------------------------------------------------------
  # overwrite method: command_101
  #--------------------------------------------------------------------------
  def command_101
    wait_for_message
    $game_message.face_name = @params[0]
    $game_message.face_index = @params[1]
    $game_message.background = @params[2]
    $game_message.position = @params[3]
    while continue_message_string?
      @index += 1
      if @list[@index].code == 401
        #
        namebox = ""
        if $game_system.autonameboxes
          size = $data_actors.size - 1
          actors = (1..size).to_a
          actors.each do |act|
            if $game_message.face_name == $game_actors[act].face_name && $game_message.face_index == $game_actors[act].face_index
              namebox = '\n<' + $game_actors[act].name.to_s + '>'
            end
          end
          auto_nb = AMN_Auto_Nameboxes::Autonameboxes
          auto_nb.each_key do |actor|
            if $game_message.face_name == auto_nb[actor][:facename] && $game_message.face_index == auto_nb[actor][:index]
              namebox = '\n<' + auto_nb[actor][:name].to_s + '>'
            end
          end
        end
        #
        $game_message.add(namebox + @list[@index].parameters[0])
      end
      break if $game_message.texts.size >= Variable.message_rows
    end
    case next_event_code
    when 102
      @index += 1
      setup_choices(@list[@index].parameters)
    when 103
      @index += 1
      setup_num_input(@list[@index].parameters)
    when 104
      @index += 1
      setup_item_choice(@list[@index].parameters)
    end
    wait_for_message
  end

end
Thank you so much Selchar! You're a lifesaver!
Thank you too A-Moonless-Night! I appreciate it! 😀

Original thread: https://forums.rpgmakerweb.com/threads/name-box-connected-to-faceset.94132/