- Joined
- Dec 17, 2012
- Messages
- 4,696
- Reaction score
- 935
- First Language
- English
- Primarily Uses
- N/A
I'm sorry for the confusion, I understand I documented this pretty badly. I am rewriting it at the moment, and intend to make the script much more usable and work better. This was one of the first scripts I made, so there should be a great improvement once this is redone.Do you need to use conditions at all with this? I'm having a little trouble trying to figure out the script call to get new mail to show up too. What exactly does 'key' refer to? An example call of how to send the player a piece of mail with no attachment would be really useful. </dumb>
Better explanation of how it works:
Key
The key that you use when creating mail is how you access the mail later. You are able to change a piece of mail's conditions, its attachments, the message itself, and the sender after you initially create it. The key must be unique across every piece of mail, as this is also used to set each piece apart from another. The key can contain any sort of character. The key must be a string, however, which simply means you must put it between quotes. For example, "this works 124wqwe12", "4s d03s th!s" "Map001_Ev007_Mail3". anything may be used as long as it is unique to that piece of mail.
Conditions
Conditions are not required, however, if no condition is given, it will be set to unreadable. If you don't want to use any kind of condition, just use "true". This will make the message immediately available for the player to read.
If you would like to use a condition, they work the same as the conditional branch's script option. A piece of mail may have more than one condition, and all conditions must evaluate to true for the mail to be readable. Because conditions are just small Ruby statements, a basic understand of Ruby is recommended for working with conditions.
Attachments
Attachments by default are empty. If you want to attach an item to a piece of mail, you have to pass in a string in the following format:
"item_id|count".
item_id is the number next to the item in the database. You can have leading zeros if you wish, but they are not required. The pipe characters ( | ) separates the item id with how many of the item the player will receive. The count can be any number, even negative. Negative numbers will attempt to take the item away from the player.

