When I fisrt started creating my game, I noticed an obvious hurdle: When you create a message, you have to select a specific face to apply to the message. My plan was for the main character to use a different sprite depending on the player's gender, but sadly, this isn't possible. So I set to work on creating an easy-to-use script that would solve my problem.
This is an improvment of the basic "Lead Member" script I posted a couple of days ago, and believe me, this one works a lot better.
How this works is, when you select a face for a message, eleven new options appear. One reads "Face_Lead" and the others read "Face1" Through "Face10." (If you have more than 10 actors, it can still work but requires some adjustment. Keep reading.)
If you select "Face_Lead," the message wil appear as if it was being spoken by the person in the front of your party. (Although this wil not show up in the preview, it will show up in the Playtest.)
If you select "Face x" for any number x, the face of actor id #x will appear instead.
To install, do the following:
1. Download CharacterFaceHandler.zip, an attachment, to the graphics folder of your game.
2. Extract the files from the zip folder.
2.5 If you have more than 10 actors, add additional files to the Graphics folder title titled "Face11", "Face12", etc.
3. Add the script above main. The script will be written out here and availible as an attachment.
#SCRIPT BEGIN
#==============================================================================
# ** Character Face Handler
#------------------------------------------------------------------------------
# This script allows you to select actors from a list while creating messages.
# It references $game interpreter.
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# * Show Text
#--------------------------------------------------------------------------
def command_101
unless $game_message.busy
$game_message.face_name = @params[0]
$game_message.face_index = @params[1]
$game_message.background = @params[2]
$game_message.position = @params[3]
if $game_message.face_name == "Face_Lead"
$game_message.face_name = $game_party.members[0].face_name
$game_message.face_index = $game_party.members[0].face_index
else
for i in 1..$data_actors.size-1
if $game_message.face_name == "Face" + i.to_s
$game_message.face_name = $data_actors[i].face_name
$game_message.face_index = $data_actors[i].face_index
end
end
end
@index += 1
while @list[@index].code == 401 # Text data
$game_message.texts.push(@list[@index].parameters[0])
@index += 1
end
if @list[@index].code == 102 # Show choices
setup_choices(@list[@index].parameters)
elsif @list[@index].code == 103 # Number input processing
setup_num_input(@list[@index].parameters)
end
set_message_waiting # Set to message wait state
end
return false
end
#SCRIPT END
I didn't use the CODEBOX tags because then the code doesn't copy and paste well (for me, at least.)
This post has been edited by ubergeek: Aug 24 2008, 12:32 PM