RimWorld

RimWorld

301 ratings
Food Texture Variety Core
3
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5, 1.6
File Size
Posted
Updated
276.458 KB
25 Oct, 2024 @ 6:43am
13 Jul @ 7:08am
24 Change Notes ( view )

Subscribe to download
Food Texture Variety Core

In 1 collection by FaintingGoat
Food Texture Variety
15 items
Description
Are your colonists tired of eating the same unidentifiable round blob day in and day out? Are you longing for some variety in their meals, without micromanaging a dozen different recipes that require a bunch of different ingredients?

This mod contains the graphics and comps class used to randomize meal textures. No content is added to the game, this mod is to support modders who want to build their own varied meals.

If you just want to have varied textures in the game, check the following out first. This is just the supporting classes and you'll want to subscribe to another module first.

Food Texture Variety Collection

Features

To use this feature, you need to include a few things in your <ThingDef>.

Include the graphic data:

<graphicData> <texPath>path/to/your/textures</texPath> <graphicClass>FoodTextureVariety.Graphic_MealVariantsExpanded</graphicClass> </graphicData>

And include the comp:

<comps> <li Class="FoodTextureVariety.CompProperties_FoodAlternateTexture" /> </comps>

Texture files need to be named a specific way. This mod does support textures by ingredients, but you need to name them very specifically for... reasons.

Experienced developers are like "oh no Goat you didn't."

Yes. I did.

Each texture will need three files.

FOLLOW THE FILE FORMAT EXACTLY AS SPECIFIED

Files need to be named <yourtextgoeshere>_<number>_<a, b, or c>

Yes, I'm serious, you'll break strict mode otherwise because I've got some hardcoding in there (for now).

There are three ways to organize textures and yes, you can mix them. In priority order, the class will select textures based on:

Ingredients

The class will look for textures with names matching the defName of the ingredient in the filename. However, I am stripping out some keywords just to make filenames a little shorter and easier to remember. For base game, I'm stripping out "Raw" and for Vanilla Expanded, I'm stripping out "VCE_Raw" which will leave you with just things like "rice" and "peas".

No case sensitivity, I'm converting everything to lowercase.

Ex: if we're making textures for rice, we'll use:

- rice_1_a (the singular meal texture)
- rice_1_b (multiple meal textures)
- rice_1_c (full stack meal textures)
- rice_2_a (the singular meal texture)
- etc

If your texture has multiple ingredients, put both in the filename. Ex: "rice_corn_1_a"

Meat gets translated into a couple types.

Chickens become "chicken"
Cows and yaks become "beef"
Pigs become "pork"
Turkeys become "turkey"
Everything else becomes "meat"

All eggs are simplified to just "egg".

Vanilla Expanded Fishing can be supported by using the keyword "fish"

If a meal has multiple ingredients, it'll gather up everything that matches for each ingredient. Place underscores between each ingredient.

Ex:

We have meal textures "meat_corn_1" and "meat_rice_1" and "rice_1".

Rice and meat - "meat_corn_1", "meat_rice_1", "rice_1"
Meat and corn - "meat_corn_1", "meat_rice_1"

Strict Mode

Currently strict mode is disabled by default. Turning it on will scope the meals by all the ingredients in a meal.

Ex:

We have meal textures "meat_corn_1" and "meat_rice_1" and "rice_1" and "meat_rice_corn_1".

Rice and meat - "meat_rice_1"
Meat and corn - "meat_corn_1"
Meat and corn and rice - "meat_rice_corn_1"
Meat and berries - nothing, will use the fallback of a random texture

Meal Type

This is mostly to support survival meals. There's three options you can use:

- vegetarian: searches for this when the meal has no meat
- carnivore: searches for this when the meal is all meat
- any: searches for this when the meal contains meat and vegetables

Ex: if we're making textures for all three, we'll use:

- vegetarian1_a (the singular meal texture)
- vegetarian1_b (multiple meal textures)
- vegetarian1_c (full stack meal textures)
- carnivore1_a
- carnivore1_b
- carnivore1_c
- any1_a
- any1_b
- any1_c

Anything

If you don't care about ingredients or whether the meal has meat or not and just want random textures, you can use any filename you want. They all go into the same bucket.

- <filernamehere>_a (the singular meal texture)
- <filenamehere>_b (multiple meal textures)
- <filenamehere>_c (full stack meal textures)

Fallback Meal

If you want to support default fallback textures for when ingredient searching can't find anything, just include a texture set containing the word "fallback". It'll select from those textures.

This is an optional setting that is not enabled by default.

Supported Mods

Supports Flavor Text!

Searches for an exact match on the new label (ex: plum preserves) and then searches for a more generic version based on the FlavorDef.

No ingredient searching is done when Flavor Text is enabled. It was giving me some confusing results during testing.

Compatibility

This mod can be added to existing saves.

I wouldn't recommend removing it later unless you feel confident in your ability to make sure nothing in the game is using these classes.

Issues

If there's an issue just follow standard bug reporting procedures. Send me a log and a description of what was going on when the error happened.

The more information you can give me, the more likely I'll be able to figure out how to recreate it and fix it. If I can't do that... then you're stuck with the bug, sorry. Help me help you.

Future Plans

None - this is actually a pretty small change and I'd like to keep it that way. Also, this is meant to be an anti-micromanaging mod, so I don't want to stuff a bunch of features into it.
42 Comments
Anny 9 Jul @ 5:24pm 
Ehhh mind if I request Bug meal?? we got cannibal meal but one last thing left is Bug
BigGovernment 9 Jul @ 8:11am 
Does this touch milk at all?
Esther_Angerin 22 Apr @ 9:33pm 
I've been using your mod for months, and it’s worked great—I really love it. However, I recently added Multifloors to my mod list, and I’ve encountered an issue. I can’t use the Multifloors pipe connector to transfer nutrient paste to the upper level (G). My farm is located on the ground level (B1), and I’ve been piping food to the upper floors.

When using your mod, the pipe connector doesn't work, and no food is getting piped to the upper floors. Would it be possible for you to create a compatibility patch for Multifloors? If not, it's not a big deal—I can simply remove the mod. I just wanted to reach out because I’d love to be able to play with both Food Texture Variety and Multifloors together.
00generator 8 Apr @ 6:18am 
@FaintingGoat Take as much time as you need to decide. Haute is just the newest add-on to the Vanilla Cooking Expanded Collection, and you probably need to do some research on its source code before starting development. Plus, work can and will take precedence over mod development at anytime.
FaintingGoat  [author] 8 Apr @ 5:30am 
@00generator - I'm not sure if I'm going to support that yet or not. They're assembling the graphics in a very different way than the base game with their own custom framework, so I don't know how that'll interact with my mod. If I do support it, it probably won't be for a little bit - I've got some work obligations that gotta take priority for the next month!
00generator 7 Apr @ 7:58am 
There is a new Vanilla Expanded Cooking add-on called Haute that has just released. it adds meals that are a step-up from Gourmet Meals that require more Condiments, Time, and Skill to prepare. Have you thought about developing a Food Texture Variety module for that?
FaintingGoat  [author] 9 Mar @ 7:06am 
@豆豆 - yeah, I see the problem you're talking about. I used the label in an attempt to make the mod easier for people to pick up and make their own version, but I didn't think about how labels get translated to other languages. I'm working on a fix to key off def name instead, which doesn't change, I should be done testing it in both English and another language here pretty quickly.

Thanks for raising this issue to me!
豆豆 9 Mar @ 3:53am 
It seems that the issue lies in the `SanitizeLabel` function, where the matching is done based on the `label`, which causes problems for languages other than English.
豆豆 8 Mar @ 10:39pm 
It seems that no ingredients detection is done now, mod only use completely random textures.when the option "Use a default generic meal texture when ingredients aren't found" is enabled, any ingredient will return the fallback texture.
thanks for the answer