Glitchfinder":3gyzl2aa said:Unlike in most scripts, when referring to game objects like the party members, an array will always start at 1. (The first entry, 0, is nil in things such as the party, items, actors, monsters, troops, etc) This means that you would use \n[1] to display the party leader's name.
class Window_Message
#--------------------------------------------------------------------------
# * Add \P[n] to display Party Member[n] in a message - Brew
#--------------------------------------------------------------------------
alias pm_refresh refresh
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# If waiting for a message to be displayed
if $game_temp.message_text != nil
text = $game_temp.message_text
# Control text processing
text.gsub!(/\\[Pp]\[([0-9]+)\]/) do
$game_party.actors[$1.to_i - 1] != nil ? $game_party.actors[$1.to_i - 1].name : ""
end
$game_temp.message_text = text
end
pm_refresh
end
end