Autosave function

Discussion in 'JS Plugin Requests' started by RATISOFT, Oct 25, 2015.

  1. RATISOFT

    RATISOFT Villager Member

    Messages:
    18
    Likes Received:
    6
    Location:
    Poland
    First Language:
    Polish
    Hello

    I need some plugin for Autosave function.

    I want to avoid save menu scene and save the game from an event on the first save slot by default. It should be simple but I've got no idea how to do it :>

    It would be useful for projects what are designed to be small and addictive on mobile devices ^^

    Greetings
     
    #1
    VagabondDog likes this.
  2. VagabondDog

    VagabondDog Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    Metaphors
    The simplest version of this would be something that allows you to manually trigger it from within an event via a script call.

    Hopefully someone will have an answer soon.

    This was a staple function in VX Ace.
     
    #2
  3. Bearsmith

    Bearsmith Villager Member

    Messages:
    22
    Likes Received:
    5
    First Language:
    English
    I'm also in need of this script! My project requires the user to be unable to save-scum, so auto saving is a must for me. Hopefully someone will make this sooner or later.
     
    #3
  4. Jeremy Cannady

    Jeremy Cannady Coldfire Veteran

    Messages:
    449
    Likes Received:
    261
    Location:
    Texas
    First Language:
    English
    Has any one made this yet? Seems simple I might pick it up if it hasn't already been done.
     
    #4
  5. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,061
    Location:
    Toronto
    First Language:
    English
    If you want to save a game with script calls you can say

    DataManager.saveGame(0)Where 0 is the first save slot.Then you have full control over when auto-saving should occur.
     
    #5
    bruno7570 and RATISOFT like this.
  6. RATISOFT

    RATISOFT Villager Member

    Messages:
    18
    Likes Received:
    6
    Location:
    Poland
    First Language:
    Polish
    Thanks!

    This solution is a great way for mobile games with only one possible save slot.

    But is there a way to check on whats slot was last save made? So it will able to be usefull for games with more save slots :)
     
    #6
  7. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,061
    Location:
    Toronto
    First Language:
    English
    I am not entirely sure but you can try

    var lastId = DataManager.lastAccessedSavefileId()DataManager.saveGame(lastId)The last accessed ID is updated whenever1. You load the game

    2. You save the game

    So if they load a game, it should point to that save file, which you would always use during the game itself.

    Please do extensive tests.
     
    Last edited by a moderator: Nov 8, 2015
    #7
  8. Ilovepapayas

    Ilovepapayas Villager Member

    Messages:
    9
    Likes Received:
    3
    First Language:
    german
    Hi there. 

    Thanks for this answer, this is what I'm looking for, too!!

    I've tried this out and it creates a new savegame, but everytime I load this game, there is a type error: "cannot read property type of null"

    This is, what my console says: TypeError: Cannot read property 'name' of null

        at Function.AudioManager.playBgm (rpg_managers.js:884)

        at Game_System.onAfterLoad (rpg_objects.js:239)

        at Scene_Load.terminate (rpg_scenes.js:1530)

        at Function.SceneManager.changeScene (rpg_managers.js:1649)

        at Function.SceneManager.updateMain (rpg_managers.js:1640)

        at Function.SceneManager.update (rpg_managers.js:1576)

     

    I have strictly copied this script call into my event (with autorun), but loading the savegame doesn't work...  :stare:  But I have no idea, why... 

    Is it perhaps a bug inside MV? Or did I something wrong?
     
    #8
    bruno7570 likes this.
  9. Jeremy Cannady

    Jeremy Cannady Coldfire Veteran

    Messages:
    449
    Likes Received:
    261
    Location:
    Texas
    First Language:
    English
    I think you have to do the $gameSystem.onBeforeSave() as well
     
    #9
    elroy and Ilovepapayas like this.
  10. Koru-chan

    Koru-chan Veteran Veteran

    Messages:
    39
    Likes Received:
    15
    Location:
    Florida
    First Language:
    English
    Primarily Uses:
    RMMV
    Here's my question about that.  If I wanted to have it auto-save after random encounters so the player is stuck with the result they got, how could I do it?  Is there a script for sticking custom script calls into the very end of a battle after items and exp were rewarded?  Or is there a simpler solution to that?
     
    #10
  11. Ilovepapayas

    Ilovepapayas Villager Member

    Messages:
    9
    Likes Received:
    3
    First Language:
    german
    Thank you so much, Jeremy! That was excatly, what I needed!!  :guffaw:
     
    #11
  12. elroy

    elroy Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    HK
    Oh, Jeremy, I love you!!

    You solve my big problem.

    And Tsukihime too. Thank you~

    :D   :D   :D
     
    #12

Share This Page