RPG Maker VX Ace

RPG Maker VX Ace

评价数不足
Dynamic Portrait
   
奖励
收藏
已收藏
取消收藏
UGC Type: Edit And Play
文件大小
发表于
1.095 MB
2015 年 7 月 6 日 上午 2:56
1 项改动说明 ( 查看 )

订阅以下载
Dynamic Portrait

描述
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 条留言
BoloWolf  [作者] 2019 年 3 月 18 日 下午 11:22 
@Atlantycki Yes, you can use/modify this in commercial projects.
Atlan the Atlarch 2019 年 3 月 18 日 下午 1:28 
Hi! Can I use this in commercial projects? I plan on using it more than once.
BoloWolf  [作者] 2015 年 7 月 9 日 下午 2:08 
@Kitano1314 Well I prepared this Dynamic Emote Portrait item for you. That could be a possible solution.
Marc1314 2015 年 7 月 9 日 上午 6:53 
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  [作者] 2015 年 7 月 9 日 上午 12:28 
@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 2015 年 7 月 8 日 下午 5:22 
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 2015 年 7 月 8 日 上午 10:28 
@ShenWolf dont have the steam version :s
BoloWolf  [作者] 2015 年 7 月 8 日 上午 9:32 
@OMG_it's_shuBi Did you Subscribed and checked the workshop item or tried making your own?
Shubi 2015 年 7 月 8 日 上午 8:45 
Doesn't work for me :s when i get the conversation it just shows the placeholder face