Bot armor color + texture
With NPC's you can change texture and armor colors. Is this possible with bots other than having to create specific new items?
|
i've never tried. the bots display the item you give them. are you trying to change the default color of the item you give the bot?
|
Couldn't a bot version on this be added to bot.ccp?
Columns would have to be added to the botinventory or bots tables in the database because I would assume any player doing this would want it on a per bot basis. Code:
int8 Inventory::CalcMaterialFromSlot(sint16 equipslot) |
BotAddEquipItem() and BotRemoveEquipItem() call that method.
|
Quote:
Criimson |
Somewhere in there too is a color sceme for naked bots too. I skimmed though a few ccp files but couldn't come up with anything. My C++ is aweful at best. Best i could find was some armor wear stuff.
|
You know I am interested in this as well. I'll look into it soon. Right now I am focused on finishing up some bot ai, but when I am finished I will look at what can be done. Would be nice to have my rogue in all black:)
|
Criimson on a roll! Would be excellent if you can spare the time when you're not busy.
|
I looked at the DB to see how I could work this in with minimal structure changes. And am running some test code right now.
I am currently looking at a command: #bot armorcolor <slot> <color> This will write to the botinventory and alter the color column. Simple enough. Will most likely require a redying when the armor item changes, but bots require no regeants so shouldnt be an issue. My question is: Does anyone know how to translate the color ##s? For instance "4280012197" is used quite a bit. It is a 10 digit number. So it isn't R ### B ### G ### which is what I was hoping. Any ideas? I can always summon some prismatic dyes and note changes as I mess with a piece of armor and derive what is happening but figured someone would know. Criimson EDIT: I am posting some code changes to the "Server Code Submissions" section later tonight and will add this if I finish it. |
Perhaps it is hex? 0xFF1BCDA5
|
Good idea.
I'll google a hex converter for colors and test that Hmm seems hex colors use 6 digits since hex also uses a-f. Did find this site though Digital Colors I see that some are listed as ### ### ### maybe the last or first digit is a black/white level |
Georges NPC editor seems to let you edit tint settings for NPCs. It may help to figure out how the colors map. There's also a link for a color picker app that would probably be handy, but the link seems to be broken. :(
http://www.georgestools.eqemulator.net/ |
Well I have the code in place and ready to go once I figure out the color column. So far it doesnt really look like it does anything. I tested the code and change the color of my chanters robe to 1234567890. It wrote perfectly to the DB. I logged her out and back in just in case, but no visible change to the robe. Wife time, but I'll look into it more tonight.
Criimson |
Just a heads up
Lost some sleep and my wife is teasing me :rolleyes: , but I am close to having it working. Here is an image of what I have right now. http://img204.imageshack.us/img204/1508/bottint.jpg Uploaded with ImageShack.us BTW that is Highelf Cleric newbie armor so should be all green. Criimson |
Hello everyone
The code is 99% finished. Apparently uint64 isn't allowed or at least I am not getting it to work. Therefore, even though the color range is ### ### ### # the number defaults to 2billion-ish for every number higher than that. I am currently looking for alternatives. In the meantime though here is the .patch to play around with what I have. There is also an sql as I added a rule_values option for a server allowing primary secondary slots to be dyed (havent tested these yet). I also tweaked mez ai a bit (will continue to until the chanter is where I want it) and also added checks for shrink and setfollowdistance to make sure the bot belongs to the client. Code:
Index: bot.cpp Code:
INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES (1, 'Bots:DyedSecondary', '0', 'Allow dying of Secondary Slot (ie shields) 0 - off 1- on'); EDIT: I have gotten purply orange green blue black white so might leave as is - would appreciate feedback on what might be needed or done As seen here: http://img196.imageshack.us/img196/5008/botsga.jpg Uploaded with ImageShack.us |
After more color tests - the colors are fine the way they are. Unsure why but they do work on a ### ### ### style format. It takes time to get a feel for the color shifts because as far as I can tell it isnt an exact 0-255 for each set of ### but it seems it is close.
So for instance it going R### G### B###: 000 000 050 (just type 50 for color) is a blue 000 000 000 is a deep black....way darker then sony ever allowed. Easiest to get a sense of where ya want to be by picking a number like 50 then adding a digit 500, 5000, 5000 etc and youll see the colors change and will give you a place to start. Don't think coloring weaps and shields is possible at this time so removing sql from submission for now |
You don't need an int64 to hold a color, they are 24 bits and fit just fine in an int.
Try something like this. I didn't compile it, but you should be able to get the idea from it. Code:
if(!strcasecmp(sep->arg[1], "armorcolor")) { 1) Change Bot::GetID to be const, don't make a new function that does exactly the same thing. 2) You don't need to use Bot::GetEquipmentColor() to call your function, just GetEquipmetColor() will call it. 3) You don't need Bot::SendWearChange at all. It's just a copy of Mob::SendWearChange. |
Quote:
Running tests right now. Criimson |
Sorry, I made a typo in the original code.
Here are the two corrected bits. Code:
uint32 setcolor = (red << 16) | (green << 8) | blue; |
Well the code as written doesn't work. It returns 1 no matter what is entered.
Will keep testing and trying to figure it out Being able to enter RGB would be nice. AFter looking at a couple of websites on color in code I was wondering does EQ use RGB or ARGB? EDIT: didnt see your reply will look into it Good sites: http://www.codeproject.com/KB/graphics/color.aspx http://developer.android.com/referen...ics/Color.html |
Yeah, sorry about the errors. Editing in the reply window is a pain. :(
The colors themselves are just RGB. I'm not sure what the high byte is actually used for, but if you look at Mob::SetSlotTint it seems like the client either expects a 0 for no color, or 0xff for any color. I don't know if any other value might work there. I'd guess the current value was found through either trial and error or packet collects to make the client happy. |
I have to say: lerxst2112 you are great
I really appreciate all of the help while I learn. I am too stubborn to say I can't do it or learn it and its nice to have someone help when stuck. Your code works great. I had to remove the Code:
if(setcolor) { Criimson EDIT: yea using this RGB system is nice. I sat there for like 5 minutes just testing it on my enchanter, watching her rob change |
Yes, when examined as an integer that will be a negative number, but the reality is that the colors are 4 separate bytes, so displaying it as one int doesn't make sense.
If it works without that then I guess it's fine, but the other code that manipulates colors does do it that way. If you need to display the color you could extract the values again and display that. Something like this assuming the color variable is named color. Code:
uint8 red = (color >> 16) & 0xff; I'm glad it works, and I hope you enjoy your colorful bots. :) |
The check was already there but written differently. For some reason when I compiled with your check it would hang on that and not except any input. So I just went with my original check.
And yea its nice to be able to say I want my druid in green and not have to hunt through tons of almost random numbers to find a shade close. Now its "I want this color" and wham |
Hey wow you guys took it and ran with it. I am hoping I get some time soon to check this stuff out too. Great job guys.
|
Quote:
|
All times are GMT -4. The time now is 11:36 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.