- Joined
- Aug 24, 2019
- Messages
- 237
- Reaction score
- 329
- First Language
- German
- Primarily Uses
- RMMV
Anyone's Message_Face_Switcher v1.2
by Anyone
Introduction:by Anyone
This is a small plugin made for my current project that allows the game to switch out the message face for the face of an actor designated in the message face's file name.
Features:
- Easy switching of faces to actor faces without using escape codes in the message text
- Compatible with plugins that hard-edit the command101 (such as Yanfly's Message Core)
- The exchange happens early in the message generation, meaning that all text escape codes within the actual message text will act as if that face had been the face assigned in the editor from the start
- With normal faces, this saves you the time of using an escape like \af[x] to call the actor's face. With face busts plugins, especially the more complex ones, that load the message face from the message face name (such as Irina's VisualNovelBusts), this is essential to load a different bust as face in a seemless way without glitches and other bugs. (For example if your character has a different bust based on the equipment you're wearing)
- New: (v1.2) Redirection to other Files possible through prefix and suffix
1. Load the plugin preferably close to the bottom of your load order and activate it.
2. Create a *.png file that you wish to use as placeholder of the actor's face and ensure that it contains "_Actor" followed by the number of the ActorId of the actor whose face you wish to load.
Example: Harold_Actor1.png
3. Use the "Harold_Actor1.png" as the face when creating the "Show Text" function in your dialogue event. Regardless of whether Harold_Actor1.png is an empty png file, or contains some other face, this face will instead be switched to whatever face has currently been assigned to Actor1.
Alternatively, you can also use the phrase "_Partymember" in the *.png files' name to instead reference the face of the current party member in the slot.
Take care: the Actor ID's count from 1,2,3,4...
While the Partymember starts with 0 for the party leader: 0,1,2,3
This means that Actor 2 is "_Actor2" but Partymember 2 is "_Partymember1".
FAQ:
Q: The face isn't getting loaded.
A: Make sure you include the "_" sign in front of Actor. This is done to ensure that it won't pick up stuff like Factor12 as valid terms.
HaroldActor1.png is incorrect
Harold_Actor1.png is correct
Q: The wrong Partymember face is assigned.
A: Keep in mind that partymembers are counted from 0. If you want to reference the Partyleader in Slot 1, use...
_Partymember0.png
The Partymembers 2,3 etc. need -1 deducated from their number.
Partymember 3:
_Partymember2.png
Terms of Use:
- 1. This plugin can be used for free in free and commercial games alike.
- 2. Credit must be given to "Anyone".
- 3. The code may be edited & altered to your liking.
- 4. Redistribution of the original code as well as of edited versions is allowed, so long as proper credit is given.
Demo:
New Demo Version!
Equip items and see the message window face use the correct face.
(This is made possible with the Way_Core and Way_OnEquip plugins)
https://workupload.com/file/3NJTLPD4
Code:
/*:
*
* @plugindesc Version 1.2. This plugin switches the Message Window Face for the Actor's current Face.
*
* @author Anyone
*
* @param Redirect from ActorFace to Image
* @type boolean
* @on YES
* @off NO
* @desc Instead of direction to an Actor, it directs to another face based on the prefix
* designated in the Reference Phrase Prefix.
* @default false
*
* @param Reference Phrase Prefix
* @desc Instead of directing to an Actor, it directs to prefix + ActorFaceFile.
* @default prefix_
* @help
*
* @param Reference Phrase Suffix
* @desc Instead of directing to an Actor, it directs to ActorFaceFile + suffix.
* @default _suffix
* @help
*
* //==========================================================================//
* // Anyone's Message Face Switcher //
* //========================================================================//
* //~~~~~~~~~~~~~~//
* // by Anyone //
* //~~~~~~~~~~~~~~//
*
*
*
* This script allows you to use a placeholder face for an Actor that will switch
* out with the Actor's current face.
* Simply ensure that the term "_Actor" lower/uppercase insensitive is in the
* placeholder face file's name, followed by a number.
* So if you use an empty face as a png file called:
* "Harold's_Placeholder_Face_Actor1.png"
* the "_Actor1" will be detected and the face of Actor 1 will be used instead of
* the placeholder face.
*
* Alternatively you can also use "_Partymember" followed by a number to use a
* placeholder for a partymember. Keep in mind that Slot 1, the leader, is
* Partymember 0.
*
* Partymember1 (Leader): _Partymember0.png
* Partymember2 (Leader): _Partymember1.png
* Partymember3 (Leader): _Partymember2.png
* Partymember4 (Leader): _Partymember3.png
*
* Additionally, instead of directing to the Actor, you can also redirect from
* the Actor to a different file based on suffixes and prefixes.
* To do so, activate "Redirect from ActorFace to Image" in the plugin parameters
* by setting it to true. Then configure the prefix and the suffix for the image
* you intend to redirect to.
*
* E.g. Prefix: "Bust_" and Suffix: "_[Exp5x2]"
* The Face assigned to the Actor 1 is "David.png" in img\faces
* By using any face image as message face that contains "Actor1" inside the name
* the message window face will switch to David.png because this is Actor1's face.
* From there, with the Redirection active, it will actually switch over to
* Bust_David_[Exp5x2].png and use this as the message window face.
*
* //==========================================================================//
* // When is that useful? //
* //========================================================================//
*
* If your character's face changes throughout the game, and you want to have the
* current one displayed without having * to resort to in-message escapes such as
* yanfly's \af[x] to adjust it.
*
* While that may not seem big...it's huge for plugins that use face busts based
* on the message face which use their own escapes in the message text.
*
* Plugins such as Irina's VisualNovelBusts plugin are almost entirely
* incompatible with yanfly's \af[] escapes and at best create glitchy, laggy
* busts and at worst, either bug out or don't function at all.
*
* Since this plugin ensures the switch happens before the message text is even
* read,
* the switch is entirely seemless as if that face had been the one assigned to
* the message from the very beginning.
*
* //==========================================================================//
* // TERMS OF USE //
* //========================================================================//
*
* 1. This plugin can be used for free in free and commercial games alike.
* 2. Credit must be given to "Anyone".
* 3. The code may be edited & altered to your liking.
* 4. Redistribution of the original code as well as of edited versions is allowed,
* so long as proper credit is given.
*
* //==========================================================================//
* // CHANGELOG //
* //========================================================================//
*
* Version 1.2:
* - Added Suffix Sheet redirection (25th of December 2019)
*
* Version 1.1:
* - Added Prefix Sheet redirection (19th of November 2019)
*
* Version 1.0:
* - Released (12th of November 2019)
*
*/
var Imported = Imported || {};
Imported.ANY_Message_Face_Switcher = true;
var ANY = ANY || {};
ANY.MessageFaceSwitcher = ANY.MessageFaceSwitcher || {};
(function() {
var params = PluginManager.parameters('ANY_Message_Face_Switcher');
ANY.MessageFaceSwitcher.UseSheet = String(params['Redirect from ActorFace to Image']);
ANY.MessageFaceSwitcher.UseSheet = eval(ANY.MessageFaceSwitcher.UseSheet);
ANY.MessageFaceSwitcher.DirectPrefix = String(params['Reference Phrase Prefix'] || "");
ANY.MessageFaceSwitcher.DirectSuffix = String(params['Reference Phrase Suffix'] || "");
var _IS_Game_Message_Show_Text = Game_Interpreter.prototype.command101;
Game_Interpreter.prototype.command101 = function() {
_IS_Game_Message_Show_Text.call(this);
var _IS_ActorId = $gameMessage.faceName().match(/_Actor(\d+)/i);
if (_IS_ActorId) {
var _Actor_faceName_To_Use = $gameActors.actor(_IS_ActorId[1]).faceName();
var _Actor_faceIndex_to_Use = $gameActors.actor(_IS_ActorId[1]).faceIndex();
if (ANY.MessageFaceSwitcher.UseSheet == true) {
_Actor_faceName_To_Use = ANY.MessageFaceSwitcher.DirectPrefix + _Actor_faceName_To_Use + ANY.MessageFaceSwitcher.DirectSuffix;
$gameMessage.setFaceImage(_Actor_faceName_To_Use, _Actor_faceIndex_to_Use);
} else {
$gameMessage.setFaceImage(_Actor_faceName_To_Use, _Actor_faceIndex_to_Use)};
} else {
var _IS_PartyId = $gameMessage.faceName().match(/_Partymember(\d+)/i);
if (_IS_PartyId) {
var _Party_Is_Actor = $gameParty.members()[_IS_PartyId[1]].actorId()
var _Party_faceName_To_Use = $gameActors.actor(_Party_Is_Actor).faceName();
var _Party_faceIndex_to_Use = $gameActors.actor(_Party_Is_Actor).faceIndex();
if (ANY.MessageFaceSwitcher.UseSheet == true) {
_Party_faceName_To_Use = ANY.MessageFaceSwitcher.DirectPrefix + _Party_faceName_To_Use + ANY.MessageFaceSwitcher.DirectSuffix;
$gameMessage.setFaceImage(_Party_faceName_To_Use, _Party_faceIndex_to_Use);
} else {
$gameMessage.setFaceImage(_Party_faceName_To_Use, _Party_faceIndex_to_Use)};
}
}
};
})();
Also attached as *.rar archive.
Have fun.
CHANGELOG:
-v1.2
Added new Demo version, added a Redirect Functionality
Attachments
-
6.6 KB Views: 11
Last edited:

