I want to have my charecter look in his mailbox, and find it empty But later, after he enters a contest or something, I want there to be something in the mailbox.
What you'll need to do is create a global variable.
In the top of your global script, before any of the functions start, place this:
bool Entered_Contest = false;
export Entered_Contest;
Then, in the global header:
import bool Entered_Contest;
Now the variable Entered_Contest is available in all your rooms. Whenever the player enteres the contest:
Entered_Contest = true;
Then, in the mailbox interaction:
if (Entered_Contest == false) {
Display("There is nothing in the mailbox.");
}
else {
Display("Hey, I got some mail!");
//other stuff for getting mail here
}
Hope that helps!
-Regards, Akumayo
I think this question was asked before, but here is the thing:
a.) Declare a global variable with a initial value.
b.) In the room where is the mailbox, export the variable
c.) Ã, In this room check his value, if is the first time the value would be the initial.
d.) In another room, or an some part of the game where you think the mailbox must be contain something, change the value of the variable, make sure that the variable was exported or you will have a compile error :P.
e.) In the original room where is the mailbox in the part where you check his value add another condition and put the code to do the object appears in the mailbox (a letter o package...)
Thanks to "Nerezza Terra" Akumayo for the code explanation