Jump to content

Recommended Posts

I dont know wether or not this already exists but here is a simple script to make faces dynamic to charicters.

needed one for my game, so i thought id share.

Screenshots

 

 

Lets say you have actor001:ralph in the database with this face and sprite-sheet.

90173411.png

 

But somewhere along the line, the player changes the graphic to something else. IE:character customization

74940589.png

Now this leads to a problem. you have alllll these text events set to the original face, but now its a brand spanking new face.

 

29428665.png

why set all these text events to the new face, and limit the fredom of your players, when you can just....

33156515.png

set it to show the face of the player! it looks a bit off while codeing, but while in game.

97370501.png

it changes the ugly black representation of the player, into the actual players face.

issent that nifty?

 

 

 

#======================================================================
#================Deathmock5's Actor face changer=======================
#Makes text more dynamic by changeinf the face graphic to match the actor
#for partmembers and player, change the face graphics to ones in party.png
#then while in game they will change dynamicly.
#place Party.png in the /faces/ folder
#for partys larger then 8 place a Party1.png in the /faces/ folder.
#if more is needed add 1. so Party2, Party3, ext.
#next update: if charicter is missing, prevent crash
#======================================================================
class Window_Message < Window_Base
 FINDER_NAME = 'Party'
 def new_page(text, pos)
contents.clear
if ($game_message.face_name.include? 'Party')
  $finder_set = $game_message.face_name[5..-1]
  if ($finder_set != '')
	actor = $game_party.members[$game_message.face_index + $finder_set.to_i * 8]
	draw_face(actor.face_name, actor.face_index, 0, 0)
  else
	actor = $game_party.members[$game_message.face_index]
	draw_face(actor.face_name, actor.face_index, 0, 0)
  end
else
	draw_face($game_message.face_name, $game_message.face_index, 0, 0)
end
reset_font_settings
pos[:x] = new_line_x
pos[:y] = 0
pos[:new_x] = new_line_x
pos[:height] = calc_line_height(text)
clear_flags
 end
end

this image is necessary for it to work corectly. it needs to be placed in the \Graphics\Faces folder as Party.png

for partys larger than 8 adding Party1.png, party2.png, ext will allow for more.

rirfih.jpg

Edited by deathmock5

Share this post


Link to post
Share on other sites

I mean, how does it know whether the first person should be talking or the second person should be talking.

Do we have to do something special when we do "show text"?

it gets the current face image of the actor in the databace and then changes it. when you make a text just use the face labeld 'player'.

if you want ill make a video showing how it works,

Share this post


Link to post
Share on other sites

What about a party that could have, basically, 11 total characters? my game has several unlockable secret characters. The standard party sheet has 8 characters, so they wouldn't fit there :P

Share this post


Link to post
Share on other sites

What about characters with emosets? I like this so far :), but how do you plan to incorporate using emosets? (Granted, one could make a bunch of 'player' characters for all the different emotions and do it that way, but...)

Share this post


Link to post
Share on other sites

What about characters with emosets? I like this so far :), but how do you plan to incorporate using emosets? (Granted, one could make a bunch of 'player' characters for all the different emotions and do it that way, but...)

emote sets? humm. that will be a bit... tricky.

well first i need to get the actor, the script does that. but only the basic face.

it needs some way to allow the coder to define the emotion.

but i don't want to include a bunch of script bits you need to type out in-order for it to work.

it needs to flow...

well, i guess i could get it to find the actor, and then you could throw in a few common events with some basic facial animations.

ei: the common even could read script: dmaf('surprise') and it could hop the face image to that of the corresponding face.

if only there was a way to pass ar..... W8 A TICK! [redacted previous statement]

 

what if i included a bit to search for a tag. something like.... [sHOCK] placed in the text to change the actors face. hum. ill have to think on it.

 

alright... um. after some thought i need to know exatly how emotions would work.

1.How are they saved? something like actor1[1]_emote.png? to represent ralph?

2.How would everyone like to call them? what is the best way people like to show there emotions. tags?

Edited by deathmock5

Share this post


Link to post
Share on other sites

What about characters with emosets? I like this so far :), but how do you plan to incorporate using emosets? (Granted, one could make a bunch of 'player' characters for all the different emotions and do it that way, but...)

emote sets? humm. that will be a bit... tricky.

well first i need to get the actor, the script does that. but only the basic face.

it needs some way to allow the coder to define the emotion.

but i don't want to include a bunch of script bits you need to type out in-order for it to work.

it needs to flow...

well, i guess i could get it to find the actor, and then you could throw in a few common events with some basic facial animations.

ei: the common even could read script: dmaf('surprise') and it could hop the face image to that of the corresponding face.

if only there was a way to pass ar..... W8 A TICK! [redacted previous statement]

 

what if i included a bit to search for a tag. something like.... [sHOCK] placed in the text to change the actors face. hum. ill have to think on it.

 

alright... um. after some thought i need to know exatly how emotions would work.

1.How are they saved? something like actor1[1]_emote.png? to represent ralph?

2.How would everyone like to call them? what is the best way people like to show there emotions. tags?

 

1. That would work! It'd require renaming a lot of facesets, but whatever~

2. I think tags would work best, though it should be like [EMOTION1], [EMOTION2], etc. Not everyone will put the same emotions in the same place :)

Share this post


Link to post
Share on other sites

May be creating an array like

Ralph_Emo => [ Shock = 0,

Happy = 1,

Sad = 2,

Angry = 3,

Scared = 4,

Angry = 5]

 

Where the script will look for the Emoset with the same name as the actor and select the Index with a script call or comment call.

 

Edit: .. The second part is something broken within my project, I'm trying to figure out what it is.

Edited by oriceles

Share this post


Link to post
Share on other sites

1. That would work! It'd require renaming a lot of facesets, but whatever~

2. I think tags would work best, though it should be like [EMOTION1], [EMOTION2], etc. Not everyone will put the same emotions in the same place :)

 

Tags would be better because it is more flexible. The real issue is the fact that someone may have dozens of different emotions available for their actors.

 

I would suggest using a table, allow the user to specify the face image name as well as the index.

 

Face_Table = { 
  # entry for first set of faces for player
  1 => { 
     1 => ["happy", 1],
     2 => ["happy", 2],
     3 => ["shocked", 5],
     4 => ["sleep", 3],
  },
  # entry for second set of faces for party member 1
  2 => {
     1 => ["happy", 3],
     2 => ["happy", 4]
  }
}

 

The table is a double nested hash, where the outer hash contains a set of numbers that allow you to group faces by index (according to your party.png sheet, where 1 is your player, 2 is the first party member, 3 is the second party member, etc.)

 

Then in your textbox, you would say something like \e[1] or \em[2] to get the appropriate face for the corresponding actor.

 

Alternatively, you could just store an array of hashes so that you directly index into the array rather than having to do the extra computation for the hash.

 

Edited by Tsukihime

Share this post


Link to post
Share on other sites

I know this is necropost but... I have managed to do this using a common event that change all actors face graphics, off course the common event is based on the emotion, so after the required message i run another common event that resets back to the default face  :P

Share this post


Link to post
Share on other sites

Another necropost, but I feel this is important to note: If you're using Yanfly's Advanced Message System, make SURE you insert this script ABOVE it, or you will run into problems (such as with the name box).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×