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,843
Reaction score
405
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,342
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,342
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

I have a specialized class on intellectual property this semester (on Patent and Trademarks, Copyrights is next semester). Only had a quick overview of that in previous business law classes. I'll be able to help more people here when it comes to knowing what to do and your rights for intellectual property!
When you wanna write another pedantic post of your views on game dev... but your cousin and aunt have invited you to bowling
"Hey there! Hope you're having a nice day, you are awesome!"

(Of course the hand is awful :kaoswt: )
I need a new option on YouTube that goes "Dont recommend videos/channels in this language because I do not speak it"
I've reconsidered having a subclass system for my first two games since there will already be plenty of variation in playable actors and usable items in the games. The third game will need it because of the basis for the story but I want the actors in the first two to be more focused in their roles.

Forum statistics

Threads
93,372
Messages
911,783
Members
122,874
Latest member
Meektot
Top