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

Panda_Artist

Humble RPG Fan
Veteran
Joined
Dec 22, 2018
Messages
239
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,655
Reaction score
562
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
239
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 Posts

Latest Profile Posts

Yet another gaming question, i'm currently playing Last of Us 2 and want to get another game to play next but can't decide between Ghost of Tsushima, Miles Morales & Jedi Fallen Order. After the latest mandalorian i AM on a star wars kick, but i also LOVED the last spiderman game that prequels Miles Morales. Ghost of Tsushima is the bottom of my list but i heard it was AWESOME. Just want a good story & fun gameplay.
I checked out Genshin Impact gameplay out of curiosity. I can't believe it's available as a mobile game too. Smooth animation, great music, and stellar sound effects (the ambient sounds are pretty detailed).

I'm flabbergasted to see games have becoming more and more advanced. Maybe also because I'm oblivious to current trend for a long time, it almost feel like I'm being sent into distant future. xD
xDRAGOONx wrote on WaywardMartian's profile.
Your artwork is amazing!!!
:ewat:
Stream will be live shortly with a session of the Interactive Text Adventure! Feel free to drop by!
I should finish the cat video I'm editing and finish the indesign stuff. So far only 1 is done and 4 to go

Forum statistics

Threads
105,664
Messages
1,015,372
Members
137,340
Latest member
grizel
Top