VE - Custom Vehicles Addon - Menu Access and Save Access Enable and Disable

Good Morning / Day / Afternoon / Evening everyone.

I have a request for a certain kind of addon.


VE's custom vehicles script has a buttload of options, but I would like to add 2 more features

1. The ability to disable the main menu and the save option while the player is riding the custom vehicle.

Is this possible to achieve?

I will appreciate any help I can get.
In the beginning of the script, above the line VE_VEHICLE_SETTING = {, put

Code:
VE_VEHICLE_DISABLE_MENU = true,
  VE_VEHICLE_DISABLE_SAVE = true,

Then find the get_on_vehicle and get_off_vehicle methods in Game_Player: change the line "enter_vehicle if vehicle" to

Code:
if vehicle
      enter_vehicle
      $game_system.menu_disabled = true if VE_VEHICLE_DISABLE_MENU
      $game_system.save_disabled = true if VE_VEHICLE_DISABLE_SAVE
    end

and underneath "make_encounter_count" in get_off_vehicle to

Code:
$game_system.menu_disabled = false if VE_VEHICLE_DISABLE_MENU
      $game_system.save_disabled = false if VE_VEHICLE_DISABLE_SAVE
Maybe I did not set this up correctly.

Z31.png


Z32.png


It did not work, still was able to save and access the menu while on the vehicle.

EDIT:

zaaaaaaaaaaaaaaaa.png


It seems to be having a compatibility problem with this particular code I wrote for the "default vehicles"

is there a way around this?
Oh, if you want different settings for different vehicles my code will need changed.

If you've already done that (how good an idea it is to put this stuff in the update method is a conversation for another time) then just add your custom vehicle symbols to the update overwrite.
I really appreciate all of the effort. But please if it is too much please let me know and I'll try to find a way around all this. I kind of wish I was a little better at coding so I wouldn't be asking for so much help.

I assumed that since the code I wrote only applied to the default three vehicles, that the new custom ones wouldn't be affected by this.

Guess I was wrong.

EDIT
zzzz9888.png


I DID try this, since the key name of the custom vehicle was horse

I tried to add horse, and so far it seems to work perfectly!
That "else" will cover every single other scenario where you're not in one of the vehicles you've specified in previous if statements.

btw, you don't need to make vehicle_type an attr_accessor because you're not trying to do anything to it outside of Game_Player.

Original thread: https://forums.rpgmakerweb.com/threads/ve-custom-vehicles-addon-menu-access-and-save-access-enable-and-disable.124531/