Help - Search - Members - Calendar
Full Version: NEW! A Choose one of the actors, and load their face into a message.
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
ubergeek
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.)
SojaBird
Well ya did a great job.
I must say that this is a great way to let people use the script with the editor itself.
Keep on doing these nice things, it's realy good to changes the Game_Interpreter smile.gif
I think I'll plan to do some modifications to it as well since it's realy userfriendly.

Keep up the good work, SojaBird.
maker2008
How to call the script?
SojaBird
There is nog call script required.
All you have to do is put the empty picturefiles in the graphics/faces folder.
When you are creating messages, use the empty MainCharacter face for example...This way the first actors face is drawn at that messages.
ubergeek
Well, I'm glad I finally created a script that people like. Whenever I make a script, I think about different problems that people might face and ways to fix them. The script I'm working on right now let's you create one map for a building that appears in multiple places (such as a inn, or an equipment shop.)
NanatsuYoru
QUOTE (ubergeek @ Aug 25 2008, 01:27 PM) *
Well, I'm glad I finally created a script that people like. Whenever I make a script, I think about different problems that people might face and ways to fix them. The script I'm working on right now let's you create one map for a building that appears in multiple places (such as a inn, or an equipment shop.)

I have a question with ur script...is there a way to use these kinds of faces on ur script? http://usui.moo.jp/graphics/rpg_sozai/actor/Actor19.png
The Wizard 007
Pretty good ubergeek. I will probably use this script but I don't really mind doing the faces individually. Your script saves some time however so it's helpful in making story oriented games with a lot of dialogue much faster to create. Anyway nice work, many people seem to neglect the usefulness of simple yet effective scripts. Keep it up. I am looking forward to the building script. That will save a buttload of time.
Ninja Commander
This script, or at least the concept, is great. I seem to be having trouble getting it to work, however, despite the fact that I was certain I followed your directions exactly...

...maybe I'm an idiot...

It's supposed to change the options you're given for the face when you create a text-box in an event, right?
blasterfx5
Gah! I put that script above main, important thoes folders into characters or whatever in the graphics folder. but when i try to use a text box it
says failed to create bitmap! but this script would go so perfect.. i want to design different versions of the character, and different genders too! it would be soo cool.
yuzippy
Well, I like it, but personally, I would prefer switched. That is just me, though. I like having everything laid out. Keep up the good work thumbsup.gif
silvershadic
This can be done with switches in events.
Make your event.
Switch 005 [BOY] is on, then you put the text with the male faces.
Switch 006 [GIRL] is on, then you edit the one from boy, replacing the male face with the female face.
Diskettesa
It gives me an error when I put it in. Perhaps I'm doing it wrong? :/
I put it above main and then it gives me an error about the last line. "end". ?
Templayer
The scripts doesn't work for me.

I'm probably stupid but ...

I've putted it above main (in materials) - copypasted from the .txt file

Then I putted the images into graphics folder and also in the graphics/faces folder.

When I run the game, the game crashes instantly with error - Syntax error at line 45 in Character_faces script

Should I name the script in some other way? Anyway the line 45 is Return false

I NEED THIS SCRIPT BADLY, PLEASE RESPOND !! :<
Kread-EX
Just add another "end" at the very last line of the script.
Templayer
QUOTE (Kread-EX @ May 22 2011, 05:32 PM) *
Just add another "end" at the very last line of the script.


THANK YOU SO MUCH Kread-EX !!

I really suck at programming.
Anyway, I was able to make a full character creation (using many, many , many event pages) which has Race choosing (also changes statistics), gender choosing, portrait and visual choosing (depends on choosed race and gender, its somewhere around 60 character now) - alot of races anyway, changing dual wielding weapons, classes, attributes and skills. Working on skills (permanent and active) and equipment (i have a set of thousands icons, so not a problem biggrin.gif ), then moods.

The reason I wanted this is the dialogues will have a lot of IF constructions (mostly mood, then class based and some race or gender based) with the characters ! YOU MADE MY DREAM COME TRUE !!

If you want videos of this, send me a PM (so i know you are interested in watching 20 minutes of footage on only character creation, LOL) and I send you the youtube videos.

Anyway ..... THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS
joseanjim
TY so much ubergeek! I really need that script.... Now I can continue my project! biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.