Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   What are my options? (https://forums.graalonline.com/forums/showthread.php?t=134268536)

Tim_Rocks 07-29-2013 08:04 PM

What are my options?
 
Here's what I'm trying to accomplish; I'm working with Sage to create a vehicle that is fully customizable, so far everything looks great. There's only one problem. I'm wondering what my options are when it comes to displaying the car for others to see. As of now, we have the car setup to display from this.attr[2]. I'm just not sure how to go about getting the actual body of the car to change color other than using COLOREFFECT in the gani; which would require me to make multiple ganis for each color. Any ideas or thoughts would be helpful. Thanks.

fowlplay4 07-30-2013 02:37 AM

Generate car images or ganis as needed.

My GANI manipulation class works pretty well: http://forums.graalonline.com/forums...hp?t=134261809

callimuc 07-30-2013 02:38 PM

I probably would have created an image for each player similar to personal heads/bodies and save it like 'era_personalcar-ACCOUNT.png'

DustyPorViva 07-30-2013 03:03 PM

Ya, slap dat ***** into a drawingpanel and render it all night long.

Admins 07-30-2013 08:35 PM

Using different graphics for different colors would be best I think. On Era (iPhone) only a single graphic is used which is then rotated by gani.

Tim_Rocks 07-30-2013 10:46 PM

Quote:

Originally Posted by Stefan (Post 1721238)
Using different graphics for different colors would be best I think. On Era (iPhone) only a single graphic is used which is then rotated by gani.

We have the same system on Era. What I'm going for is to have something that a player can customize.

Basically a way for me to change the r/g/b of attr[2].. Jerrets way may be the only option though.

devilsknite1 07-31-2013 02:52 AM

Quote:

Originally Posted by Stefan (Post 1721238)
Using different graphics for different colors would be best I think.

If you wanted to get a bit more into customization, you could create separate sprites for each part of the car, then compile them into an animation. You could then handle the customization by editing a cloned version of the original gani, organized by something similar to what callimuc suggested. Would be somewhat tedious, but after the initial step the rest would become fairly easy. Would just have to change the file names of the sprites in the animation and reload it, I think. Though you may see a lot of players with some pretty interesting colored cars...

Tim_Rocks 07-31-2013 03:03 AM

Quote:

Originally Posted by devilsknite1 (Post 1721248)
If you wanted to get a bit more into customization, you could create separate sprites for each part of the car, then compile them into an animation. You could then handle the customization by editing a cloned version of the original gani, organized by something similar to what callimuc suggested. Would be somewhat tedious, but after the initial step the rest would become fairly easy. Would just have to change the file names of the sprites in the animation and reload it, I think. Though you may see a lot of players with some pretty interesting colored cars...

I already did all of that, the problem I am having is a simple way to change the color of the vehicle.. Obviously that's not going to work from what I'm getting out of this. Seems like Jer's way is going to be the best option.

devilsknite1 07-31-2013 06:20 AM

Well what I meant by separate sprites is have different color image parts for each, which is what I think Stefan was suggesting essentially. That way the player could choose a color, and you would just have to edit the gani via script to replace the red sprite for the door with the blue sprite for the door. Unless you want a variety of different shades of r/g/b, having a graphics person make a few different shades of each color may be a plausible method.

Other than that, Jer's is probably the best method. I was typing that you could just set an overlay attribute to the NPC, but I'm not so sure how well that would work as it's the animation itself you're wanting to edit.

Cubical 07-31-2013 10:35 AM

Quote:

Originally Posted by devilsknite1 (Post 1721255)
Well what I meant by separate sprites is have different color image parts for each, which is what I think Stefan was suggesting essentially. That way the player could choose a color, and you would just have to edit the gani via script to replace the red sprite for the door with the blue sprite for the door. Unless you want a variety of different shades of r/g/b, having a graphics person make a few different shades of each color may be a plausible method.

You don't need to edit the gani script every time you change a part, just pass a few parameters to the gani such as graphics names or RGB values.

BlueMelon 07-31-2013 11:28 AM

I think some are missing the point in which Tim is trying to explain,

Say we have a white car sprite. We would like to make that car any color on the RGB table. One option could be customizing with a color picker UI...

Multiple sprites is obvious and what is already in use, but it's limiting on the customization aspect. Also, who wants to make 100 sprites for colored cars..

cbk1994 07-31-2013 02:45 PM

You can change the colors (RGBA) of a sprite in a GANI from inside the GANI script, similar to the way you do rotation. If memory serves, just use findImage(sprite_idx).red/green/blue from inside the script.

edit: look at Chris/car on Era, I threw together a proof-of-concept with color changing

DustyPorViva 07-31-2013 03:32 PM

Quote:

Originally Posted by BlueMelon (Post 1721260)
I think some are missing the point in which Tim is trying to explain,

Say we have a white car sprite. We would like to make that car any color on the RGB table. One option could be customizing with a color picker UI...

Multiple sprites is obvious and what is already in use, but it's limiting on the customization aspect. Also, who wants to make 100 sprites for colored cars..

That is why it was suggested that you allow players to customize their car in a drawingpanel. Set up an interface to display the car template in the drawingpanel, and overlay the customizations/colors and such over top of the template. When the player saves, you can just send the server the customizations(files/colors/whatever else) and then create a serverside drawingpanel and fill in the information and save for a new image. Alternatively you can save the clientside drawingpanel to the players folder and upload that file itself to the server.

In the end with this method you can allow as many customized sprites as you want and still only end up with one single image file for the car.

Stephen 07-31-2013 03:44 PM

Quote:

Originally Posted by cbk1994 (Post 1721264)
You can change the colors (RGBA) of a sprite in a GANI from inside the GANI script, similar to the way you do rotation. If memory serves, just use findImage(sprite_idx).red/green/blue from inside the script.

edit: look at Chris/car on Era, I threw together a proof-of-concept with color changing

I was assuming this was the best option, but I was also thinking that I should keep my inexperienced mouth shut.
http://www.promoboxx.com/blog/wp-con..._you_know.jpeg

DustyPorViva 07-31-2013 03:56 PM

Quote:

Originally Posted by cbk1994 (Post 1721264)
You can change the colors (RGBA) of a sprite in a GANI from inside the GANI script, similar to the way you do rotation. If memory serves, just use findImage(sprite_idx).red/green/blue from inside the script.

edit: look at Chris/car on Era, I threw together a proof-of-concept with color changing

I use this for rotating sprites in ganis, but I have noticed sometimes other player sprites sometimes don't get rotated. I couldn't really narrow down why it wasn't properly applying the script though.


All times are GMT +2. The time now is 04:53 AM.

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