PDA

View Full Version : setdrawpalette(str, int)


sssssssssss
02-02-2014, 06:48 PM
Has anyone actually tried to use this?

setdrawpalette(str, int) - sets a palette to use for later drawing operations, parameters are {color0,color1,...} and the index of the transparent color

There's nothing on the forums or the Graal Bible about it at all. I was going to give it a shot but I don't even know what the str should be or anything.

100Zero100
02-03-2014, 12:40 AM
The string is the array of color entries, not sure why it's labeled str.

The int is an index of that array; that index's color draws transparent.

sssssssssss
02-03-2014, 03:07 AM
Can you give an example of where/how it's used by chance?

sssssssssss
02-05-2014, 12:42 AM
In the panel you just want to call the function. With my experiences, the color array is player colors ({"red", "green", etc) and the index will change the entire bg/transparent color.

color0, color1, so on and so on seem to effect each shade of color on the image you're using, starting with the darkest shade. So color0 does the darkest shade on the image, color1, next darkest, so on and so on.

It seemed on some images the colors array didn't start effecting the image colors until color2.

Also a thanks to Deas. We were both testing at once and he lead to things that got me to this, and I believe he got to the same conclusion right before I did anyways (he deserves the credit for this). Figured I'd share, since there is nothing really about this at all.

setdrawpalette({"red", "blue", "green", "cyan"}, 0)

The first attached image is the original image. The second image, its taking the hair and face separate (they start out separate) using a panel to color the hair for panel 1, then using this to color the face in panel 2, saving those images, then loading another panel and adding those two images together. That is kind of hackish I suppose, but I wanted to explain since the only image I have left is one with 2 parts in it, which is why you'll see different colors for the hair and face. So.... when noticing what it does, best to just look at the hair and shading, then see the transition with the colors.

The script has changed, and I'm already off RC, but the images should show what it does well enough with the description I gave.

Torankusu
02-05-2014, 01:21 AM
screenshots?

sssssssssss
02-05-2014, 03:41 AM
Modified post.

100Zero100
02-05-2014, 10:56 AM
One would use this sort of thing to recreate the default behavior of the outfit, where "white coat" in graphic can be remapped into a different color (eg, .colors[#]).

It would certainly be interesting if somebody recreated the default palette to include more parts to color the outfit (eg, skin, coat, shoes, belt, sleeves... collar, pants, bracers, elbows, hilt).

Torankusu
02-05-2014, 11:31 AM
One would use this sort of thing to recreate the default behavior of the outfit, where "white coat" in graphic can be remapped into a different color (eg, .colors[#]).

It would certainly be interesting if somebody recreated the default palette to include more parts to color the outfit (eg, skin, coat, shoes, belt, sleeves... collar, pants, bracers, elbows, hilt).

I'd have to search for it, but I believe konidias tried something similar years ago for oasis (or bomy moon?)

Each part of the bodies had to be an individual sprite though, which if im reading correctly, is essentially what cyril is doing anyway?

sssssssssss
02-05-2014, 11:51 AM
One would use this sort of thing to recreate the default behavior of the outfit, where "white coat" in graphic can be remapped into a different color (eg, .colors[#]).

It would certainly be interesting if somebody recreated the default palette to include more parts to color the outfit (eg, skin, coat, shoes, belt, sleeves... collar, pants, bracers, elbows, hilt).

Essentially, yes.

I'd have to search for it, but I believe konidias tried something similar years ago for oasis (or bomy moon?)

Each part of the bodies had to be an individual sprite though, which if im reading correctly, is essentially what cyril is doing anyway?

Yes. But even with Graal's 159 colors or whatever it's not enough for some images. With ours, it screwed up things, so I'd recommend that if you use more of a basic set of colors (no intense amounts of shading) then it will work. For our stuff, this doesn't really work out. Unless graal jumped to all 255 colors (someone let me know please).

Basically with shading, this won't work eventually bc there will be colors you need that graal doesn't have built in.

100Zero100
02-05-2014, 01:04 PM
I wasn't trying to imply that you can make some superbly shaded bodies or whatever and have some really outrageous customization.

But just taking body.png for example and adding green pants to it, and then using setdrawpalette in conjunction with that so that you can do something like a .colors[5] which would edit your character's pants color, or so.

sssssssssss
02-05-2014, 01:40 PM
I know, I wasn't saying you were either. I was just explaining further for other people looking at this.

P.S. are you nastynas?