Two issues here.
1. I am having an issue where the airship is moving off the side of the world map even though I don't have the map set to loop.
2. While in the airship the player character isn't triggering the teleport event to move to another map.
I recall there being a plugin, maybe one of Yanfly's, that can limit or restrict vehical movement and where you can launch/land while in a ship but I can't seem to find it. Does anyone have any idea where I might find it? And... what is up with zoning to other maps while in an airship?
Need a plugin to control where vehicals can move/land
● ARCHIVED · READ-ONLY
-
-
You seem to be asking about several things here. The script you're requesting would not help with either of the issues you've identified.
When you say "moving off the side of the map" do you mean it's actually going off the screen? Or is your map smaller than the game window? This is probably better suited to its own topic in MV Support, though there's a possibility it could be caused by an incorrectly set up plugin as well.
Events don't trigger when you're in the airship - you're not intended to change maps when using that vehicle. You'll need a plugin that will let you identify events that SHOULD trigger.
I haven't tested this, but give it a go and see if it helps. Add <airship> as a note to any event you want to trigger while in the airship.
Code:Game_Player.prototype.startMapEvent = function(x, y, triggers, normal) { if (!$gameMap.isEventRunning()) { $gameMap.eventsXy(x, y).forEach(function(event) { if (event.isTriggerIn(triggers) && event.isNormalPriority() === normal) { if (!event.meta.airship || !$gamePlayer.isInAirship()) { event.start(); } } }); } }; Game_Player.prototype.canStartLocalEvents = function() { return true; };
If it gives you an error about meta not being defined, change this:
Code:if (!event.meta.airship || !$gamePlayer.isInAirship()) {
to this:
Code:if (!event.event().meta.airship || !$gamePlayer.isInAirship()) {
Note - there is a program bug that messes up the BGM when you change maps while in the boat vehicle(s). If the new map has BGM set, it will play that BGM instead of the vehicle BGM when you transfer. And if you exit the vehicle while on that map, it will resume the BGM from the original map where you entered the vehicle. You will have the same issue with the airship. -
"When you say "moving off the side of the map" do you mean it's actually going off the screen? Or is your map smaller than the game window?"
The map is larger than the game window. The airship just disappears off the screen and seems to keep record of how far it goes, for example... If I move 10 tiles off the map in any given direction then I need to move 10 tiles back in the opposite direction for the airship to reappear.
"Note - there is a program bug that messes up the BGM when you change maps while in the boat vehicle(s). If the new map has BGM set, it will play that BGM instead of the vehicle BGM when you transfer. And if you exit the vehicle while on that map, it will resume the BGM from the original map where you entered the vehicle. You will have the same issue with the airship."
Okay, so it seems as if you are not really meant to move from map to map while in the vehicals.. that seems very limiting.
Edit: I tested the airship on a new game with no plugins and it does not move off map, so I will trouble shoot and find out which plugin is doing this.
I tried the plugin you posted above and it gave me the undefined error, when I changed the script as you described it doesn't seem to work, or rather it works like it did before the plugin was added, the airship simply moves through the teleport event and off the map.
Wait, just tried moving from map to map WITHOUT the note tag <airship> on the event and it works. So I think this will work if I can figure out which plugin is letting me move off the map. As far as background music goes its alright as long as the BGM on the new map is the same as the previous one. But... other events will be accessible while in the airship I imagine. Events I may not want to trigger, so I think the notetag is essential. >.< -
airships are defined as being above impassable tiles, IIRC.
check the passability, which should also affect events being triggered. -
okay - I had the conditions wrong there. I was a bit confused about that.
Please use this line instead - it says if the player is NOT in the airship, or if the event is meant to interact with the airship, then trigger the event:
Code:if (event.event().meta.airship || !$gamePlayer.isInAirship()) {
Then add the <airship> tag back to the event.
If you leave it the way it is, all events will trigger when in the airship, and that's not what you want.
And yes, I was thinking you have some kind of plugin that's causing the airship going off map issue. Does it also happen if you're NOT in the airship? I wonder if there's some resolution plugin you've used that changes the resolution or window size, but it's not quite configured correctly. -
Well, it was the Yep_x_VehicalRestrictions.js plugin that was causing the airship to continue off the map, I guess I just need to set up the default parameters for that plugin. I DO need a plugin though, like the one Shaz shared above, to allow the airship to zone from map to map using teleport events.
After testing the plugin Shaz shared it seems as though it works but in a reverse fashion, the events WITH the notetag <airship> does NOT allow movement while events without it do allow movement. If there is someway to fix how this works I should be alright, everything would work fine.
t
Edit: To clarify, the current script for the plugin you shared only works with the fix you listed, without the fix i get an undefined error and with it only the events WITHOUT the notetags teleport the airhship while events with the notetag <airship> do nothing. Is there a way to make it work as intended so that events with the notetags allow teleporting? -
no - see my post above. I got the condition wrong.
You need to put the tag back, but change the line of code. -
Cool, it works. Thanks again!