In my game I want to auto-enter the Airship immediately once I've teleported to the world map.
Using some variables I've set up a parallel process event on my world map which sets my airship location to be the same as my player's location. My problem is that as soon as I arrive on the world map the process keeps repeating itself and my player keeps entering/leaving the airship instead of just entering it. What did I miss?
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg708.imageshack.us%2Fimg708%2F1750%2F77351095.png&hash=e9739450722806886d0877d6d3ccf7fb659e3e3a)
Remember that Parallel Process events will normally always repeat whatever they're doing every frame - if you only want it to be done once each time you enter the map, you need to put an Erase Event command. If you only want it to be once ever, then you need to use a switch and turn it to a new page.
So, here, you need to put an Erase Event command at the end of this event.
Ah, that did the trick, many thanks!
One question though, although it's not very important: any way I can make my airship 'unlandeable' other than making the terrain unpassable? (I'm intending to only land on/enter events, but not landing randomly to walk around).
Well, not without a script like my Terrain Tags one as far as I know.
Ah thanks for the tip, I've downloaded your demo. Looking into it though, this looks like a fairly big amount of work to setup. Isn't there an easier way to prohibit the airship from landing, period? Like for example just denying landing in the basic vehicle script? (Just throwing out an idea, don't know if it's actually possible).
Yeah, it would be pretty easy. I don't know of any scripts in particular that do just that though. All that would need to be done is change the airship_can_land? method of Game_Map. It wouldn't be a difficult to script - probably take a minute or two. How do you want to limit it anyway? Just a check as to whether an event on the square has a comment in the first line saying airport or something?
EDIT::
Here, I wrote something up quick. It's pretty easy to use - basically, for any event that you want to be an airport, you make it so that the very first line on the event page is a comment that has the word Airport in it. Of course, you can have whatever else you want in the event as well. The script will allow you to land only on those events and only if there is no non-airport event also on the square. Just paste it below Materials and above Main in the Script Editor
#==============================================================================
# ** Game_Player
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# overwritten method - airship_land_ok?
#==============================================================================
class Game_Player
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Determine if airship can land
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def airship_land_ok? (x, y)
# Airship can land only on events marked airport and only if there are no
# non-airport events on the square
events = $game_map.events_xy (x, y)
return false if events.empty?
for event in $game_map.events_xy (x, y)
return false unless event.airport?
end
return true
end
end
#==============================================================================
# ** Game_Event
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new method - airport?
#==============================================================================
class Game_Event
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Determine if an airport event
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def airport?
if @list
# Get first comment
comment, i = "", 0
while @list[i].code == 108 || @list[i].code == 408
comment += @list[i].parameters[0]
i += 1
end
return true if comment[/AIRPORT/i] != nil
end
return false
end
end
Ah brilliant stuff, thanks a lot!
That's pretty much what I wanted. One last thing though, let me explain:
My worldmap has several airports, when I hover above them I have a picture pop up that says "Press ... to land/enter city". I intend to have pressing a certain button result in landing and then transfering my player to another map immediately. It's an event that's triggered by event touch (I have a script to make Airship/Event interaction possible).
Only thing is it doesn't really work. If I make the Airship land & transfer automatically upon event/player touch it works perfectly, but when I want to make it happen by branch condition (say by button press) it just doesn't do anything.
Another option was to just land on the airport and use an event that works on player touch to transfer me automatically as soon as my player lands, but that doesn't work "automatically" either, meaning I have to touch it "manually" before it works.
Sorry for the trouble, but it's essential I make this work properly. Thanks!
Edit: Nevermind, I found a solution! Thanks for the support!