Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Custom coloring system (https://forums.graalonline.com/forums/showthread.php?t=134265592)

callimuc 01-20-2012 11:21 PM

Custom coloring system
 
I wanted to ask if itīs possible to have a custom coloring system. So I want to get rid of using this.colors[0],this.colors[1], ... and create my own system instead of that.

An example:
After some researches I have figured out that Bomy Island used/planned to use such a system with single body parts (extra shoes spritesheet, body spritesheet, ....) and for every single body part they had extra colors.
Sadly it seemd like they had to upload tons of files for the body parts in several colors.
I also want to try to do such a similar system, but I was wondering if I could have like 1 file, "find" a RGB, colors hex or HSV and change it into an other RGB, colors hex or HSV. Just like the colors changing in the default body system.
This also could give me the option to set more colors than just 5 at once.

fowlplay4 01-20-2012 11:32 PM

You'll have to use store the body/color data in ATTRs instead, you might be able to rig something with gani scripts.

It's more trouble than it's worth though.

callimuc 01-20-2012 11:38 PM

Quote:

Originally Posted by fowlplay4 (Post 1682243)
You'll have to use store the body/color data in ATTRs instead, you might be able to rig something with gani scripts.

It's more trouble than it's worth though.

So it would be better having individual images for each body part/color?

fowlplay4 01-20-2012 11:54 PM

Quote:

Originally Posted by callimuc (Post 1682245)
So it would be better having individual images for each body part/color?

I guess, if you just want more flexibility than default sprites/ganis try using the kingdoms sheets and ganis as a base instead.

Unless you have some sort of revolutionary body idea and the determination to complete it I'd work on something else.

DustyPorViva 01-21-2012 12:02 AM

You're riding the ferry into Hades.

callimuc 01-21-2012 12:03 AM

Quote:

Originally Posted by fowlplay4 (Post 1682246)
Unless you have some sort of revolutionary body idea and the determination to complete it I'd work on something else.

I wanted to try to have such a body system Bomy Island used/planned to use. I think itīs a nice thing though with all the single things, instead of bumping them into a body or adding them with an extra sheet into the ganis.

Well since it seems (almost) impossible, is there a way I can use this.colors[0] = colorname, ... on other images instead of just bodies? I think I tried that in the past but it didnīt seem to work.

fowlplay4 01-21-2012 12:14 AM

Quote:

Originally Posted by callimuc (Post 1682248)
Well since it seems (almost) impossible, is there a way I can use this.colors[0] = colorname, ... on other images instead of just bodies? I think I tried that in the past but it didnīt seem to work.

Unless you fit it all on the same BODY image, no.

Get creative and figure out what you can do.

Hezzy002 01-21-2012 09:32 PM

I did something like this using an offsite PHP server running GD that would generate a new image by replacing color indexes and send it to the client for its custom colors.

It was retarded.

DustyPorViva 01-21-2012 09:37 PM

You can do it via dividing the body segments in the gani, but it's coloring them that's a pain. Attr's themselves can be somewhat unreliable when it comes to forcing an update, and then you have to color each sprite individually. Not like... each and every instance of sprite defined in the gani(say you have an arm with 6 frames of animation, then you have it for all 4 directions, then 2 arms... that's 48 sprites just for the arms and you'd have to color each one of those separately, since you can only reference the sprite index).

callimuc 01-22-2012 01:29 AM

Quote:

Originally Posted by DustyPorViva (Post 1682333)
(say you have an arm with 6 frames of animation, then you have it for all 4 directions, then 2 arms... that's 48 sprites just for the arms and you'd have to color each one of those separately, since you can only reference the sprite index).

You forgot the different variations.

Anyway I had some ideas but actually they wouldnīt work. Well I got stuck on this one yet:
Is it somehow possible using the CHANGEIMGCOLOR, or how that command for the gani file is called, for every single sprite, to "load" the colors from the player? Maybe from the players flags, attributes or whatever?

Or can I, when I display as example a body as player.attr[1], use something like player.attr[1].red = ###; ? Iīm pretty sure it wonīt but didnīt test it yet.

Admins 01-22-2012 03:19 AM

In my point of view these things are too complex, it can be better to make a few good looking graphics and offer them in a few color variations. It can also be possible to offer a gui tool for creating a new custom graphic, with TDrawingPanel you can even do it on server-side.

DustyPorViva 01-22-2012 03:22 AM

Quote:

Originally Posted by Stefan (Post 1682355)
In my point of view these things are too complex, it can be better to make a few good looking graphics and offer them in a few color variations. It can also be possible to offer a gui tool for creating a new custom graphic, with TDrawingPanel you can even do it on server-side.

Hmm that's a good idea... Give the player the option to preview a body in a drawingpanel, customize it fully to their liking via coloring various parts, then on the serverside when the player applies it render it into a drawingpanel and save it as a custom body for the player.

edit: My only concern is if you try to do this and use the BODY value... well Graal is picky with the palette. Would saving an image created via a serverside drawingpanel have issues with the palette control, and Graal overwriting the first 6 palettes with the default values?


All times are GMT +2. The time now is 07:17 AM.

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