Restrict equipment to certain vehicles

Place to get help with not working mods / modding interface.
yeahtoast
Inserter
Inserter
Posts: 21
Joined: Wed Feb 27, 2019 6:17 pm
Contact:

Restrict equipment to certain vehicles

Post by yeahtoast »

I'm having an issue figuring out how to force new equipment items into being placed only in certain vehicles. Is this a property of the equipment-grid, or the equipment category, or the equipment item itself? Digging through mods where this has been accomplished has yielded no obvious solutions.

e.g. I want the recipe tooltip to say "Placed in: [locomotive icon]", rather than in every single vehicle and power armor. What's the best way to go about this?
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Restrict equipment to certain vehicles

Post by eradicator »

You have to set matching categories on both the equipment and the grid prototypes.

https://wiki.factorio.com/Prototype/Equ ... categories
https://wiki.factorio.com/Prototype/Equ ... categories
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
yeahtoast
Inserter
Inserter
Posts: 21
Joined: Wed Feb 27, 2019 6:17 pm
Contact:

Re: Restrict equipment to certain vehicles

Post by yeahtoast »

Hmmm, I think this is already the case for my grid and equipment but I'll double check. How does this set the item to be vehicle specific? The grid has to be linked somehow to the vehicle prototype, right?
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Restrict equipment to certain vehicles

Post by eradicator »

Yes, the vehicle prototype defines the name of the grid prototype it uses:
https://wiki.factorio.com/Prototype/Veh ... pment_grid
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Post Reply

Return to “Modding help”