Page 1 of 1

Modifying attributes of vanuilla items

Posted: Sat Sep 17, 2016 8:11 pm
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?

Re: Modifying attributes of vanuilla items

Posted: Sat Sep 17, 2016 8:41 pm
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

Re: Modifying attributes of vanuilla items

Posted: Tue Sep 20, 2016 6:18 am
by DRT99
This is incredibly helpful, thank you so much!