Disable Menu while on a vehicle, Enable back when off the vehicle.

Panda_Artist

Humble RPG Fan
Veteran
Joined
Dec 22, 2018
Messages
223
Reaction score
15
First Language
Portuguese
Primarily Uses
RMVXA
Good Morning / Day / Afternoon / Evening everyone.

I have a request for a bit of support regarding a script:

How difficult it would be to code a script that completely blocks Menu access while on any vehicle?

I will appreciate a reply.

I DID try doing it on my own, while this here worked, it also ignored my command via a event to disable the menu when I wanted it to... and that's a bummer!

Ruby:
class Game_Player < Game_Character
  attr_accessor :vehicle_type
  attr_accessor :save_disabled
  attr_accessor :menu_disabled
 
  alias r2_save_disabled_on_vehicle   update
  def update
    r2_save_disabled_on_vehicle
    if @vehicle_type == :boat
      $game_system.save_disabled = false
      $game_system.menu_disabled = true
    elsif @vehicle_type == :ship
      $game_system.save_disabled = false
      $game_system.menu_disabled = true
    elsif @vehicle_type == :airship
      $game_system.save_disabled = false
      $game_system.menu_disabled = true
    else
      $game_system.save_disabled = false
      $game_system.menu_disabled = false
    end
  end
end
I really could use some help here. Thank you.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,643
Reaction score
561
First Language
English
Primarily Uses
RMVXA
Sorry, limited train of thought there.
This should be working for you
Ruby:
class Game_Player < Game_Character

  alias r2_save_disabled_on_vehicle   update
  def update
    r2_save_disabled_on_vehicle
    if @vehicle_type == :boat
      $game_system.save_disabled = false
      $game_system.menu_disabled = true
    elsif @vehicle_type == :ship
      $game_system.save_disabled = false
      $game_system.menu_disabled = true
    elsif @vehicle_type == :airship
      $game_system.save_disabled = false
      $game_system.menu_disabled = true
    end
  end

  alias r2_vehicle_off_menu_access  update_vehicle_get_off
  def update_vehicle_get_off
    r2_vehicle_off_menu_access
    $game_system.save_disabled = false
    $game_system.menu_disabled = false
  end
end
 

Panda_Artist

Humble RPG Fan
Veteran
Joined
Dec 22, 2018
Messages
223
Reaction score
15
First Language
Portuguese
Primarily Uses
RMVXA
I tried it and it seems to have fixed the issue I was having.

Thank you SO much and if I find any problems i'll gladly let you know.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Finished that egg-sitting mini-game I mentioned here a couple weeks back. Now to fix the weather system so it doesn't rain indoors while you're playing it. >.> A simple fix in itself; leave it to me to take it as an excuse to completely revamp the time/weather/lighting system from scratch.
I'm really tempting to pre order cyberpunk 2077... should I do it or not :/ I really want to play the game but don't want to take a big hit to my saving because of it
So I need to come up with quite a few action sequences.
Was stressing about this plugin earlier, but pretty happy with how its looking now! Purple makes it pop more too!! :)

Forum statistics

Threads
105,485
Messages
1,014,073
Members
137,131
Latest member
Ssven10k
Top