StandardFiend

Villager
Member
Joined
Jan 3, 2015
Messages
19
Reaction score
13
First Language
English
Primarily Uses
Greetings, folks! I have here for you a nice guide on how to allow your player to enter the interior of his airship once embarked upon it, a la Final Fantasy VII, in order to chat with party members, chill in the pool, or hit up the casino. (Please be aware that gambling may be illegal in your state and I take no responsibility if you get busted.)


First things first, credit where credit is due!


This tutorial is an extension of the one provided by YouTube user Driftwood Gaming in this video. He ran into a very important problem: the player had to drive the airship over an area on which the ship could land in order to activate the scene. My method eliminates this problem while still operating on the core principle. I will start from square one (tile one?) but please feel free to also watch his video, because it is good.


Second things second, what you will need!


The following two plugins are used in this tutorial:


Yanfly's Button Common Events


Galv's MV Vehicle On/Off Locations


The authors of these scripts have generously allowed them to be used free of charge for both commercial and non-commercial projects, so show them all due respect and credit them!


Yanfly's Button Common Events will allow the player to enter the airship interior by pressing a keyboard key designated by you in your project.


Galv's Vehicle On/Off Locations will allow you to specify Region IDs on which the airship can land/be boarded. This will be important later.


Okay, on to the guide!


Step One


The very very first thing you will need to do is make a map representing your airship interior. And, obviously, have a regular world map on which the player can interact with the airship.


Then, the very first thing you will need to do is construct a Common Event that, when called, will transfer the player to the airship interior.

[IMG]http://i16.photobucket.com/albums/b5/asaffin/TransferEventWhole.png[/IMG]



Okay, so let's break this down.


The Common Event opens with a Conditional Branch, and everything happens inside the If brackets. The condition is a script call. If you're not into coding at all, it probably looks kinda scary, but it's really very simple: all it does is check to see if the player is currently aboard the airship. If the player is not aboard the airship, nothing happens. This is a script built into the game itself (i.e., it didn't come from the two plugins you downloaded for this). Just copy and paste: ($gamePlayer.isInAirship() === true)


The first item inside the conditional branch is a command to fade the screen to black. This is important because the game is going to do some funky stuff that you definitely do not want the player to see; however, I highly recommend you leave this out until the very end of your event programming, so that you, as the programmer, can see all that funky stuff. It helps with troubleshooting.


Next our event needs to capture a few values and store them as variables. These values are which map the player is on and where on that map he is when the event is called. Note that the variables are being set to the Player's location, but they are being labelled as the airship's location. This is an important distinction. When the player is on board the airship, the airship's location is the same as the player's location. We will need to capture the player's location again later, but independent of the airship's location, so it's important to give the airship its own set of variables.


After that is the actual movement of the player. Simply use the Transfer Player command and designate the location in your airship interior map. A neat interaction is that when you use the Transfer Player command while the player is embarked upon a vehicle, the vehicle comes with him and the player remains inside.


So, now the player is on his airship... inside his airship. This is where Galv's script comes in. In the Plugin Parameters for Galv's Vehicle On/Off locations, specify a region on which your airship can land. You can specify as many regions as you want, but keep in mind this WILL necessitate planting one of these regions on any tile on which you want the player to be able to land throughout your whole game, as this plugin overrides the defaults. So, once you've got your landing regions specified, go into your airship interior map and paint that region onto the tile that you've transferred the player to with your Common Event. Or just paint the whole map, which will save you a step later.


Now that the airship is able to land inside the airship (shipception?), add the Get On/Off Vehicle command to our common event.


Now, you just need to make the airship go away. I chose to do this by setting its location back to the world map where we left it. Simple and clean and easy to keep track of, although it won't be staying there for long.


Next, and this is important, implement a 60-frame Wait. For whatever reason, MV needs you to have these Wait commands every now and then in order to let it "catch up" to what you've been doing. I ran into some weird and interesting glitches when I didn't have them.


Finally, go into the Plugin Parameters for Yanfly's plugin, find the key you want to bind to the transfer event, and specify the ID of the Common Event for that key. Now you can test your event. What should happen is, after embarking on your airship and pressing the designated key, the player should be teleported to the airship interior, disembark the airship, and then the airship will disappear. All of this will happen behind the scenes once you add the FadeOut Screen command, and it will look like a seamless transition.


Step Two


Now that the player is inside the airship, it would be sweet if he could leave and continue playing the game. There are two events inside the airship interior map that we will make, and the second will handle that task.


The first is just a very simple event that will fade the screen back in after all the teleportation nonsense has happened, so that when the player presses the All Aboard key, the next thing he sees is the Player standing inside the airship. Simple and clean.

[IMG]http://i16.photobucket.com/albums/b5/asaffin/FadeInEvent.png[/IMG]



Note that this event is placed somewhere in your airship interior map; it is not a Common Event.


Autorun, FadeIn Screen, Erase Event. Super simple.


The second event is a little more complicated. We are going to create an object on the airship that, when interacted with, will allow the player to return to the world map. It can be a steering wheel, or a dude, or anything. In my case, it's a random sword:

[IMG]http://i16.photobucket.com/albums/b5/asaffin/LeaveAirship.png[/IMG]



The first bit is optional; just a choice to allow the player to leave or stay. Probably a good idea in your final product to mediate unintentional actions caused by errant pointers.


The real meat is located inside the Yes brackets. Of course, there is the FadeOut command, but again I recommend not inserting this until you finish this event sequence and test it thoroughly.


Once again we need to capture the Player's location data, except this time we'll be writing it to a new set of variables for the player and not the variables for the airship. This step is necessary if the event is accessible from multiple tiles (i.e., an event the player can walk around and talk to from any direction). If the object is only accessible from a single direction, or is a Below Player object and is stepped on to activate, then these variables are not necessary and you can skip this step.


Next, use the Region editor to paint your airship landing region on any tiles from which the player can access the event. Make sure that the player CANNOT access the event from any tile that is not designated as landable with a Region. This is why, if there is nothing else preventing it, you can go ahead and paint the whole floor with the Region ID. It's fairly foolproof.


The next line transfers the airship to right on top of the player, which is followed by a short Wait command. I don't know enough about the engine to tell you exactly when and where the Wait commands are necessary to make this event processing work properly, but putting one here solved the problems I was having.


Once the wait is over, the player embarks on the airship with the Get On/Off Vehicle command, followed by one final Wait. Just as I don't know the specific timings of the Wait commands for optimal effect, I don't know exactly how long they need to be to function. I picked a half second for the last one and one second for this one, and it works for these purposes. Experiment with it if you have time, you might discover something.


Then, at last, the player, inside the airship, is transferred back to the original location on the world map.


Once you've tested the event and made sure it works properly, you can add in the FadeOut/In Screen commands to bookend the process.


And that about does it! It took a while to explain, but it's fairly quick and easy to do, and can apply to a much larger variety of situations than just an airship interior. You could add a bunch of Else branches to the Common Event so the hotkey can take you any number of places, depending on where you are. Best of all, it requires no scripting knowledge, which is great for us simple folk.


I strongly urge you to follow the steps and do this yourself from scratch, because you'll learn and understand it very well if you do, but below is a link to a demo containing the end result of this tutorial, which you are more than welcome to copy and paste if you wish.


And, let me know if you encounter any issues. My prime problem was a glitch that occurred on transferring back to the world map, in which the player would be riding an invisible airship that functioned normally, although upon landing was gone forever. Implementing the various Wait commands solved this problem, but you might find a way to have it happen to you anyway.


Airship Scene Test Demo (Drop Box)


Toodles!
 
Last edited by a moderator:

darico06

Villager
Member
Joined
Apr 24, 2016
Messages
7
Reaction score
1
First Language
English
Primarily Uses
I was wondering about doing something like this. Good to know how to do it! Many thanks!
 

catclaw888

Villager
Member
Joined
Oct 14, 2016
Messages
26
Reaction score
6
First Language
English
Primarily Uses
holy crap that's a lot of reading...I'll work on this tomorrow morning after I test everything else.
 

Latest Threads

Latest Posts

Latest Profile Posts

whats the easiest way to add an on-map command in RPG Maker? like when you press a button the character just jumps or runs when its held? should i get an ABS plugin and customize?
Thinking of doing a crowdfunding kind of thing on my ko-fi page, but i don't have an audience :kaoswt2: and i don't want to go to the big crowdfinding sites cause i can't guarantee that i'll complete the project. It's just for fun but i still need some more tools. Anyone else in the same boat? :kaodes:
Pretty proud of this train station i'm making!
unknown.png
Steam has announced a new feature to let people switch between playing on PC and on Steam Deck with the same save. I'll come back to add support for it to my steam plugins when the time comes.
Hang on, let me get my glasses...
giphy.gif

Forum statistics

Threads
118,695
Messages
1,117,977
Members
155,822
Latest member
beastyquell
Top