HippieStationArchive / HippieStation13-1

https://github.com/HippieStation/HippieStation13
https://github.com/HippieStation/HippieStation13
GNU Affero General Public License v3.0
28 stars 92 forks source link

Dying gloves with mime crayon using the washing machine doesn't work #2720

Open Vagak opened 8 years ago

Vagak commented 8 years ago

In older versions of the code, the mime crayon would normally dye the gloves either white or black, depending on the color you chosen. It doesn't work here.

I want to be stylish with my shock resistant insulated gloves while being the mime.

JohnGinnane commented 8 years ago

Caused by the item.color being set to crayon.colourName:

Washing machine code: https://github.com/HippieStationCode/HippieStation13/blob/db1d32d94f58212d71eb989fdee9a724f998da19/code/game/machinery/washing_machine.dm#L75

Mime crayon code: https://github.com/HippieStationCode/HippieStation13/blob/5462010e5bcc8a61ad5618ffd0f04f07eeb570b0/code/game/objects/items/crayons.dm#L40

Possible solution: Can't we colour items using the hexidecimal code rather than using a word (e.g. #FF0000 instead of "red"). This way both mime and rainbow crayons can also change the colour of items

JohnGinnane commented 8 years ago

Mime's "colourName" is set to "mime", whereas other crayons' "colourName" is set to the colour of the crayon (e.g. crayon/red colourName = "red")

The other possible solution is to set colourName to "black" or "white" when you change the colour in the mime crayon, however I don't know if anything else relies on colourName when it comes to crayon code. And we'd have to do the same for the rainbow crayon, and support all the various colours it can do

ghost commented 8 years ago

I was pretty sure the mime crayon turned items into the 'mimes' version. Same as the clown crayon.

I recently also tried colouring a pair of noslips and that didn't work.

Pretty sure washing is just fucked.

JohnGinnane commented 8 years ago

Did you use normal crayon or mime/clown?

ghost commented 8 years ago

I don't rightly recall if I'm honest.

I'll test on carbon's testserb, give me a sec.

ghost commented 8 years ago

Okay here it is: image

Names on examine from top left to right: Mime Jumpsuit, Rainbow Jumpsuit, Green Cap Red Bandanna, Yellow Jumpsuit, Blue Shoes

So it does change the name, 'special' crayons dont work, and the sprites look like shit. They're just as oversaturated when worn too.

JohnGinnane commented 8 years ago

If you look at the washing machine code above it just applies a color on top of the sprite, so if you recoloured a red object with a green crayon it ends up ugly brown

Vagak commented 8 years ago

http://i.imgur.com/K2BYwau.png

Okay, this just seems to be a problem with dying gloves in general. Insulated gloves. You used to be able to just disguise them as white gloves, but not anymore.

I did this with a white crayon too.

ghost commented 8 years ago

I'm almost certain that at one point it used to switch the sprite and name to match another existing item. For example instead of just adding a blue overlay to shoes, it made them into a pair of Blue Shoes.

That was a much better way of doing shit.

Carbonhell commented 8 years ago

No it's not, due to having to create a sprite for each color, this way is way better and should be easy to fix

ghost commented 8 years ago

The previous system actually had uses, this one is probably more robust in terms of code, but amounts to an essentially pointless ability that nobody ever uses. It's also bugged to fuck with mime and clown crayons.

Edit: Don't we already have an item for each crayon colour anyway?

JohnGinnane commented 8 years ago

We have some colours, but not all. The original plan was to check to see if the icon existed, if so it would change it to that.

As for setting it white, that's just the colour the icon has, which means even though it's a yellow glove, the colour filter is #FFFFFF (white). The current code means you can colour almost every single piece of clothing, albeit poorly.

JohnGinnane commented 8 years ago

Here's the PR where I changed this: https://github.com/HippieStationCode/HippieStation13/pull/2065

JohnGinnane commented 8 years ago

Is it absolutely not possible to check if an icon_state is valid or not? It would mean we could change that first (if a pair of white gloves exist for example), before falling back on the uglier method of just applying a colour filter on top of the current icon

JohnGinnane commented 8 years ago

After some digging I found that this was changed by Crystal in Oct 2015. Here's the code just before: https://github.com/HippieStationCode/HippieStation13/blob/38a9317b27de24a1445eddddb87cb919d859054e/code/game/machinery/washing_machine.dm#L67 and after: https://github.com/HippieStationCode/HippieStation13/blob/8f498542adfca178a21a614c502becdc2154c12f/code/game/machinery/washing_machine.dm#L64

The old code was very snowflakey, but it was much prettier