设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 92|回复: 0

[制作教程] Alternate Skins

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    4 天前
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4616

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    23239
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    28749

    灌水之王

    发表于 2026-7-7 20:06:15 | 显示全部楼层 |阅读模式
    This tutorial is a bit different from my usual topics, but I thought it might be useful for some of you :3
    I have went through the frustration of having a chooseable hero in a past project (never finished, obviously ;D) and having to have all those if-statements just to get the right picture in the message box can be super frustrating. And I know, there are plug-ins, but plugins can clash or maybe you just want to avoid them or ... whatever.

    Let's go!

    Some games use the same one graphic for their hero throughout the whole game, but what if the look changes - maybe even multiple times - due to dynamic decisions during the game?
    Being it a choice which character you even play or the Golden Reid Skin you can unlock for 9999 gold, there are some pitfalls that could bring a lot of work with them.

    But before we get into that, there are many reasons why you might need this:

    • You could have a dynamic system where you can pick a look or a class while the story unfolds (mostly) the same for each option
    • You could have unlockable fun skins for people who just explore the whole game and find the easter eggs you hid for them - who does not want the PartyHat Skin for successfully trying out all the beverages in the game?
    • You could have story related outfit changes - maybe you get new cloaks after you passed through the elven forest and while that does not change the dialogue in the previous villages if you go back, your heroes just look different

    Okay, after we talked about the why, let’s have a closer look at the how. Basically, you set how a character looks in the database in the actor tab:



    But if you want them to look different as set from the start, you can change each of the categories via an event command, so once the player chooses to use the Golden Reid Skin, this command makes the change come true:




    This command will immediately change how Reid is displayed on the map, in the menu or in fights…



    …but there is one gaping hole in this:



    Since the message windows are not put together dynamically, all text boxes where Reid speaks to people will just have him look as he did before - not the shiny sparkly version we want to be seen. While you can use the names of the characters with “\n[1]” or even use variables in the text as Touchfuzzy shows in his great pronoun tutorial here, there is no quick command to change the face.
    Tip: If you want to know which additional tricks you can do in the message window, hover your mouse over it and wait a little.




    The selection for the face on the other hand is just ”select the picture, period”:



    The most common approach to this would either be settle for a plugin or have every Text Message by Reid being there two times in combination with an if-statement:



    This could look like this, the skin change would either go with a variable or a switch which then has an impact on the conditional branch that decides which of the two messages is shown.
    While this can work on a small scale, imagine having more than two outfits, or adding a third later in development and having to go back to each and every message box…

    Well, by the name of the tutorial you probably already guessed it: there is a solution.
    There is a way to display messages without using the message command, and once you get it set up it works as well as the command.
    You can display messages via script, and by the nature of that, you have even more power over them, especially when it comes to the face part!

    So, how do you display messages using the script calls? (The lines are listed in the MV/MZ script call list)
    $gameMessage.setFaceImage(faceName, faceIndex);
    This is the one snippet we will need to perform our trick. For “face name” you put the name of the file you want to display (for example, “GoldenReid”, you need the “” here) and that is in the face folder, and for “faceIndex” a number between 0 and 7 that indicates which frame on said faceset. Not using this line will leave the message as if no faceset was set.
    Before we go in depth on the dynamic part, we have a quick look at the other possible snippets as well:
    $gameMessage.setBackground(bgType);
    If you want the window in the default style, you can leave this line out, otherwise you can set the following options for “bgType”: 0 (Window), 1 (Dim) or 2 (Transparent).
    $gameMessage.setPositionType(posType);
    If you want the window position to be default, you can leave this line out, otherwise you can set the following options for “posType”: 0 (Top), 1 (Middle) or 2 (Bottom).
    $gameMessage.setSpeakerName(speakerName);
    For speakerName you can set “anynameyouwant” (again, here the “” or ‘’ are necessary). You can use all of the message commands (like \N[1]) here as well, but you need an extra \ to get it to work, for example: “$gameMessage.setSpeakerName('\\n[1]');”. If you don’t add this command, there is no speaker window on the message.
    $gameMessage.add(text);
    For the message, you can also use the commands with the extra “\” as for the speaker name, and you use one command for each line you want to display, e.g.:
    “$gameMessage.add("I am Reid! I am trying to type a very long");
    $gameMessage.add("message here.");”
    If you add more than 4 lines, the next ones will be displayed in a new window with the exact same settings.
    For example:
    “$gameMessage.setFaceImage("GoldenReid", 0);
    $gameMessage.setSpeakerName('\\n[1]');
    $gameMessage.add("I am \\n[1]! I am trying to type a very long");
    $gameMessage.add("message here.");
    $gameMessage.add("message here.");
    $gameMessage.add("message here.");
    $gameMessage.add("message here.");”
    will look like this:







    You could also use \n for a new line, the same as above would look like this:
    “$gameMessage.add("I am \\n[1]! I am trying to type a very long \nmessage here. \nmessage here. \nmessage here. \nmessage here. \nmessage here.");”
    But back to our dynamic face trick!
    In our previous try we used a variable to indicate which of the messages should be displayed, and we keep that idea: the Variable for the “skin” (in my example project it was the variable #4) is 0 by default, and each skin has a dedicated number between 1 and 7.



    Knowing that a faceset has 8 slots labeled from 0-7, we can replace the hard coded number from our face command with a variable.
    So instead of using
    $gameMessage.setFaceImage(“GoldenReid”, 0);
    we use:
    $gameMessage.setFaceImage(“GoldenReid”, $gameVariables.value(4));
    which uses the value of the variable with the ID 4 as index.
    This way we can set the variable to the slot we want to be displayed, so for the golden skin, we set it to 1, for the inverted to 2, for the greyscale to 3 and the others are not used at the moment, they would just display an empty frame. If we want to change back, we simply set it to 0 again. (This should happen along with the change of the character graphics)
    With this trick you can have 8 different skins/looks/versions properly displayed in messages without using a single conditional branch! Imagine how much work this saves!

    If you want to use multiple emotions it is best to have one sheet for each emotion and store the different skins in the same slots for each. This trick also works perfectly if your player can select their class/style/gender/whatever in the start! Hiddeone has a great tutorial about this here.

    Tip: With a spreadsheet or a text document with your “most used message options” you can streamline using the script calls and work as fast as you would do using messages.


    本贴来自国际rpgmaker官方论坛作者:Avery处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/alternate-skins.156929/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-16 19:00 , Processed in 0.064707 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表