Switching player choosen portrait in text

Hi, I'm still kinda new at this but was wondering if there is a way to switch to a player selected potrait (select in the beging of the game), To match the text you are trying  to type down? Like------"(pic here)"-----"command for actor 1 here (To insert pic)"----"text here". Does anyone know if this is possible without putting 50+ conditional events? Or is there a script out there that does this?

P:S: Was wondering if anyone knew about a script that allowed for players to select  a sprite? Instead of the selection box, actually show the sprites the player would like to play with and select it?

Thank you for your time 🤣
You need to use one of the messaging scripts that add a face-textcode.


I do not know at the moment which ones do, but both Yanfly's Messaging System and Modern Algebra's Advanced Text System should have such a code.


Please search for them on the master script list.


I've moved this thread to Script Request. Please be sure to post your threads in the correct forum next time. Thank you.
P:S: Was wondering if anyone knew about a script that allowed for players to select a sprite? Instead of the selection box, actually show the sprites the player would like to play with and select it?
You could event that using show pictures and so on. You can also event it such that the sprites are on the map as event graphics, then all of them are action triggered such that if the player activates that event, it asks the player if he/she wants to use that sprite


Also, there is a Character Creation script in the scripts section but that might be a little complicated for this
# \f[index] in message box to show the face at that indexclass Window_Base < Window alias shaz_more_faces_process_escape_character process_escape_character def process_escape_character(code, text, pos) shaz_more_faces_process_escape_character(code, text, pos) case code.upcase when 'F' change_face(obtain_escape_param(text)) end end def change_face(face_index) $game_message.face_index = face_index contents.clear_rect(0, 0, 96, 96) draw_face($game_message.face_name, $game_message.face_index, 0, 0) endendIn a new script slot.Type \f[1] at the start of your message and it will show whatever face is assigned to Actor 1. So they can choose gender, race, whatever and you can use Change Actor Graphic, and always have the appropriate face shown. When you use this, you don't need to select a face when you create the Show Text box.
Use a Transparent Picture in your Textboxes.

And a call common event command before each textbox.

The common Event will than display the Faceset as Picture depending on the Variable Value you choosed at the beginning of game at char selection.

After the Textbox make Erase Picture Command.

If your Textbox Positions are always different, thats also no problem with some more work in that common event.

So you have to Edit just one Event if u want to make changes.

Shaz Script Link reads easier and is without making facesets to pictures.
# \f[index] in message box to show the face at that indexclass Window_Base < Window alias shaz_more_faces_process_escape_character process_escape_character def process_escape_character(code, text, pos) shaz_more_faces_process_escape_character(code, text, pos) case code.upcase when 'F' change_face(obtain_escape_param(text)) end end def change_face(face_index) $game_message.face_index = face_index contents.clear_rect(0, 0, 96, 96) draw_face($game_message.face_name, $game_message.face_index, 0, 0) endendIn a new script slot.Type \f[1] at the start of your message and it will show whatever face is assigned to Actor 1. So they can choose gender, race, whatever and you can use Change Actor Graphic, and always have the appropriate face shown. When you use this, you don't need to select a face when you create the Show Text box.
This right here is exactly what I am looking for.. Just one problem. I input the command and no pic. I put the script in materials. I hope that's right. Oh and thank you so much this will help me so much!! 😀
This right here is exactly what I am looking for.. Just one problem. I input the command and no pic. I put the script in materials.
Please post a screenshot of the event so that we can see how you put the command in - you might have made a mistake there.
Cannot use the sceen extension on this, but this is the even

"@>Text:-,-,Normal,Botton

:           : \f[1] Hi                "

the character has a portait aswell

sry to be so difficult
Can you show us a picture of Actor 1 in the database? And a screenshot showing what happens when this command is run in your game?


What other scripts do you have? I wonder if you've got other custom scripts that use \f[] and they're grabbing it instead.


Also, where in Materials did you put it? Above other scripts? Below them? Should be below materials and above main.


I don't think it makes a difference but try changing the \f to \F - I'm pretty sure it upcases everything though.
Cannot use the sceen extension on this,
Why? can you tell us what your problems with making screenshots is?
Because sooner or later, you'll need to post screenshots if you need help, because an event is more than the contents and too often the cause of a problem is in the details...
"You are not allowed to use that image extension on this community."

cannot put up screenshots. its a .png format and shrunk to 290-240. even tried to put the origional shots and can't

testing the spoilers

Spoiler
works
yep used jpeg, png and gif the forums will not allow me to post pics
Actor

Spoiler
[IMG]http://i578.photobucket.com/albums/ss227/lostrafe/Actor_zpsbv6ytqkn.jpg[/IMG]
Event

Spoiler
[IMG]http://i578.photobucket.com/albums/ss227/lostrafe/event_zpsdgns2vrd.jpg[/IMG]
In game

Spoiler
[IMG]http://i578.photobucket.com/albums/ss227/lostrafe/game_zpsc4soja8l.jpg[/IMG]
Scripts

Spoiler
[IMG]http://i578.photobucket.com/albums/ss227/lostrafe/Scripts_zpshcrwqklx.jpg[/IMG]
so, so sry finally figured it out 😀
Even tried removing all the scripts. besides your shaz ofcouse
Rafe, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Just edit your last post and add the new info.


Look in those unnamed script slots and make sure there aren't any scripts in there.


If you have removed all the script besides mine and it still doesn't work, then there's something wrong with your project. Start a brand new project and don't make any changes to anything, except add my script alone. Then try a text box with \f[1] in it to see what happens.


If that works and yours still doesn't, feel free to zip it up (project file, no RTP) and load it up online somewhere (not somewhere we'll have to create an account to download), and we'll take a look at it for you.
One question: does the party have an actor?


The ingame screenshot doesn't show any player at the center like regularly, so either your party is empty or invisible.


And I don't know if the snippet displays based on actor ID or on Party index - in the last case it only works if you have a member in your party.
I'm so sorry - I gave you the wrong script! I have 3 different ones with different purposes, and I copied the wrong one.

Try THIS script instead of the other:

class Window_Base < Window alias shaz_ffa_convert_escape_characters convert_escape_characters def convert_escape_characters(text) result = shaz_ffa_convert_escape_characters(text) result.gsub!(/\eF\[(\d+)\]/i) { $game_message.face_name = $game_actors[$1.to_i].face_name $game_message.face_index = $game_actors[$1.to_i].face_index '' } result endendThis should give you a MUCH better result.The script I originally gave you, by the looks of it, is designed for when you have one sheet of faces with different expressions for the same character. So you WOULD choose the face image in the Show Text command, and the \f[n] tells it to use that face set, but the index n, which would have an expression appropriate for the dialogue.

Clearly I need to make more specific comments in my scripts when I do them to answer a small script request.
ty and sry for the double post wont happen again. thx for your help 🙂

Original thread: https://forums.rpgmakerweb.com/threads/switching-player-choosen-portrait-in-text.44736/