Ok, so I scripted the ZII spells, and I need a piece of a script that will make Link flash for a second or so, and another that will flash the screen (But NOT Link) for the same duration. (Two seperate script pieces)
If I get them, I'll just work them into the scripts I have. Oh, and it's build 1112.
Flashing Link and screen
Started by
Purplemandown
, Jan 10 2010 07:56 PM
5 replies to this topic
#1
Posted 10 January 2010 - 07:56 PM
#2
Posted 10 January 2010 - 08:17 PM
CODE
void FlashLayer( int layer, int combo, int cset, int counter )
{
if(counter%2==0)
{
for(int i; i<176;i++)
Screen->FastCombo(layer,ComboX(i),ComboY(i),combo,cset,64);
}
}
{
if(counter%2==0)
{
for(int i; i<176;i++)
Screen->FastCombo(layer,ComboX(i),ComboY(i),combo,cset,64);
}
}
Or faster solid color version:
CODE
void FlashLayer( int layer, int cset, int counter )
{
if(counter%2==0)
{
Screen->Rect(layer,0,0,256,176,cset,0,0,0,true,64);
}
}
{
if(counter%2==0)
{
Screen->Rect(layer,0,0,256,176,cset,0,0,0,true,64);
}
}
edit-
CODE
void FlashLayer( int layer, int cset, int counter,int flash_spacing )
{
if(counter% flash_spacing==0)
{
Screen->Rect(layer,0,0,256,176,cset,0,0,0,true,64);
}
}
{
if(counter% flash_spacing==0)
{
Screen->Rect(layer,0,0,256,176,cset,0,0,0,true,64);
}
}
This should flash the screen (untesed).
Edited by Gleeok, 10 January 2010 - 08:22 PM.
#3
Posted 10 January 2010 - 08:20 PM
Awesome. But... Is one tick of the counter 1 frame? How long is one counter tick?
#4
Posted 10 January 2010 - 08:24 PM
Just call by:
int some_counter;
...
FlashLayer( 6, cset, some_counter++, 2 );
CODE
int some_counter;
...
FlashLayer( 6, cset, some_counter++, 2 );
Edited by Gleeok, 10 January 2010 - 08:26 PM.
#5
Posted 10 January 2010 - 08:33 PM
OK, thanks. (But I still need to know how to work the timer. How long is one tick of the counter?)
#6
Posted 11 January 2010 - 04:19 AM
CODE
int counter = 0;
while(screenflashing){
FlashLayer( 6, cset, counter, 2 );
counter++;
Waitframe();
}
while(screenflashing){
FlashLayer( 6, cset, counter, 2 );
counter++;
Waitframe();
}
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users