Resident Evil style limited save system help

So I'm having a problem with the save system of my game
I'm making a horror game with a limited save system, very similar to resident evil. In my game, you need a cassette tape to save the game at a save station.
When the player goes to the save station, they use up the tape saving the game.
The problem I'm having is that regardless of if the player saves the game or not the tape gets used up, which isn't ideal.
I tried using the "Save count" variable but that isn't working either.
I tried looking for a script that detects if the player saved the game but no luck there either.
I wanna know if there's any way to detect if the player saved their game so that then I can have the event determine weather or not to remove a tape from the players inventory.
Thank you for your time.
you can try this :

JavaScript:
const _Scene_Save_onSaveSuccess = Scene_Save.prototype.onSaveSuccess;
Scene_Save.prototype.onSaveSuccess = function() {
    _Scene_Save_onSaveSuccess.call(this);
    console.log('Save operation completed successfully.');
// implement decrease item here
};
you can try this :

JavaScript:
const _Scene_Save_onSaveSuccess = Scene_Save.prototype.onSaveSuccess;
Scene_Save.prototype.onSaveSuccess = function() {
    _Scene_Save_onSaveSuccess.call(this);
    console.log('Save operation completed successfully.');
// implement decrease item here
};
where would I put this?
Would it be above main?
where would I put this?
Would it be above main?
Wherever you need to call for save would be best.

How do you invoke the save at all? through an event? Through choice? Through plugin call?
Wherever you need to call for save would be best.

How do you invoke the save at all? through an event? Through choice? Through plugin call?
this is what the event normally looks like

Captura de ecrã 2024-08-13 114451.png
this is what the event normally looks like

View attachment 314504
Ok so this is what I expected (more or less)

Instead of doing :
♦ Change Items Tape - 1
♦ Open Save Screen

Try :
♦ Open Save Screen
♦ Script :

JavaScript:
const _Scene_Save_onSaveSuccess = Scene_Save.prototype.onSaveSuccess;
Scene_Save.prototype.onSaveSuccess = function() {
    _Scene_Save_onSaveSuccess.call(this);
    itemId = 1;
    $gameParty.gainItem($dataItems[itemId], -1);
};

In the script, be sure to replace : itemId = 1 with the real itemId of the item.
Ok so this is what I expected (more or less)

Instead of doing :
♦ Change Items Tape - 1
♦ Open Save Screen

Try :
♦ Open Save Screen
♦ Script :

JavaScript:
const _Scene_Save_onSaveSuccess = Scene_Save.prototype.onSaveSuccess;
Scene_Save.prototype.onSaveSuccess = function() {
    _Scene_Save_onSaveSuccess.call(this);
    itemId = 1;
    $gameParty.gainItem($dataItems[itemId], -1);
};

In the script, be sure to replace : itemId = 1 with the real itemId of the item.
I don't know if I did something wrong but it keeps crashing on me

Captura de ecrã 2024-08-13 121702.png
Captura de ecrã 2024-08-13 121725.png
Captura de ecrã 2024-08-13 121743.png
@Artille This thread is in VX Ace Support...
My bad, I thought you needed this for RMMV and wrongly assumed it was the MV software.

If you need this for VXAce the method is going to be a bit different.

Replace :
♦ Change Items Tape - 1
♦ Open Save Screen

With :
♦ Open Save Screen


Add a material
Press F11
Below Materials Insert a new script (name it Save_Success)
Type in this code :

Ruby:
class Scene_Save < Scene_File
  alias_method :original_on_save_success, :on_save_success

  def on_save_success
    original_on_save_success
    item_id = 1
    $game_party.lose_item($data_items[item_id], 1)
  end
end

Again, replace the item_id = 1 with whatever ID is your item
This will allow all saves to take away 1 item

Keep the rest of your event the same, use conditionnal branch to check if user has an item or not, otherwize it may create errors.

EDIT :
I hooked on the Scene_Save class and extended the on_save_success method instead.
Works the same (more or less) but is cleaner.

@Artille This thread is in VX Ace Support...

Yes... I got misleaded by his "Use primarily RMMV"
I apologize...
It's a different method

Replace :

My bad, I thought you needed this for RMMV and wrongly assumed it was the MV software.

If you need this for VXAce the method is going to be a bit different.

Replace :
♦ Change Items Tape - 1
♦ Open Save Screen

With :
♦ Open Save Screen


Add a material
Press F11
Below Materials Insert a new script (name it Save_Success)
Type in this code :

Ruby:
class Scene_Save < Scene_File
  alias_method :original_on_save_success, :on_save_success

  def on_save_success
    original_on_save_success
    item_id = 1
    $game_party.lose_item($data_items[item_id], 1)
  end
end

Again, replace the item_id = 1 with whatever ID is your item
This will allow all saves to take away 1 item

Keep the rest of your event the same, use conditionnal branch to check if user has an item or not, otherwize it may create errors.

EDIT :
I hooked on the Scene_Save class and extended the on_save_success method instead.
Works the same (more or less) but is cleaner.



Yes... I got misleaded by his "Use primarily RMMV"
I apologize...
IT WORKED!
Thank you so much
Also yeah, I'm not sure what thats about, really need to change the engine from mv to vx ace
IT WORKED!
Thank you so much
Also yeah, I'm not sure what thats about, really need to change the engine from mv to vx ace

Glad it works!
🙂
Save count variable worked perfectly fine for me?
Save count variable worked perfectly fine for me?
huh, I didn't to do it this way
I tried it out and it works perfectly! thank you
This actually works better than the script because I wasn't a big fan of forcing ALL saves to require the tape
huh, I didn't to do it this way
I tried it out and it works perfectly! thank you
This actually works better than the script because I wasn't a big fan of forcing ALL saves to require the tape
You can extend the script logic. 😀
You said savecount didn't work so I tried this logic.
You can extend the script logic. 😀
You said savecount didn't work so I tried this logic.
Honestly, If it wasn't Zahawks comment, I would have still used the script as is
I had an item called "single use recorder" which is an item that lets you save anywhere without a tape but only once and I had to make it so It gave the player a tape before opening the save system which was still fine.
Of course that would mean if the player used the item but didn't save, it would mean the recorder would be replaced with a normal tape so the way Zahawk did it fixes that little issue
really need to change the engine from mv to vx ace
Do that in your profile.
JavaScript:
const _Scene_Save_onSaveSuccess = Scene_Save.prototype.onSaveSuccess;
Scene_Save.prototype.onSaveSuccess = function() {
_Scene_Save_onSaveSuccess.call(this);
itemId = 1;
$gameParty.gainItem($dataItems[itemId], -1);
};
In the script, be sure to replace :itemId = 1 with the real itemId of the item.
Ruby:
class Scene_Save < Scene_File
alias_method :original_on_save_success, :on_save_success

def on_save_success
original_on_save_success
item_id = 1
$game_party.lose_item($data_items[item_id], 1)
end
end
while this could work, how does it exactly provoke saving?
as there is no check if the player has the item before it could be saved?
while this could work, how does it exactly provoke saving?
as there is no check if the player has the item before it could be saved?
That's in the event that the OP showed in post #5. The point of the script was not to require an item, it was to remove the item IFF the player actually saved.
I see it now, it was a bit confusing, but I get it now, as it open the scene
only when you got the item which is pretty cool idea 🙂

Original thread: https://forums.rpgmakerweb.com/threads/resident-evil-style-limited-save-system-help.171060/