Reply to Re: Shawn Teal conspiracy theory
If you don't have an account, just leave the password field blank.
Rob, I'm not sure at all why this is in this thread, but I will answer the question regardless.
I'm assuming you have a script attached to either a sprite or a room, and you want it to trigger the first time dink enters, but no other times. Correct me if I am wrong.
Now, to do this you'll need a global. In main.c you'll see a list of all the globals being initiated. Add your own with this command, replacing "whatever" with .. well.. whatever you wish..
make_global_int("&whatever", 0);
The number zero means it starts out set as 0, and the "&" is important, it marks it as a variable.
Now, simply have the script like this:
void main(void)
{
if (&whatever == 0)
{
//stuff
&whatever = 1;
}
}
Thus, when &whatever = 0, at the start of the dmod, it will run, and when it runs, it sets it to 1, therefore it will not run again.
I'm assuming you have a script attached to either a sprite or a room, and you want it to trigger the first time dink enters, but no other times. Correct me if I am wrong.
Now, to do this you'll need a global. In main.c you'll see a list of all the globals being initiated. Add your own with this command, replacing "whatever" with .. well.. whatever you wish..
make_global_int("&whatever", 0);
The number zero means it starts out set as 0, and the "&" is important, it marks it as a variable.
Now, simply have the script like this:
void main(void)
{
if (&whatever == 0)
{
//stuff
&whatever = 1;
}
}
Thus, when &whatever = 0, at the start of the dmod, it will run, and when it runs, it sets it to 1, therefore it will not run again.