RPG Maker VX Ace

RPG Maker VX Ace

Not enough ratings
Dynamic Portrait
   
Award
Favorite
Favorited
Unfavorite
UGC Type: Edit And Play
File Size
Posted
1.095 MB
6 Jul, 2015 @ 2:56am
1 Change Note ( view )

Subscribe to download
Dynamic Portrait

Description
Speech portrait changes according to actor graphic. No need for branches and duplicate dialogue. Use a placeholder image and add a few extra lines in a script.

Include this image as the placeholder faceset in your project. It's name must be "Dynamic1.png" for it to work.

Then open Script Editor. Select "Window_Base" on the left and then scroll down the codes and find the following.

def draw_face(face_name, face_index, x, y, enabled = true) bitmap = Cache.face(face_name) rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96) contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha) bitmap.dispose end

Add these 4 lines of code after first line:

if face_name == "Dynamic1" face_name = $game_actors[face_index+1].face_name face_index = $game_actors[face_index+1].face_index end

So that it looks like this (screenshot included):

def draw_face(face_name, face_index, x, y, enabled = true) if face_name == "Dynamic1" face_name = $game_actors[face_index+1].face_name face_index = $game_actors[face_index+1].face_index end bitmap = Cache.face(face_name) rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96) contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha) bitmap.dispose end

Now simply use the placeholder faces in your speech and images will change depending on that particular actor's graphics. You can use another image as the placeholder, just make sure the part "Dynamic1" in the script is same as your image file name.

There's a modification of this that supports 8 emotes per faceset. Check Dynamic Emote Portrait if you are interested.
9 Comments
BoloWolf  [author] 18 Mar, 2019 @ 11:22pm 
@Atlantycki Yes, you can use/modify this in commercial projects.
Atlan the Atlarch 18 Mar, 2019 @ 1:28pm 
Hi! Can I use this in commercial projects? I plan on using it more than once.
BoloWolf  [author] 9 Jul, 2015 @ 2:08pm 
@Kitano1314 Well I prepared this Dynamic Emote Portrait item for you. That could be a possible solution.
Marc1314 9 Jul, 2015 @ 6:53am 
Your instructions are now very precise and the extra text-box was a good idea.
I'm afraid i don't know of any cure for the empty lines theat Steam adds to your code but at least it doesn't affect the script.

One more thing i wanted to ask, was about the extra 7 placeholder spaces on the Dynamic1 file.
Can i use these as 'emotes' for my player character?
If so what would be the best way to do this?
BoloWolf  [author] 9 Jul, 2015 @ 12:28am 
@Kitano1314 I modified the description and added a screenshot as well. I hope it's more clear now. One problem I can't fix is that Steam [code] tag adds extra empty lines, let me know if there's a fix.
Marc1314 8 Jul, 2015 @ 5:22pm 
I got this to work, and its exactly what i was looking for.
thanks for making it.

btw, i was confused at first cos in your instructions you say "Add these lines to make:"
That makes it sound like we need to add all of the lines in the text box underneath instead of just lines 2,3,4,5!
This got me at first as i havn't touched the script editor before this!
It could say something like: Add the extra lines of text that i have inserted.
Shubi 8 Jul, 2015 @ 10:28am 
@ShenWolf dont have the steam version :s
BoloWolf  [author] 8 Jul, 2015 @ 9:32am 
@OMG_it's_shuBi Did you Subscribed and checked the workshop item or tried making your own?
Shubi 8 Jul, 2015 @ 8:45am 
Doesn't work for me :s when i get the conversation it just shows the placeholder face