How to create prototypes without quality?

Place to get help with not working mods / modding interface.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1756
Joined: Sun Oct 14, 2018 8:13 am
Contact:

How to create prototypes without quality?

Post by Pi-C »

Is there a way to define a prototype that won't have quality (or will just have quality 'normal'). In my mod Autodrive, I have several BatteryEquipmentPrototypes where quality just doesn't make sense. My equipment (so-called 'sensors') doesn't do anything on its own, it just serves as a kind of flag for my mod: If a certain sensor is found in a vehicle's equipment grid, some additional code is run (for reloading vehicle weapons, refueling vehicle and other vehicle equipment, etc.). Quality may be useful for some equipment (e.g. higher quality personal batteries storing more energy than batteries of lower quality), but if people tried to craft, say, a legendary fuel sensor they'd just waste their legendary items.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
eugenekay
Filter Inserter
Filter Inserter
Posts: 541
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: How to create prototypes without quality?

Post by eugenekay »

I think you just need to set RecipePrototype - allow_quality to "False" to prevent Quality Modules' usage? This is done for Oil Processing Recipes only; I'm not sure if there's extra logic anywhere else to catch all-fluid recipes in Mods... It is still possible to manually pick a higher-tier-ingredient for such recipes.

If you really want to prevent these items from occurring "accidentally", you might be able to use an on_tick handler to find any Machines with these recipes, and take action on them (change the recipe to Normal quality, and/or display a Message)... This is probably more trouble than just letting the Users make a uselessly Legenedary item.


Good Luck!
Pi-C
Smart Inserter
Smart Inserter
Posts: 1756
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: How to create prototypes without quality?

Post by Pi-C »

Thanks a lot! Yes, makes sense to set this in recipes, not in whatever the recipes produce. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Post Reply

Return to “Modding help”