Map Skill: Remotely Move any out of reach objects in front of you MV/MZ

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
398
Reaction score
1,115
First Language
english
Primarily Uses
RMMV
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.

1643265424246.png




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.

1643273234022.png
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

1643265633248.png

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.
1643268093950.png

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.

1643268363518.png

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.

1643268662026.png

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!'

1643268963483.png

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

1643271223330.png

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.

1643271384552.png

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!

MZtest.gif

 
Last edited:

desertbriar

Villager
Member
Joined
Jan 30, 2018
Messages
28
Reaction score
22
First Language
English
Primarily Uses
RMMV
Sweet, the Golden Sun field skills are fun to use! This would be great for puzzles
 
Last edited:

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,471
Reaction score
2,160
First Language
Dutch
Primarily Uses
RMMV
I wonder if the scriptcalls works for MV too, but nicely done =)
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,471
Reaction score
2,160
First Language
Dutch
Primarily Uses
RMMV
I love golden sun too, specially the elemental bacons and the puzzles inside.
and the adventure in it, I beat all 3 games, you can make alot of nice ways
using this alone and I have a few things in mind to combine them nicely :)
 

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
398
Reaction score
1,115
First Language
english
Primarily Uses
RMMV
I can relate to that! I was introduced to the 1st and 2nd golden sun games only some years ago by a friend and it had one of the best puzzle systems I played in a game! It's been one of my favorites ever since. Even as I played it, I realized it was something that can be done in RPGMaker without modifying the base too much and after tinkering around here was the end result.
 

Latest Threads

Latest Profile Posts

grief... finding a font that works with the engine has been a bigger process than I thought it'd be. doesn't help MV loves to scrunch letters next to each other like a football huddle.
The new Phoenix plugin. I drew icons and an interface into it
R3-M1 can now leave footprints :kaojoy: Thanks Dsiver144 for another amazing plugin!!

1653686110642.png

Hey guys, do you wanna see who dominated the competition in our last game jam?! Stop by while we play Pinky by @Wumbohek Starting at 4:20pm EST.

Forum statistics

Threads
122,178
Messages
1,147,042
Members
160,438
Latest member
zodismegalame
Top