Creating Player Only Equipment

Place to get help with not working mods / modding interface.
Post Reply
Pikachar
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Apr 19, 2023 9:16 pm
Contact:

Creating Player Only Equipment

Post by Pikachar »

I'm currently working on an equipment mod that I think would be better off if I just removed the ability for it to be placed in vehicle grids. I was wondering if anyone had any insight as to what I should be looking into or how to accomplish this. I know the jetpack mod does this, and through my cursory scan of the lua files for it I have not seen (or I completely missed it) how it accomplishes not allowing jetpacks in vehicle grids.

I appreciate any and all help/insight.

Hope whoever is reading this is having a great day!

User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 490
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: Creating Player Only Equipment

Post by Silari »

Equipment placement is based on the categories of the equipment and the grid - if any category is shared between them, it can fit.

So basically you'd want to make a new category just for your equipment, then find all the equipment grid prototypes used in people armor and add that category to it. Since the vehicle grids don't have that category, they can't.

Pikachar
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Apr 19, 2023 9:16 pm
Contact:

Re: Creating Player Only Equipment

Post by Pikachar »

I'd likely need to do this during the prototype stage in order to add that category to all of the equipment_grids in armor. I thought the prototype stage was literally just using the data.lua file to hardcode, well, data. Is there some way, or am I allowed to put logic in that file?

Qon
Smart Inserter
Smart Inserter
Posts: 2118
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Creating Player Only Equipment

Post by Qon »

data.lua is a lua file. It's executed as lua like any other lua code. The difference between data.lua and control.lua is what API's are available (and when it is executed).
Put as much logic in it as you want. Read the API docs to learn more (link at top of the website!)

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2550
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Creating Player Only Equipment

Post by FuryoftheStars »

Qon wrote:
Sun Mar 03, 2024 9:16 pm
Read the API docs to learn more (link at top of the website!)
I think this deserves stressing as in the prototype stage there are 3 different data lua files that get executed at different times.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

Pikachar
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Apr 19, 2023 9:16 pm
Contact:

Re: Creating Player Only Equipment

Post by Pikachar »

Thanks for the information. That helped a ton!

Post Reply

Return to “Modding help”