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

[制作教程] Map Skill: Remotely Move any out of reach objects in front of you MV/MZ

[复制链接]
累计送礼:
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 15:33:05 | 显示全部楼层 |阅读模式

    In this tutorial, we will be setting up a Remote Move map skill that will move 1 object in a range of up to 2 tiles in front of the player, example a hole in front of the player followed by the item you want to move.

    We will be using some basic scripting along with 1 Common Event, 1 Variable and 1 Switch.

    Feel free to give me feedback or suggestions if you see anything that can be improved upon!




    Do you have a moveable boulder sitting right on the ledge that you want to jump to?
    Wouldn't it be great if you could move that boulder away with some magic or a skill right at that moment?
    Have you ever wanted to replicate the Move field map skill from Golden Sun?

    You came to the right place, here I will show you my method of achieving something similar.
    There are other ways to do it but this is what I'm using.








    First off, lets set up our Common Event. This will be where we check if there is a Event within 2 tiles in the direction our player is facing. We will be using Variable 1 to store our information.

    We'll start by adding a Conditional Branch checking if there is an event in front of the player when they are facing Down.




    Script Breakdown:
    We set Variable 1 with the script call: $gameVariables.setValue(1, A)​
    "A" is the number that will be stored in Variable 1.​

    We want A to be the ID of the Event in reach, so we will be using the script call: $gameMap.eventIdXy(x,y)​
    (x,y) is the coordinates to check for an Event, since we want to check if there is an Event in the coordinates directly in front of the player who is facing Down (player's y+1), we will fill in x and y with $gamePlayer.x and $gamePlayer.y+1​



    Now we have our first set of Data for Variable 1

    But wait, we want to have a range of up to 2 tiles in front, this only checks for 1 tile in front.
    That's right, so here we will add in a If statement to extend the range.

    If there is nothing in the 1st tile in front, Variable 1 will be 0 (because nothing is there). So now, if Variable 1 = 0, it will check if there is something in the 2nd tile. Inside the If statement, we will repeat what we done for the first tile but with +2 instead of +1 for the y coordinate





                    JavaScript:        
    $gameVariables.setValue(1, $gameMap.eventIdXy($gamePlayer.x, $gamePlayer.y+1)); if ($gameVariables.value(1)==0) {$gameVariables.setValue (1, $gameMap.eventIdXy($gamePlayer.x, $gamePlayer.y+2)); };


    Now we have finished the calculation for one direction. Repeat the steps with the proper edits to $gamePlayer.x and .y for the Else parts of our Conditional branch, keep going until you have all 4 directions done.




    Once you are done, add a Switch turned ON at the end of the page, this will be for our Autorun Move event on the map when the player uses the skill.





    Add this Common Event as an Effect to a Skill. We will name it Remote Move for this purpose.



    Now that we are done with setting up. We will be making the Autorun event that moves the objects around on the map.
    Make sure that your Event only will run when your Switch is ON, otherwise it will run forever!

    We will start by making a Conditional branch that tells us there is nothing in range to move. When Variable 1 = 0, it will show a text or a sound up to you!
    Remember to add a Turn OFF Switch at the end of the page as well to stop the Autorun event.





    With that all out of the way, lets go into the part where our skill did find 1 Event in range.
    In this part, we want to make sure only SOME of the events are moveable.
    We don't want everything to be moved. In this case, we only want Events with ID 4, 5 and 6 to be movable with this skill.

    So now, we will make a list that has the numbers we want. We will use this in a Script for a Conditional branch:
    [4, 5, 6].includes($gameVariables.value(1))

    The numbers inside [] are the Event IDs of events that we can move.
    By using .include, we are checking if this set includes a number that equals the number in our Variable 1

    So what about the Events that we don't want to move? This is where we include a Else branch for anything else not listed in our set.
    In our case events 1, 2, 3 and any others will give us a text that tells us 'we can't move this!'





    We are reaching the final step here. It is now time to add in our Move routes.
    Before we start moving anything, we want to make sure the player has a signal and time to press a direction button so we will add some animation and wait frames here





    Next, we will create a Conditional branch that checks if a direction button is pressed.
    In our example we will use Button Down is now pressed, here we will use a script call for our Move route because we want the the specific Event in front of us to be moved by one tile:
    $gameMap.event(x).moveStraight(y);

    In our case we want our x / Event ID to be the same as the ID in our Variable 1, so we will use $gameVariables.value(1)
    We also want the object to move down because the down button is pressed, so we will replace y with 2. The numbers for directions are as follows:
    Up = 8, Down = 2, Left = 4, Right = 6

    You'll get a script call like this at the end.
    $gameMap.event($gameVariables.value(1)).moveStraight(2);

    Add a Wait at the end for the player, so they won't suddenly run in the direction of their button push after the object moves. Repeat this step for all the directional buttons.





    You have finally reached the end! Make sure to add the Common Event you worked on to a skill and test it out on your map. There are many ways to make this look smoother, with animations and screen shakes or better timing but this is the basic skeleton for it. Now your player can move far away objects around with their brains! More ways to puzzle solve!









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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-16 19:05 , Processed in 0.116729 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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