Shows face in shared common events

Charles2020

Veteran
Veteran
Joined
Feb 24, 2020
Messages
31
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hi guys

Is there a way or code to show the face of NPC in the common event ?

For example, common event showing text "XXX" was used for NPC A and NPC B

How can I show the face of NPC A and NPC B in this common event

Thanks
 

Chef

yeet
Veteran
Joined
Oct 13, 2017
Messages
286
Reaction score
131
First Language
Dutch
Primarily Uses
RMMV
What do you mean exactly? Cause you can just select a face image in a common event Show Text but I don't think you mean that.
 

Hyouryuu-Na

1/2ded
Veteran
Joined
Jun 15, 2017
Messages
497
Reaction score
1,009
First Language
Bangla
Primarily Uses
RMMV
You can do conditions. If npc a is talking, show text with face of npc a. same for npc b. How you will manage that condition is sorta difficult. Why not just show text from the npc event?
 

Charles2020

Veteran
Veteran
Joined
Feb 24, 2020
Messages
31
Reaction score
1
First Language
English
Primarily Uses
RMMV
So NPC A and B are different faces. How can we show content in common events but use their own NPC faces

For example, common events saying "Good morning, XX" but can be reused for every NPC. I know the easiest way is to manual show text for each NPC.

I think condition controlling If npc a is talking, show text with face of npc a. may work but how can we show face and common event in the same line of code ?

Is there a code to show face or NPC and common events at the same time ?
 

Chef

yeet
Veteran
Joined
Oct 13, 2017
Messages
286
Reaction score
131
First Language
Dutch
Primarily Uses
RMMV
I don't know exactly how that would need to be solved, but I do know that would be even more work since you would need to link every image to an event number or set variable from within the event.

And quoting an event numbers' name works like this: \n<Bruce>\N[1] and I will come with you.

where the \ is the starting point. N calls for the actor list. I do think it's possible to directly quote an events' name but I don't know the code for that.
 

Hyouryuu-Na

1/2ded
Veteran
Joined
Jun 15, 2017
Messages
497
Reaction score
1,009
First Language
Bangla
Primarily Uses
RMMV
After a quick search I found this:
$gameMessage.setFaceImage('Actor1',0)
$gameMessage.setBackground(1)
$gameMessage.setPositionType(1)
$gameMessage.add("Show Text Script Call")
These are script calls you can run in your common event.
What I have in mind is that, replace the index with this.eventId()
This will insert the id of your event in place of index and show the face of that event.
You can do this for 8 faces. Indexes 0-7.
But this won't work if your event id is greater than 7.
All of this is a lot of work so you should just show text the normal way, from events directly.
 

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
326
Reaction score
120
First Language
English
Primarily Uses
RMMV
You would need to know how to script to do this, but you can make an array of all NPCs in the game with a face name and face index then use $gameMessage.setFaceImage(array[mapId, eventId].faceName, array[mapId, eventId].faceIndex), probably would need to edit the function that shows text with that. Too complicated for anyone to make a plugin for you for as you need to manually setup an array with the information.
 

Hyouryuu-Na

1/2ded
Veteran
Joined
Jun 15, 2017
Messages
497
Reaction score
1,009
First Language
Bangla
Primarily Uses
RMMV
I think this is the best way, if you wanna do this from common events:
in the npc event, do this:
$gameVariables.setValue(x, "fileName")
Call common event

in common events:
$gameMessage.setFaceImage($gameVariables.value(x),0)
$gameMessage.setBackground(1)
$gameMessage.setPositionType(1)
$gameMessage.add("Show Text Script Call")

If you have to change index for each npc, just set a value to another variable and do this:
$gameMessage.setFaceImage($gameVariables.value(x), $gameVariables.value(x2)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

A mousefolk sprite I made, I think I did good.
Discovering math. functions for damage formulas was one of the greatest things for me.
It's very useful for balancing skills to work in a variety of possible circumstances.
For example if you have a skill that is supposed to work for both mages and warriors:
Code:
Math.max(a.atk * 2 - b.def, a.mat * 2 - b.mdf)
SpaceX: First-ever successful (manned) commercial spaceflight!! In these terrible and self-sabotaging times for the world, that's a ray of excitement and hope I needed badly.
GameDevJohn wrote on whtdragon's profile.
Hey I used you bunny and cat spritesheet for a game jam game. Thanks so much! You have really beautiful stuff here. I'll credit you at https://gamedevjohn.itch.io/bunny-boy

Forum statistics

Threads
98,017
Messages
948,571
Members
129,276
Latest member
abhikhurana
Top