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

[制作教程] Switch Primary Actor – An elegant way !

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 17:17 | 显示全部楼层 |阅读模式
    Switching Actors – An elegant way !


    This is a short tutorial for an elegant way to switch from one primary actor to another in games with multiple playable characters.

    Requirements: RPGMaker MV, basic mapping and eventing skills

    Aim:
    In this example, we have a game with three actors Adam, Bob and Cara (A,B & C). You start off as Adam. Whenever you meet Bob, you should be able to make Adam wait there and continue the game with playing character as Bob (Same for Cara).You should be able to change your character any number of times, even if you visit other maps in between changes.

    Spoiler: Check out this GIF ! B)

    Steps:

    We start with a simple test map.
    We need to Create two NPC Events called BODY1 and BODY2 to "hold" the two secondary actors. (Ignore sprites for time being)

    Spoiler: See Map

    Create the following Variables:
    WhoAmI   (the primary playing actor)
    BODY1_Actor   (actor inside BODY1 event)
    BODY2_Actor   (actor inside BODY2 event)









    Event BODY1
    Start with event BODY1. Open the event editor and create two new event pages


    Enter the following details      [IMPORTANT: FINE DETAILS]

    All Event pages
    Priority: Same as character         Trigger: Player touch

    Event page 1
    Conditions:   Variable: BODY1_Actor≥ 1      Image: Actor 1 (Adam)
                    Code:        
    ◆ Change Party Member:Add Adam ◆ Change Party Member:Remove Bob ◆ Change Party Member:Remove Cara  ◆ Control Variables:#0003 Body1_Actor = WhoAmI ◆ Control Variables:#0001 WhoAmI = 1


    Event page 2
    Conditions:   Variable: BODY1_Actor ≥ 2      Image: Actor 2 (Bob)
                    Code:        
    ◆ Change Party Member:Remove Adam ◆ Change Party Member:Add Bob ◆ Change Party Member:Remove Cara  ◆ Control Variables:#0003 Body1_Actor = WhoAmI ◆ Control Variables:#0001 WhoAmI = 2


    Event page 3
    Conditions:   Variable: BODY1_Actor ≥ 3      Image: Actor 3 (Cara)
                    Code:        
    ◆ Change Party Member:Remove Adam ◆ Change Party Member:Remove Bob ◆ Change Party Member:Add Cara   ◆ Control Variables:#0003 Body1_Actor = WhoAmI ◆ Control Variables:#0001 WhoAmI = 3

    Event BODY1 is now complete !

    Spoiler: Event pages detailed explanation
    Number of event pages depend on the total number of actors including player character. Each page decides what to do when the playing character wants to change into the actor that this event presently holds. The image on each event page shows what  BODY1 must look like depending on the actor it is supposed to be.

    The code consists of two parts (1) Change player character  (2) Change NPC event BODY1
    To change player character, we simply use the Change Party Member
    To change the NPC to look like player character, we simply alter BODY1_Actor variable.
    Finally change WhoAmI to keep track of who's the new player character

    Event BODY2
    Copy-paste event BODY1 to adjacent square and name it BODY2 in the event editor
    Edit each event page to change "BODY1_Actor" to "BODY2_Actor"
    SpoilerTotal six changes need to be made in our example, three in conditions and three in code



    Leave everything else alone.
    Event BODY2 is now complete !

    INITIALIZE VARIABLES AND START THE GAME
    I prefer to set initial settings in a separate map. Create a small map called INITIALIZE (No one will see this map)
    Set Starting Position --> Player  anywhere in this map
    Setup an event with trigger set to autorun (it will run once, you will never visit this map again)
    Enter the following code:
                    Code:        
    ◆Comment:----- INITIALIZE VARIABLES   ----- :       :WhoAmI is active player :       :Body1_Actor is initial appearance of Body 1 :       :Body2_Actor is initial appearance of Body 2 ◆Control Variables:#0001 WhoAmI = 1 ◆Control Variables:#0003 Body1_Actor = 2 ◆Control Variables:#0004 Body2_Actor = 3 ◆Change Party Member:Remove Cara ◆Change Party Member:Remove Bob ◆Transfer Player:TEST (5,4)


    Done ! Your game is ready to test !



    ADD SOME DRAMA !
    SpoilerAdd an animation before the player change. Make both of them turn away from each other afterwards.
    Example code for Event Page 1 of BODY1:
                    Code:        
      ◆Show Animation:Player, Ball of Light (Wait)     Change Party Member:Add Adam     Change Party Member:Remove Bob     Change Party Member:Remove Cara   ◆Set Movement Route:This Event (Wait)   :                  :◇Turn 180°   ◆Set Movement Route:Player (Wait)   :                  :◇Turn 180°     Control Variables:#0003 Body1_Actor = WhoAmI     Control Variables:#0001 WhoAmI = 1

    You have to edit every event page of both BODY1 and BODY 2as shown above




    OFFER A CHOICE WHETHER TO CHANGE PLAYER
    SpoilerPlace the entire code into a conditional statement to give the player a choice whether or not to change player character
    You have to edit every event page of both BODY1 and BODY 2




    EVENT PAGE SCREENSHOTS FOR BODY1
    Spoiler












    DIALOGUE OPTION
    SpoilerPlace the entire code into a conditional statement to give the player a choice whether to Talk to NPC or Change player
    Trigger a common event for dialogue
    Use conditional statements in the common event to carry out dialogue based on value of [WhoAmI] and [BODY1_Actor] or [BODY2_Actor]
    Also change Autonomous Movement to Random with low frequency to make NPCs move and give them more authenticity
    You have to edit every event page of both BODY1 and BODY 2






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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-10 02:06 , Processed in 0.110789 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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