Display datetime of a autosave file in the game save load menu

  • #1, by andy-rinaldiSunday, 15. February 2015, 22:06 6 years ago
    I use the autosave feature in my game and I would like know the datetime of a autosave in the save load menu.
    Thanks.

    Forum Fan

    160 Posts


  • #2, by afrlmeSunday, 15. February 2015, 22:59 6 years ago
    Er I don't think the autosave includes that data. You could probably use Lua script to write the date / time to an external file & then read it back from that & add it into a value or something to then display it with the display object text action part or with animations.

    Bit of work with either method.

    Imperator

    6841 Posts

  • #3, by ke4Monday, 16. February 2015, 12:39 6 years ago
    In your query execute the autosave and then run this script - you need to have autosave1 value created for that.

    1. execute autosave #1
    getObject("Values[autosave1]"):setValue(VValueString, os.date("%c"))
    1
    2

    3. display object text

    In the end just display the string text through
    <vs=autosave1>
    1

    %c means date and time, you can choose diferent formating as well.

    Key Killer

    810 Posts

  • #4, by afrlmeMonday, 16. February 2015, 12:45 6 years ago
    Hmm the autosave would need to be loaded to get the data from that value, otherwise that value will be whatever it was in its initial state which is why I mentioned writing to an external file.

    Imperator

    6841 Posts

  • #5, by ke4Monday, 16. February 2015, 13:00 6 years ago
    Why the autosave need to be loaded to get the data? Sorry i'm missing that.

    Key Killer

    810 Posts

  • #6, by afrlmeMonday, 16. February 2015, 14:26 6 years ago
    He is using the autosave (quicksave) system instead of the default save system which generates the thumbnails & timestamp. Autosave or quicksave (depending on how you look at it) is just for quickly saving character position & the state of values, conditions & variables without generating a thumbnail or timestamp.

    If you write the current time / date into a value then save the game, you would still need to load that data to display it, thus the value you saved the data in would be in its initial state until updated. Do you understand what I'm getting at now?

    The default save game files read the data from the files themselves, which is why it automatically displays thumbnail & timestamp if you assigned a font to save games via the scene properties tab.

    Imperator

    6841 Posts

  • #7, by ke4Monday, 16. February 2015, 14:47 6 years ago
    I see, you are saying that the information about the date and time is inside of the quicksave, so you need to load it to see it. Right, i didnt realized this. So the only way is to save it into an external file and set that the value automaticly loads data from that file. But will it work to work with files in build version?

    Key Killer

    810 Posts

  • #8, by afrlmeMonday, 16. February 2015, 14:57 6 years ago
    Hmm not sure. What I would do is write the file to the vispath:Savegames folder. You could create a new file for each autosave #number & you could technically write whatever you wanted into it, such as: date, time, location, score, game completion percentage etc.

    However, without testing, I can't say how this would work, or whether it would even work - it's just theoretical, at the minute. Also I have no intention of finding out right now as I don't need this feature myself for anything.

    Imperator

    6841 Posts

  • #9, by ke4Monday, 16. February 2015, 15:05 6 years ago
    Yeah, that's cool, i don't need it either. Guess it could work though.

    Key Killer

    810 Posts

  • #10, by andy-rinaldiMonday, 16. February 2015, 21:58 6 years ago
    Thank you guys for the answers but I have not time for the testing, so I will use the autosave without timestamp.
    Another question: can I resize a screenshot with lua?

    Forum Fan

    160 Posts

  • #11, by afrlmeMonday, 16. February 2015, 22:10 6 years ago
    hmm... you mean via the createScreenshot() function? No I don't think so, it takes the screenshot at the default game resolution regardless of what resolution the game has been scaled down to. I'm not 100% sure but I think you can use Lua script to link an objects sprite to another image & from that you might be able to scale the image using the new VObjectScale data structure table to another scale percentage. Again, not sure without testing.

    Imperator

    6841 Posts

Write post