Dark Horseman 93 Posted March 31, 2013 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 John if Aged 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
Galv 1,386 Posted March 31, 2013 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
Tsukihime 1,487 Posted March 31, 2013 (edited) I would add a control character to yanfly's script that will change the actor's face picture. Edited March 31, 2013 by Tsukihime 1 Dark Horseman reacted to this Share this post Link to post Share on other sites
Dark Horseman 93 Posted March 31, 2013 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
Galv 1,386 Posted March 31, 2013 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 endYou 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. 1 Dark Horseman reacted to this Share this post Link to post Share on other sites
Dark Horseman 93 Posted April 4, 2013 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
Tsukihime 1,487 Posted April 4, 2013 Someone should post the snippet in the release thread as an add-on. Share this post Link to post Share on other sites