Modding Help: How to Overwrite a Vanilla Item

Hello, as the title says I’m looking for some help for overwriting a vanilla item, so that when my mod is in use it will read my variant of the item.

Example being I’m trying to make it so when my martial arts mod is being used it replaces some values of the weapons my martial arts use.

Thank you for any help you can give in advance.

Well, the quick answer would be: Use the same id of whatever item you want to overwrite, change the parameters you like, and it will do so automatically when your mod loads.

For example, defining this somewhere in your mod:

  {
    "id": "bio_armor_eyes",
    "copy-from": "bio_armor_eyes",
    "type": "BIONIC_ITEM",
    "name": { "str": "Better Protective Lenses CBM" },
    "weight": "10 g",
    "difficulty": 1
  },

…will overwrite the base game Protective Lenses CBM with your own definition (if your mod is loaded into the world), where the item only weighs 10 gram (instead of 500) and has a installation difficulty of 1 (instead of 5)… and has a fancy new name.

For the long answer on how to properly mod, I’d highly suggest you take a look at the modding guide on the game’s GitHub page:

2 Likes

Thank you very much for the VERY efficient answer!

1 Like

I really need to add a section on copy-from to the Guide. It’s too much to ask that you’d be willing to write one, isn’t it?

2 Likes

Yes… yes it is.

Sigh…

I have a bit of a weather related headache right now, so I wasn’t able to include everything I would have liked to, but it’s a start.

Here’s what I have so far (I did not proofread it, but I’ve tested the code against 0.E-3 and whatever more or less current experimental build I had).
I’ve also created a text file so it keeps the formatting.

Edit: Dead links removed. You can now visit the page on the official wiki.

1 Like

Thank you so much! I’ve added it to the Guide.

2 Likes