RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Resolved] Auto-Enter Vehicle Issue

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 73
RMRK Junior
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?

« Last Edit: January 19, 2011, 01:06:46 AM by memberp »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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.

**
Rep: +0/-0Level 73
RMRK Junior
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).

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, not without a script like my Terrain Tags one as far as I know.

**
Rep: +0/-0Level 73
RMRK Junior
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).

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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

Code: [Select]
#==============================================================================
# ** 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
« Last Edit: January 14, 2011, 06:00:22 PM by modern algebra »

**
Rep: +0/-0Level 73
RMRK Junior
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!
« Last Edit: January 19, 2011, 01:06:30 AM by memberp »