Post: [SCRIPT] Flashing Text -Smoother-
11-23-2011, 09:47 PM #1
Taylor
Former Black Knight.
(adsbygoogle = window.adsbygoogle || []).push({}); Here's A Video Reference For You:



My Version:
    
CoolText()
{
self.display FadeOverTime( 0.75 ); self.display.color = ( 1, 0, 0 ); wait .75;
self.display FadeOverTime( 0.75 ); self.display.color = ( 0, 1, 0 ); wait .75;
self.display FadeOverTime( 0.75 ); self.display.color = ( 0, 0, 1 ); wait .75;
self.display FadeOverTime( 0.75 ); self.display.color = ( 1, 0, 1 ); wait .75;
self.display FadeOverTime( 0.75 ); self.display.color = ( 0, 1, 1 ); wait .75;
self.display FadeOverTime( 0.75 ); self.display.color = ( 1, 1, 0 ); wait .75;
self thread CoolText();
}


TheFallen's Shorter Version:

Thread From Menu, Or Anywhere Else
    
self thread doFlash(self.display);


    
doFlash(elem)
{
r=randomint(255);
g=randomint(255);
b=randomint(255);
for(;Winky Winky
{
elem FadeOverTime( 0.75 );
elem.color=(r,g,b);
wait .75;
}
}


ReScript's Version:

    
colorFade( color1, color2, freq ){ self.flashing = true; memo = 0; while( self.flashing = true ) { self fadeOverTime( freq ); if ( memo = 0 ){ self.color = color1; memo = 1; } if ( memo = 1 ){ self.color = color2; memo = 0; } wait freq; }}
//starting the flashelement colorFade( (1, 0, 0), (0, 1, 0), 1 );
//ending the flashelement.flashing = false;


NOTE: CHANGE THE "self.display" TO WHATEVER YOUR TEXT CODE IS (Ex: self.MenuText)
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to Taylor for this useful post:

AndreeU, DlBSY993, iPROFamily, lallyman, Rea
11-24-2011, 04:54 PM #20
Woof
...hmm
Originally posted by xYARDSALEx View Post
Is That All The Colors? And I'll Add It To The Thread

Basically what it does is fades the given element .colour with two given chosen colours, it's very universal though.
11-24-2011, 05:21 PM #21
The two "smaller" versions in the OP are flawed.
11-24-2011, 05:49 PM #22
Woof
...hmm
Originally posted by Tanskin View Post
The two "smaller" versions in the OP are flawed.

The version I posted was not "smaller" just more efficient, please point out these flaws you speak of.
Don't bother relying with something unique to GSC, I don't specialise in the language, there is nothing wrong with the general knowledge in the factors of programming though.
11-24-2011, 06:17 PM #23
Thank you for this script Winky Winky
11-24-2011, 07:11 PM #24
Taylor
Former Black Knight.
Originally posted by MODZ View Post
Thank you for this script Winky Winky


No Problem
11-24-2011, 07:35 PM #25
Correy
I'm the Original
Originally posted by ITheFallenI View Post
This is a shorter version. Just do something like this for what ever your text def. is:
    
self thread doFlash(self.display);

I'm not sure if "randomint" works on Cod 4 but it should. Other wise you have to manually enter the color values.
    
doFlash(elem)
{
r=randomint(255);
g=randomint(255);
b=randomint(255);
for(;Winky Winky
{
elem FadeOverTime( 0.75 );
elem.color=(r,g,b);
wait .75;
}
}



woah, i can see you finally starting to look at COD4 =D
11-24-2011, 07:40 PM #26
Originally posted by reScript View Post
The version I posted was not "smaller" just more efficient, please point out these flaws you speak of.
Don't bother relying with something unique to GSC, I don't specialise in the language, there is nothing wrong with the general knowledge in the factors of programming though.


    colorFade( color1, color2, freq )
{
self.flashing = true;
memo = 0;
while( self.flashing = true )
{
self fadeOverTime( freq );
if ( memo = 0 )
{
self.color = color1;
memo = 1;
}
if ( memo = 1 )
{
self.color = color2;
memo = 0;
}
wait freq;
}
}

1. Incorrect syntax for while loops an if statements
2. No point for the 'memo' variable; if your going to cycle through both colors anyways

    doFlash(elem)
{
r=randomint(255);
g=randomint(255);
b=randomint(255);
for(;Winky Winky
{
elem FadeOverTime( 0.75 );
elem.color=(r,g,b);
wait .75;
}
}

1. RGB values have to divided by 255
2. No way to end script
3. Only one color per call to the thread

The following user groaned Tanskin for this awful post:

247Yamato
11-24-2011, 07:42 PM #27
Woof
...hmm
Originally posted by Tanskin View Post
.

These are irrelevant "flaws", as for the while functionality, the other languages I use would have been fine with that.
Like I said I don't deal with GSC often.
11-24-2011, 07:43 PM #28
Taylor
Former Black Knight.
Originally posted by Tanskin View Post
    colorFade( color1, color2, freq )
{
self.flashing = true;
memo = 0;
while( self.flashing = true )
{
self fadeOverTime( freq );
if ( memo = 0 )
{
self.color = color1;
memo = 1;
}
if ( memo = 1 )
{
self.color = color2;
memo = 0;
}
wait freq;
}
}

1. Incorrect syntax for while loops an if statements
2. No point for the 'memo' variable; if your going to cycle through both colors anyways

    doFlash(elem)
{
r=randomint(255);
g=randomint(255);
b=randomint(255);
for(;Winky Winky
{
elem FadeOverTime( 0.75 );
elem.color=(r,g,b);
wait .75;
}
}

1. RGB values have to divided by 255
2. No way to end script
3. Only one color per call to the thread


WHo Cares If It Doesnt End, And It Won't Syntex

---------- Post added at 02:43 PM ---------- Previous post was at 02:43 PM ----------

Originally posted by Correy View Post
woah, i can see you finally starting to look at COD4 =D


What Are You Talking About????

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo