Page 1 of 1

Creating Player Only Equipment

Posted: Sun Mar 03, 2024 2:32 am
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!

Re: Creating Player Only Equipment

Posted: Sun Mar 03, 2024 4:06 am
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.

Re: Creating Player Only Equipment

Posted: Sun Mar 03, 2024 5:55 pm
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?

Re: Creating Player Only Equipment

Posted: Sun Mar 03, 2024 9:16 pm
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!)

Re: Creating Player Only Equipment

Posted: Sun Mar 03, 2024 11:04 pm
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.

Re: Creating Player Only Equipment

Posted: Tue Mar 05, 2024 7:25 pm
by Pikachar
Thanks for the information. That helped a ton!