Jump to content
Dark Horseman

"Show Text: Face Graphic" (Emosets) Dilemma

Recommended Posts

I have a game where I change the actor's face portraits regularly. I currently use Yanfly's Message System which has the ability to display an actor's face picture using \af[x], where x is the actor index. This is fine if the actor changes class / clothes. and you just use \af[x] to display the face he currently has with the text.

 

I don't know how to handle emosets however. \af[x] limits you to one portrait. How would I address this issue without resorting to making hundreds of condition branches during text messages according to what the actor looks like?

 

Example:

 

John

MrYoungSourEmoset4.png

 

John if Aged

actor27ddg7.png

 

 

The only options I see is making condition branches for EVERY single dialogue checking if young or old. Or using Yanfly and only displaying 1 face - no using emosets whatsoever. Has anyone found a solution around this? Say a script calling calling variables..... use filename: "John[variable for old or young]4". Or have people just completely avoided doing this all together - and no, my game isn't concerned with something as trivial as this example... this is just easier to explain.

Share this post


Link to post
Share on other sites

Well, if you want this all the be as automated as possible, one idea would be to make every actor you have use an emoset set up with their emotions in the same positions for each set (Like normal is first, angry second, sad third, etc.)

 

Then create a dummy face set with filename "Leader.png". This file will never be seen, so you could write text in each face position of what the emotion is (angry, sad, etc.)

 

Add this to your script list (below materials, above main) and then whenever you use the dummy "Leader" faceset as the face in a message... it will use the corresponding emotion from the leader's faceset.

class Window_Message < Window_Base
  def draw_face(face_name, face_index, x, y, enabled = true)
    if face_name =~ /Leader/i && $game_party.leader
      face_name = $game_party.leader.face_name
    end
    super
  end
end

Share this post


Link to post
Share on other sites

Galv, would that method only work for the actor that is the 1st in formation? I'll give it a try anyway since I normally event by hiding characters so I can regularly switch the formation during cutscenes. Also I have no idea how to add a control character to yanfly's script, so I'll probably request it sometime in the future if that's a more logical fix.

Share this post


Link to post
Share on other sites

Yeah that would only work for the for the member in the first position.

 

Something along the lines of what Tsukihime suggested, adding this below Yanfly's script:

class Window_Message < Window_Base
  def message_escape_characters(result)
    result.gsub!(/\eAF\[(-?\d+)]/i) { change_face($1.to_i) }
    result.gsub!(/\eAFI\[(\d+)\]/i) { change_face_i($1.to_i) }
    return result
  end
  
  def change_face_i(face_index)
    $game_message.face_index = face_index
    return ""
  end
end
You can then use \afi[x] in a message box, which will change the which face in the faceset the message uses.

So \af[0]\afi[7] will mean it will use the leader's faceset and also change it to the last face in the faceset.

Share this post


Link to post
Share on other sites

Just tried it out. Works perfectly and saves me probably 20 hours of time in the future coding events... especially if I decide to allow more than 1 character to change portraits, oh man. Thanks to both of you, and I hope more people come by this post because I know its a prevalent problem forcing people into static portraits.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×