PDA

View Full Version : Color Cycling


G_yoshi
08-01-2001, 10:40 PM
I was thinking, since graal runs in 256 color mode, couldn't it do color cycling which is seen used in many old games like SimCity2000 or LodeRunner.

I think it would be neat, just specify the beginning index out of 0-255, and the ending index which has equal or higher then the first index, then specify the time delays and possibly the direction the color cycles. It would make for some interesting effects on images when combined with setcoloreffect and setzoomeffect ;) Could maybe add a command for showimgs too :D

Solareon
08-02-2001, 12:06 AM
waddhafak areyou talking about? you mean color changing?

SkooL
08-02-2001, 12:50 AM
Originally posted by Solareon
waddhafakPhrase stolen from Gabriel. :(

Tyhm
08-02-2001, 05:10 AM
You can already do this....WITH YOUR SKILL!!!
^_~

You just need to create a function by which
blue decreases from 1 to 0 while red increases from 0 to 1
then red decreases from 1 to 0 while green increases from 0 to 1
then green decreases as blue increases
then repeat

It's not real hard, unless you wanna do it efficiently.

See, here's one:
for(this.i=0;this.i<3;this.i++){
for(this.n=0;this.n<1;this.n+=0.125){
if(this.i<1) setcoloreffect this.n,0,1-this.n,0.5;
else if(this.i<2) setcoloreffect 1-this.n,this.n,0,0.5;
else setcoloreffect 0,1-this.n,this.n,0.5;
sleep 0.05;
}
}


See how that grabs yeh.

G_yoshi
08-02-2001, 10:56 AM
:p I know that i can do that, but that affects the whole palette, I want part of the palette. Because I could have a specific part of the image change colors and this would save on disk space and cut down on useless files.

It's easy to do color cycling with setcoloreffect, but does it on the entire image. I just want a small palette shift, besides, it would look cool :D You could use color cycling in junction with a whole image color cycle as seen with your script. Kinda like the Atari, it could do color cycling ;) and still have whole palette changes while part of it cycled.

Tyhm
08-03-2001, 01:39 PM
So you mean Pallette Swamp, like how Luigi is a palletteswapped Mario, and all that?

setpal dusk8.png;

It'd be nice anyway. Tricky, maybe wasteful since there's no standard pallette therefore no standard backpals, but nice. I think you'd be better off with recolors though.

T-Squad
08-04-2001, 03:34 AM
Originally posted by G_yoshi
:p I know that i can do that, but that affects the whole palette, I want part of the palette. Because I could have a specific part of the image change colors and this would save on disk space and cut down on useless files.

It's easy to do color cycling with setcoloreffect, but does it on the entire image. I just want a small palette shift, besides, it would look cool :D You could use color cycling in junction with a whole image color cycle as seen with your script. Kinda like the Atari, it could do color cycling ;) and still have whole palette changes while part of it cycled.

Umm you could do that...in a gani just set the image as the body..if you dont use the first 6 colors in the pallette, the seventh could be used for color changing that color in graal...

G_yoshi
08-04-2001, 01:03 PM
erm, using a gani is animation, I do not want that. I want an npc command to control the cycling, i.e. moving palette indexes and this has nothing to do with palette swaping, either.

Have you ever played SimCity2000 or any older SVGA type games? Especially used SCURK (building editor kit for SC2k). When you are designing buildings, you can put special colors on the building that will cycle through a small little palette of colors. It was often times use to simulate animation because some palettes had more than 2 colors and went at different speeds.

It is very simple. Just specify the start index out of 255 different indexes and then pick the stop index out of 255 different indexes. Then set the delay time and then run the level and watch certain parts of the npc change colors.

Not trying to sound angry, but how hard is it to understand?

Tyhm
08-04-2001, 01:21 PM
Okay, a legal Graal png has 256 colors, often to its own unique pallette structure.
What you're suggesting would be that, say, a wall image, can just "change" to one of 256 predefined 256-color pallettes.
But what if the wall uses a completely different pallette order? What if the wall goes Black-Green-White and all the other backpals go Red-Yellow-Green-Cyan-Blue-Magenta? The wall will be yellow with red grout for every pallette you use on it, with very slight modifications.
Easy fix, just make sure the target image uses the standard pallette. But how many people are gonna figure THAT one out?!? "I tried to use the cool blue pallette on door.png, but it didn't work! It came out all black and stuff!"

Lionel-Jonson
08-04-2001, 01:33 PM
Originally posted by SkooL
Phrase stolen from Gabriel. :(

he even misspelled it :(

G_yoshi
08-04-2001, 01:56 PM
Originally posted by Tyhm
Okay, a legal Graal png has 256 colors, often to its own unique pallette structure.
What you're suggesting would be that, say, a wall image, can just "change" to one of 256 predefined 256-color pallettes.
But what if the wall uses a completely different pallette order? What if the wall goes Black-Green-White and all the other backpals go Red-Yellow-Green-Cyan-Blue-Magenta? The wall will be yellow with red grout for every pallette you use on it, with very slight modifications.
Easy fix, just make sure the target image uses the standard pallette. But how many people are gonna figure THAT one out?!? "I tried to use the cool blue pallette on door.png, but it didn't work! It came out all black and stuff!"

i am not sure how to describe any better than I already have. Since each image would already have its own palette, you cycle its palette. No need to use the "standard" palette. The command would cycle the colors of the image's palette.

Look at the animated gif I have attached and notice the bottom right corner