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 07-29-2013, 08:04 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
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.
__________________
Reply With Quote
  #2  
Old 07-30-2013, 02:37 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Generate car images or ganis as needed.

My GANI manipulation class works pretty well: http://forums.graalonline.com/forums...hp?t=134261809
__________________
Quote:
Reply With Quote
  #3  
Old 07-30-2013, 02:38 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
I probably would have created an image for each player similar to personal heads/bodies and save it like 'era_personalcar-ACCOUNT.png'
__________________
MEEP!
Reply With Quote
  #4  
Old 07-30-2013, 03:03 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Ya, slap dat ***** into a drawingpanel and render it all night long.
Reply With Quote
  #5  
Old 07-30-2013, 08:35 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
  #6  
Old 07-30-2013, 10:46 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
Quote:
Originally Posted by Stefan View Post
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.
__________________

Last edited by Tim_Rocks; 07-31-2013 at 12:44 AM..
Reply With Quote
  #7  
Old 07-31-2013, 02:52 AM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
Quote:
Originally Posted by Stefan View Post
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...
Reply With Quote
  #8  
Old 07-31-2013, 03:03 AM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
Quote:
Originally Posted by devilsknite1 View Post
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.
__________________
Reply With Quote
  #9  
Old 07-31-2013, 06:20 AM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
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.
Reply With Quote
  #10  
Old 07-31-2013, 10:35 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Quote:
Originally Posted by devilsknite1 View Post
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.
Reply With Quote
  #11  
Old 07-31-2013, 11:28 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
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..
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #12  
Old 07-31-2013, 02:45 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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
__________________

Last edited by cbk1994; 07-31-2013 at 03:28 PM..
Reply With Quote
  #13  
Old 07-31-2013, 03:32 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by BlueMelon View Post
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.
Reply With Quote
  #14  
Old 07-31-2013, 03:44 PM
Stephen Stephen is offline
Boom!
Stephen's Avatar
Join Date: May 2004
Location: San Francisco
Posts: 10,410
Stephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud of
Quote:
Originally Posted by cbk1994 View Post
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.
__________________
Reply With Quote
  #15  
Old 07-31-2013, 03:56 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by cbk1994 View Post
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.
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 09:17 AM.


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