ZMail - Sending you spam since 2013

● ARCHIVED · READ-ONLY
Started by Zalerinian 20 posts View original ↗
  1. ZMail V 1.3.0
    By: ~Zalerinian

    I will be rewriting this script when I have the time, as this was made a long time ago, and can be rewritten to be significantly neater and better. There is currently no ETA on a completion time.

    Introduction

    ZMail is a script that will let you send mail to the player. You can add mail to the mail file at any point in the game. It is a lightweight script, it is highly unlikely that this will be the source of any lag. This script is "plug 'n play", but you need to manually add the mail to the mail file, as it will not do this for you.

    Features

    • Create mail and send it to the player based on certain conditions.
    • A self-resizing window that will try to fit your text.
    • Conditions and content are editable.
    • Name the mail
    • Let the player choose to keep it or to discard it.
    • Get the readability state for a key so that you can use an event or other way to notify the player.

    Usage:

    Spoiler
    * To add mail to the list:                                                   

      * ZMail.add_mail(key, message, condition(s), name, attachments, sender)

       * 'key' The way you access the mail.

       * 'message' The message content.

       * 'condition(s)' The test run for the mail. This should be an array of

       * string. Editable. 

       * 'name' The displayed name of the mail. Editable. Default: Null_Name. 

       * 'attachments' is an array of strings that will give the player items.

       * Items need to look like: "001|5". This will give the player 5 of item 1.

       * Leading zeros are optional. "1|5" works the same.

       * 'sender' is a string representing who sent the mail.

     *

     * To change the conditions of a piece of mail:

      * ZMail.edit_cond(key, condition, check)

       * 'key' The key for the piece of mail. 'condition' The conditions that

       * determine readability. This should be an array of strings

       * 'check' is a true or false value that will determine if you want to 

       * check the conditions immediately.

     * 

     * To change the display name of a piece of mail:

      * ZMail.rename(key, name)

       * 'key' The key for the piece of mail. 'name' is the displayed name.

     * 

     * To add more to a piece of mail:

      * ZMail.add_to_mail(key, space, mail)

       * 'key' The key for the piece of mail. 'space' True or false value. If 

       * true, a space will be inserted between the end of the previous entry

       * and the beginning of the addition. 'mail' is the additional text.

     * 

     * To see the contents of the entire mail file:

      * ZMail.dump_mail_file

       * Will print out the contents of the mail file to the console. This is 

       * not visible without using a console.

     * 

     * To wipe the mail file and create a new one:

      * ZMail.init(true)

       * Call the init method with true as its parameter. This will force-create

       * a new mail file. There is no chance of recovery after using this.

     * 

     * To let the player read the mail:

      * SceneManager.call(Scene_ZMail)

       * The above script call will run the ZMail scene.

     * 

     * To find out if a piece of mail is readable:

      * ZMail.is_readable(key)

       * This will return true or false, true for readable and false for not.

     *

     

     * To change the attachments later in the game"

      * ZMail.edit_attachments(key, attachments)

       * 'key' is the key associated with the mail.

       * 'attachments' is an array of strings using the same format as add_mail.

     

     * To get a list of the attachments on a piece of mail:

      * ZMail.get_attachments(key)

       * 'key' is the key associated with the mail.

       

     * To clear the attachments off of a piece of mail:

      * ZMail.wipe_attachments(key)

       * 'key' is the key associated with the mail.

       

     * To get the sender name of a piece of mail:

      * ZMail.get_sender_name(key)

       * 'key' is the key associated with the piece of mail.

      

     * To change the sender's name of a piece of mail:

      * ZMail.edit_sender(key, name)

       * 'key' is the key associated with the piece of mail.

       * 'name' is the new name to be given.

      

     

     * To use Control Characters in your mail:

      * The available Control Characters are:

      

       * \\V[#] where '#' is a number. This will display the value of

       * the variable in the brackets.

      

       * \\P[#] where '#' is a number. This will display the display

       * name of the #th actor in your party.

     

       * \\N[#] where '#' is a number. This will display the display

       * name of the #th actor in the database. Do not use leading 0's.

      

      

       * To use these, make sure you put two backslashes before the letter.

       * If you do not, the character will NOT be converted. This is an issue

       * with the Ace engine.
    Reading Mail

    Call the scene for reading mail by using SceneManger.call(Scene_ZMail)

    Screenshots

    Spoiler
    Page one of ZMail's 100% legitimate history.   *** OUTDATED ***

    ZMail1_zpsbb6465b9.png

    Page 2, still entirely real.

    ZMail2_zps53220d77.png

    After you finish a piece of mail, it will display the first page (or only page if that's all there is) and display this menu.

    ZMail3_zps98fb7178.png

    (After you archive the mail the 'keep' option is not displayed, as you have already kept it.)

    It is a bit minimalistic, but I plan to change it based on how people would like to see it most, as well as possibly include a few layouts for more diversity.
    Download:

    Due to the size of the script, please get it here: http://pastebin.com/raw.php?i=ydTk2hPd

    FAQ

    -None! No one has asked anything yet!

    Crediting and Usage

    You ARE NOT required to credit me for this script. You may also use this in both commercial and non-commercial games alike. All I ask is that you do not take credit for the creation of the script.

    Authors Notes

     I am looking for some recommendations on the UI portion of the script, as well as any other ways you think I can make this more useful to you.

    Thank you for your interest in my script

    Update History

    V 1.3.0 - May 10th, 2013

    Spoiler
    Added an option to have the mail visible through the main menu.
    V 1.2.0 - May 5th, 2013

    Spoiler
    Added the ability to attach items or money to mail. See above.

    Mail names can now be changed. See above for details

    A sender's name can now be specified, and will be displayed on top of the mail. You can enable/disable this.

    Fixed an issue where mail with multiple pages would cut off early.

    Fixed players being able to return from a piece of mail before deciding whether or not to keep it.
    V 1.1.1 - April 24th, 2013

    Spoiler
    Fixed several bugs dealing with saving. The script now properly saves when you delete a piece of mail, archive one, or edit it with a script call.
    V 1.1.0 - April 22nd, 2013

    Spoiler
    * Added support for Control Characters:

      \V

      \P

      \N

      \G

    In order to use these, use two backslashes when adding the piece of mail. Not doing so will cause the control character to be displayed simply as 'V[1]', or 'P[1]'. To display a normal backslash, you need to put in four in a row into the file. This is due to how Ace will input the mail into the mail file.
    V 1.0.0 - April 21st, 2013

    Spoiler
    * Initial release of the script

    ~ZF
  2. Screenshots?
  3. So basically I could have events sending me mail at certain points in the game, and then I would just get some notification that I've got new mail, and it might contain clues to how to proceed in the game, or develop plot, or hint that there may be some bonus if I follow what the mail says, etc.
  4. hyde9318 said:
    Screenshots?
    Sorry, getting to that!

    Added them. I'm looking for opinions on how people think it should look, as it's very minimalistic right now.

    Tsukihime said:
    So basically I could have events sending me mail at certain points in the game, and then I would just get some notification that I've got new mail, and it might contain clues to how to proceed in the game, or develop plot, or hint that there may be some bonus if I follow what the mail says, etc.
    Yes, that's the idea.

    Also, funny story, I forgot a colon in there for a symbol. Whoops~, let me fix that.

    Fixed It. It shouldn't explode in your face now. Anyway, I was thinking, and I realized something. I should have included regex's for the things that you normally get, such as \V for variables, and the like. I'll add that into is tomorrow. 

    But yes, Tsukihime, that's pretty much the entire idea. You can add the mail to be 'sent' to the player. As for a notification, the script doesn't do that itself, but it can tell you when a piece of mail is ready to be read. My idea for including that is kind of like the mailman in The Legend of Zelda: Twilight Princess. He just shows up and gives you the mail. You'd have to make that event yourself, but it can tell you that it's ready.

    I'll improve on it tomorrow, thanks for any feedback :)
  5. question:

    we can use it like if player reach level 30, he will get email with code that can be used to claim the reward.. 

    ^ will this work!?

    Thanks for this script
  6. OffeNDer said:
    question:

    we can use it like if player reach level 30, he will get email with code that can be used to claim the reward.. 

    ^ will this work!?

    Thanks for this script
    Yes, you should be able to, but i won't be able to verify it until i get home (Im in school currently)
  7. Script looks great. I can see a lot of uses for this. 

    I plan on downloading and testing it. :)
  8. OffeNDer said:
    question:

    we can use it like if player reach level 30, he will get email with code that can be used to claim the reward.. 

    ^ will this work!?

    Thanks for this script
    Yes, It will. Just put your condition in as "$game_actors.[](actor_id).level > 30"

    ninjalex said:
    Script looks great. I can see a lot of uses for this. 

    I plan on downloading and testing it. :)
    Thanks, I just updated the script. It now supports the control characters that you can use in a normal text box made by using the Show Text event command. How to use them is listed in the version history or the usage paragraph in the script.

    If you have any more suggestions or requests for the script, please let me know :)
  9. is there a scene where you can see the list of your 'mail' title. it's better if the mail layout have sender and mail title. like real mail. then in that scene we have list of the mail we have.

    i'm currently writing EST - PHONE MENU. inspired by Necrozard Phone script. but i didn't really create the phone like him. but i change it to menu engine but look like phone. :D . the menu can call scene/common event. so people can customize their phone by linking the scene to the menu engine. it's almost finished. i planned to release it soon. so maybe i can link to your script for the 'mail' part :D . since i'm a little bit lazy to write my own mail system :D .

    screenshot of phone menu :D

    Spoiler
  10. Get read for an overly long suggestions post!

    First of all, I'd really like it if you could attach presents to letters and stuff, as well as allowing the player to attach items of their own to recieved letters so he/she can use them as extra storage.

    Second, it'd also be cool if the player could reply or write new letters to services or NPCs in the game, so they can later show you the letter you've send them (assuming it's an NPC) or/and reply back to it by letter (assuming it's a service or an NPC)
  11. Internetakias said:
    Get read for an overly long suggestions post!

    First of all, I'd really like it if you could attach presents to letters and stuff, as well as also allowing the player to attach presents to recieved letters so he/she can use them as extra storage.

    Second, it'd also be cool if the player could reply or write new letters to services or NPCs in the game, so they can later show you the letter you've send them (assuming it's an NPC) or/and reply back to it by letter (assuming it's a service or an NPC)
    that's not a long suggestion post at all, but I love it!

    It'll take me a while to get this done, though, so for now, have this bug fix:

    V 1.1.1

    Fixed several bugs dealing with saving. The script now properly saves when you delete a piece of mail, archive one, or edit it with a script call.

    Please re-download the script from the original post. Thank you :) .
  12. Now if you could have them send mail say from a notepad file or something else that would be cool.

    Can they write back...LOL!
  13. ShinGamix said:
    Now if you could have them send mail say from a notepad file or something else that would be cool.

    Can they write back...LOL!
    If you really want, I can try to add support for adding mail via notepad file. It'll be your responsibility to keep the file hidden so they can't change it, though :p .

    As for responses, it may be possible, but it'd require a lot more code. I suppose I can look into it after I make the next script on my list. I'm going to finish the next one (The one I'm currently working on), then I'm going to try to add some suggestions onto this, so I can look into that for you if you'd like.
  14. you could grab the note from txt files and then write it to rvdata2 files in data folder. so it will be encrypted.

    (that technique is from Jet notebook menu which i also implement in my EST - NOTEBOOK SYSTEM)

    if you want you could look at my EST - NOTEBOOK SYSTEM

    http://pastebin.com/ryjyH2vK

    just skip to class Scene_Title on how to convert the txt files to rvdata2. and in class Text_Reader - def start on how to load the files.

    using that method. when we develop the game. we could change the txt files when we want to change what the mail said. then when we finish the game. before we encrypt the project. make sure to playtest it once so the rvdata2 is updated to the latest txt files. then delete all the txt files. then encrypt the game for the player. the player will access the rvdata2 files for the mail. and CANNOT change that since it's encrypted :D .
  15. estriole said:
    just skip to class Scene_Title on how to convert the txt files to rvdata2. and in class Text_Reader - def start on how to load the files.

    using that method. when we develop the game. we could change the txt files when we want to change what the mail said. then when we finish the game. before we encrypt the project. make sure to playtest it once so the rvdata2 is updated to the latest txt files. then delete all the txt files. then encrypt the game for the player. the player will access the rvdata2 files for the mail. and CANNOT change that since it's encrypted :D .
    I know how to load files, and that is a good idea, but I need to finish my console script first :p . I've run into a huge, huge issue with it though, so I'm not sure how long it will take. Thanks for your suggestion, though. I'll look into adding it in when I get the chance :)
  16. Zalerinian said:
    that's not a long suggestion post at all, but I love it!

    It'll take me a while to get this done, though, so for now, have this bug fix:

    V 1.1.1

    Fixed several bugs dealing with saving. The script now properly saves when you delete a piece of mail, archive one, or edit it with a script call.

    Please re-download the script from the original post. Thank you :) .
    Alright, in case you didn't realise, I copypasted my suggestions from Animal Crossing's mailing system which works exactly like the suggestions I made.
  17. No, I didn't know that. I haven't played animal crossing. Thanks for the suggestion anyway, i should be able to start working on it tomorrow or Wednesday.
  18. Is there any way to clean up the font?
  19. What do you mean by clean up the font?
  20. In your screenshots, the font is really close together.