I've been working on a script for the past while. I stopped in hope that I would think of a way to do this, but no dice.
What I need is a way to make the script delay before it loops again, and allow one of the arguments being set-up so that's the delay time. I've tried putting variables inside the waitframe() but it forever gives me errors. (I'm using 796 at the moment, if that has anything to do with it.)
User-Defined Delays?
for(int counter=0; counter<4; counter++)
{
Waitframe();
}
?
or Waitframes(n); where n is the frames to wait, will work fine. And if you only want it to wait 60 frames every 10 seconds then something like;
if (delay>0)delay--;
else{Waitframes(60); delay=600;}
would be easiest.
ffc script customdelay{
void run(int delay){
while(true){
//code goes here
Waitframes(delay);
}
}
}How many scripters does it take to screw in a light bulb?
.....
.....
...well I can't think of a good punchline, but something referring to increment and decrement is probably gold.
Gleeok wrote:How many scripters does it take to screw in a light bulb?
Five: One to screw in the lightbulb, and four to request that Link->Screw be implemented in the next build....😃
-------
From the compiler:
Pass 1: Parsing
Pass 2: Preprocessing
Pass 3: Building symbol tables
Pass 4: Type-checking/Completing function symbol tables/Constant folding
tmp, line 3: Error T29: That pointer type does not have a variable Screw.
-------
3 apparently Gleeok =P
It's better to get 3 help than no help =P
I've tried the whole waitframe(n) thingie, but it never seems to work. (Maybe I miss-typed it or something, I'll try it again.) Thanks for the help everyone! 😃
Make sure you have
import "std.zh" at the top of your script file, else it won't work.Also, caplital 'W' for Waitframe();.
And for Waitframes(n);.
Also note that Waitframe() and Waitframes(int frames) won't work in item scripts.
Waitframe() waits a single frame and does not require any argument. Waitframes(int frames) waits the specified number of frames. Joe123's example above is a good starting point for what you want to do, as it allows you to pass in the number of frames to delay (set this up using the Arguments tab in the Freeform Combo editor, assuming you're attaching this script to a freeform combo).
The following Wiki articles might be of use:
Waitframe()
Waitframes()
Infinite Loops and Waitframe
The run() function
Assigning scripts to items and ffcs
Script arguments for Freeform Combos