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.

Looking for a certain message feature

Sorry in advance if this is a newb question. I've never really worked with scripts before. Anyway I looked into different advanced message scripts but I couldn't find one with this feature that I need.

Basically I need something like the \N[n] feature but instead of going by actor id, I need it to display the name of the current party member in that position. \N[3] displays the name of actor 3, but what I need is a way to display the name of the 3rd character in the current party. I don't really know anything about scripting/coding so I don't know if this is something really complicated or something really simple. I've seen advanced message scripts with feature to do this for the 1st character in the party but not for the other 3.
 
I'm not currently using any message-based scripts (just a bestiary and a battle music script) so I guess I am using the default message system.

Replacing the \N[n] or having a new command would be fine. Either way. Whichever is easier. I just need a command similar to \N[n] only it go by position in the current party as opposed to actor number (The game I'm working on has 12 playable characters and you'll choose 4 to be your party, so I'm looking to have generic messages that will be spoken by whichever character is currently in party slot #)

So hypothetically, let's say the command to do this was \T[n]

and my party was A,B,C,D

I use \T[2]: Hello and the message is "B: Hello"

but if my party was E,F,G,H, the same command \T[2]: Hello would give the message "F: Hello"
 

Zeriab

Sponsor

Find the Window_Message section in the script editor.
Go to line 86 and insert this right below that line:
Code:
      text.gsub!(/\\[Tt]\[([0-9]+)\]/) do
        $game_party.actors[$1.to_i - 1] != nil ? $game_party.actors[$1.to_i - 1].name : ""
      end

The section looks like this afterwards:
Code:
      text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
      end
      text.gsub!(/\\[Tt]\[([0-9]+)\]/) do
        $game_party.actors[$1.to_i - 1] != nil ? $game_party.actors[$1.to_i - 1].name : ""
      end
      # Change "\\\\" to "\000" for convenience
      text.gsub!(/\\\\/) { "\000" }

*hugs*
- Zeriab
 

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