Reply to Re: how do i make the scrip to show just one time
If you don't have an account, just leave the password field blank.
glennglenn, 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.
Thanks, OkalyDDude
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.
Thanks, OkalyDDude