Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Detecting party leader

Kelg

Member

That comes out as a blank.(Maybe I'm missing something?) Unless you are saying to use \n[01], but I'm looking for some kind of command that can give the current on-screen character's name.
 
You could try to use a script as a condition in a conditional branch.

If $game_party.actors[0].id == x

Here you'd have to set x as the possible characters IDs inside the database.
Just set the different names for different characters.

There may be a simpler way, but this one should work.

Hope this helps

~Dalton~
 

Kelg

Member

It gives me an error message when I put that in, though I might be doing something wrong..
Anyway, I have it so that any party member can be removed and the party can have one member. So I am trying to find a way to make the party leader's name be displayed incase certain members are not present.

d-1.jpg


I want to be able to put the party leader's name in the space above, so that in story events it won't matter who is in the party.
 
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.
 
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.

\N[1] displays Actor 1 name, not party member 1. (i.e. in the default project, it will always display "Aluxes", regardless of party order.)

This little scriptlet will add a \P[n] function to allow you to show the party members name

Code:
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
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top