How does the beer texture work?

Started by Fluff_Thorrent, March 08, 2015, 05:58:00 PM

Previous topic - Next topic

Fluff_Thorrent

Hello forums  :)

I'm currently working on a mod which will add some new alcoholic spirits and brews. It's based in Alpha 9e. Everything has gone smoothly with some minor fixes here and there.

Now I've started to implement my own art assets, and I looked at the assets for Beer extracted from the "resources" folder, available from the stickied art source thread started by Tynan. There are two images there, "Beer_a.tex" and "Beer_b.tex". In the .xml file "Items_Drugs" the graphicPath for Beer is "Things/Item/Drug/Beer", and so I figured that in order to replicate this file relation I'd need to write my items with paths like "Things/Item/Drug/Vodka", and name the image files "Vodka_a" and "Vodka_b", etc.

When I launch RimWorld having followed this logic, the main menu log throws an error stating that the "Vodka_a" and "Vodka_b" files are loaded but not used in any active mods or base resources. I understand from reading again on the Modding section of the wiki that the files need to have their full name stated (extension excluded) in the texture path, but then how can the native Beer object have an accepted path at "Things/Item/Drug/Beer"? Does it generate "Beer_a" and "Beer_b" at runtime or is there some other mechanic at work there?

Thanks for giving this a read!

PS. To clarify, the two images, "Beer_a" and "Beer_b" depict a single bottle and five bottles of beer, respectively.

Fluff_Thorrent

UPDATE:
Hah! As it turns out, "Things/Item/Drug/Beer" refers to a folder called Beer, not the actual assets. By putting my "Vodka_a" and "Vodka_b" images in a folder named Vodka, so as to correspond to the path "Things/Item/Drug/Vodka", I could launch the game without receiving any errors ;-) the assets show up in-game and are used in the same way as the Beer images - "Name_a" is used when showing a single bottle in a stack, and "Name_b" is used for all counts from 2 to 25 (or whichever number you set as the item's stackLimit).

Hopefully my foray into this will enlighten future modders :P