Forced Save Restriction when on ALL VEHICLES

Panda_Artist

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

This request is a bit different...!

I was wondering if it is possible to make a snippet that completely blocks you from saving (UPDATE: NOT JUST SAVE BUT ALSO BLOCK MENU ACCESS) when riding a vehicle. Before you say it: I did try doing this with a common event, HOWEVER, when doing it for every vehicle at once it causes a problem where one event works but the other two DO NOT work.

Is there a way around this?? I even tried restricting the menu for every vehicle with condition branches but it didnt work, it worked on one vehicle but it always overrides the other two.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
1,853
Reaction score
408
First Language
English
Primarily Uses
RMVXA
This works for the build in menu access. But it does not block a manual call to the save screen. (tab 3 - Scene Control - Open Save Screen)
Code:
class Game_Player < Game_Character
  attr_accessor :vehicle_type
  attr_accessor :save_disabled
  alias r2_save_disabled_on_vehicle   update
  def update
    r2_save_disabled_on_vehicle
    if @vehicle_type == :boat
      $game_system.save_disabled = true
    elsif @vehicle_type == :ship
      $game_system.save_disabled = true
    elsif @vehicle_type == :airship
      $game_system.save_disabled = true
    else
      $game_system.save_disabled = false
    end
  end
end
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,343
Reaction score
564
First Language
Italian
Primarily Uses
RMVXA
it worked on one vehicle but it always overrides the other two.
This is probably because you did not set your event properly. However, there is no need for you to create multiple conditional branches if all of them have to run the same code. Just put everything in a single condition.
Code:
$game_system.menu_disabled = !($game_player.normal_walk?) # This blocks menu access
$game_system.save_disabled = !($game_player.normal_walk?) # This blocks saves
If you want to do it with a script I recommend doing it like this:
Code:
class Game_Player < Game_Character
  alias hrk_get_on_off_vehicle_old get_on_off_vehicle
  def get_on_off_vehicle
    $game_system.menu_disabled = $game_player.normal_walk? # remove if you want
    $game_system.save_disabled = $game_player.normal_walk? # remove if you want
    hrk_get_on_off_vehicle_old
  end # Get On/Off Vehicle
end # end of Game_Player class
The obvious advantage of doing it this way is that you only change the value when getting on/off vehicle, without having your event update it every frame. You can remove one of the two lines (the one you don't need).
 
Last edited:

Panda_Artist

Humble RPG Fan
Veteran
Joined
Dec 22, 2018
Messages
59
Reaction score
4
First Language
Portuguese
Primarily Uses
RMVXA
You have all saved my life. In all honesty, due to my inexperience with scripting, I have been giving up then coming back to the project. But thanks to you all I feel more inspired than ever. I have really been serious about developing an RPG, and now I believe that with the help of everyone here I can achieve this. Thank you so much. You will defeinitely be credited for your efforts.
 

Panda_Artist

Humble RPG Fan
Veteran
Joined
Dec 22, 2018
Messages
59
Reaction score
4
First Language
Portuguese
Primarily Uses
RMVXA
This is exactly what I had in mind.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,343
Reaction score
564
First Language
Italian
Primarily Uses
RMVXA
it does not block opening the save screen.
That much is true, but it only updates that value when you get on/off the vehicle rather than updating it every frame. After all, the manual save is something that the developer adds into the game, it is not something the player can do on its own. Just in case, if the OP wants to be extra sure that something like that does not happen, adding this should do the trick:
Code:
class Game_Interpreter
  alias hrk_open_save_screen_old command_352
  def command_352
    return unless $game_player.normal_walk?
    hrk_open_save_screen_old
  end # Open Save Screen
end # end of Game_Interpreter class
 

Panda_Artist

Humble RPG Fan
Veteran
Joined
Dec 22, 2018
Messages
59
Reaction score
4
First Language
Portuguese
Primarily Uses
RMVXA
I tested it with the old version, IN the vehicle to call the menu and saved and got no problems. Nevertheless. Great Job!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Kes wrote on Chef's profile.
I have deleted your profile post as our Rules are quite clear that you may not use them to advertise non-RM products, nor may you give a link to anything that solicits payment for you.
140 Thousand words, take one down, toss it around, discover I hate the direction I went and decide to start a complete rewrite.
I like being a butt to people.
Dirtnap wrote on Tyler Warren's profile.
Hi Tyler,

My name is Sean, I am the owner of an indie studio, and I am looking to get some paid art work done. I am working with MV, but our programmer will be heavily modifying it.

If you are interested, or would like to hear more, I can provide my personal e-mail address.

S.G.
The stream will be live shortly with some more Witcher 3! Feel free to drop by~

Forum statistics

Threads
93,601
Messages
913,831
Members
123,149
Latest member
BwadeZ
Top