I have a series of fictional emails the player can receive based on events in gameplay. I want to display links to said emails in the "order received." The output would look roughly like this:
[[Subject of Email 1->$Email1]]
[[Subject of Email 2->$Email2]]
[[Subject of Email 3->$Email3]]
And so forth. There are 32 of these emails total. (There are custom UI elements involved, so this can't be a straight list of links because there will be divs/accordions/etc applied.)
I have the text of each email in a separate passage currently: DynamicEmail1, DynamicEmail2, etc. I don't have the subject lines stored anywhere yet because I honestly don't know where best to put them.
Basically, what I need to do is:
1. When something happens to trigger an email, find the first variable that does not have anything stored in it (besides false). This suggests a loop of some kind.
3. On the emails page, have the links print in order, as above. I don't know whether it is best/most possible to do this with a lot of (if: $email1 is not false) conditional statements -- there's a finite number, at least -- or to repeat through a loop and print links for everything that is not false.