Modifying attributes of vanuilla items

Place to get help with not working mods / modding interface.
Post Reply
DRT99
Inserter
Inserter
Posts: 25
Joined: Mon Jul 11, 2016 5:11 pm
Contact:

Modifying attributes of vanuilla items

Post by DRT99 »

So bear with me here because i have absolutely no experience with making mods and at best kindergarden levels if experience with writing code.

So im trying to write a mod that changes some values for vanilla items. I've poked around in some other mods and I think i understand how to add an attribute to something, such as a fuel value, but not to change it.

In this case, i want to make changes to an item, a projectile and a recipe, without introducing new items.

I've watched klonan's modding tutorial on youtube (helpful but doesn't really cover what i'm trying to do) and read over some of the modding tutorials on the wiki and the forum but i'm still absolutely lost. Can anyone point me to some other good resources for modding factorio?

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Modifying attributes of vanuilla items

Post by aubergine18 »

You can access the existing stuff by creating a `data.lua`in your mod then accessing the existing prototypes via `data.raw`.

For example, all the recipes are stored on `data.raw.recipe`.

If it's any help, I just dumped everything in data.raw to a text file that you can see online:

https://raw.githubusercontent.com/auber ... r/data.raw

If you wanted to change the charge cooldown of that accumulator at the top, you'd do:

Code: Select all

data.raw.accumulator.accumulator.charge_cooldown = 40
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

DRT99
Inserter
Inserter
Posts: 25
Joined: Mon Jul 11, 2016 5:11 pm
Contact:

Re: Modifying attributes of vanuilla items

Post by DRT99 »

This is incredibly helpful, thank you so much!

Post Reply

Return to “Modding help”