Page 1 of 1

Simple Mailbox Using persistent data [HELP]

Posted: Fri Feb 14, 2020 3:05 am
by beastcarving
I've seen other's using a similar mail box function but none of those save the letters in your indox after exiting the game. I've tried using it myself by adjusting the code a bit, even after reloading and exiting the game, the mail box is empty again. How do I make the messages save using persistent data?

Re: Simple Mailbox Using persistent data [HELP]

Posted: Fri Feb 14, 2020 4:59 pm
by Per K Grok
beastcarving wrote: Fri Feb 14, 2020 3:05 am I've seen other's using a similar mail box function but none of those save the letters in your indox after exiting the game. I've tried using it myself by adjusting the code a bit, even after reloading and exiting the game, the mail box is empty again. How do I make the messages save using persistent data?


This will give you an opportunity to save persistent data.
When you exit and restart the program the data you have saved will be shown. If no data is saved you will get the message "postbox empty".

Code: Select all

label start:

    if not persistent.postbox:
        "postbox empty"
    else:
        $ pb=persistent.postbox
        "[pb]"


    $ pb= renpy.input("Enter text to postbox")
    $ persistent.postbox = pb
    $ renpy.save_persistent()

     pause
    return