Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-02-2014, 06:48 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
setdrawpalette(str, int)

Has anyone actually tried to use this?

PHP Code:
setdrawpalette(strint) - sets a palette to use for later drawing operationsparameters 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.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #2  
Old 02-03-2014, 12:40 AM
100Zero100 100Zero100 is offline
Registered User
Join Date: Jul 2006
Posts: 31
100Zero100 is on a distinguished road
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.
__________________
Hi. I'm NaS!
Reply With Quote
  #3  
Old 02-03-2014, 03:07 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Can you give an example of where/how it's used by chance?
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #4  
Old 02-05-2014, 12:42 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
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.

PHP Code:
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.
Attached Images
  
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...



Last edited by sssssssssss; 02-05-2014 at 03:38 AM..
Reply With Quote
  #5  
Old 02-05-2014, 01:21 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,057
Torankusu has a spectacular aura aboutTorankusu has a spectacular aura about
screenshots?
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #6  
Old 02-05-2014, 03:41 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Modified post.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #7  
Old 02-05-2014, 10:56 AM
100Zero100 100Zero100 is offline
Registered User
Join Date: Jul 2006
Posts: 31
100Zero100 is on a distinguished road
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).
__________________
Hi. I'm NaS!
Reply With Quote
  #8  
Old 02-05-2014, 11:31 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,057
Torankusu has a spectacular aura aboutTorankusu has a spectacular aura about
Quote:
Originally Posted by 100Zero100 View Post
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?
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #9  
Old 02-05-2014, 11:51 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Quote:
Originally Posted by 100Zero100 View Post
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.

Quote:
Originally Posted by Torankusu View Post
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.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...



Last edited by sssssssssss; 02-05-2014 at 01:41 PM..
Reply With Quote
  #10  
Old 02-05-2014, 01:04 PM
100Zero100 100Zero100 is offline
Registered User
Join Date: Jul 2006
Posts: 31
100Zero100 is on a distinguished road
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.
__________________
Hi. I'm NaS!
Reply With Quote
  #11  
Old 02-05-2014, 01:40 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
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?
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...



Last edited by sssssssssss; 02-05-2014 at 06:56 PM..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.