Change Item Crafting Speed?

Place to get help with not working mods / modding interface.
User avatar
metzyn
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 19, 2013 10:49 pm
Contact:

Change Item Crafting Speed?

Post by metzyn »

How can I change the crafting speed of new items I've made for my mod?
Factorio Modder
Solar Expansion
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Change Item Crafting Speed?

Post by FreeER »

Ever notice the energy_required = line in recipes? While I don't know what the default (the speed of basic transport belt crafting) is basic bullets are 2, red science packs are 5, green packs are 10, and blue 20. That should give you enough of an idea to let you decide how fast you want your items crafted.
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net
kovarex
Factorio Staff
Factorio Staff
Posts: 8293
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Change Item Crafting Speed?

Post by kovarex »

User avatar
metzyn
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 19, 2013 10:49 pm
Contact:

Re: Change Item Crafting Speed?

Post by metzyn »

Oh, sweet! Thank you! Calling it "energy_required" is a little misleading if its not in reference to a furnace or automated crafting thingy. But I get it now so that works!
Factorio Modder
Solar Expansion
User avatar
Animar
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sat Dec 21, 2013 8:06 am
Contact:

Re: Change Item Crafting Speed?

Post by Animar »

Maybe i'm doing someting wrong here i set energy_required up to 20 and my items are still instand crafted ?

Code: Select all

{
    type = "recipe",
    name = "shell",
    enabled = "false",
    energy_required = 20,
    ingredients = 
    {
      {"iron-plate",4},
	  {"copper-plate", 2},
      {"steel-plate", 2},
      {"coal", 10}
    },
    result = "shell"
}
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Change Item Crafting Speed?

Post by ficolas »

Thats something that has been bugging me for some time, I asked about it some time ago, and I think it is a bug now that you also experience it.

When I added for first time a recipe, it was instacrafting, and I noticed energy_required was really low, so I raised it, and nothing happened, I asked in the forums but nope, and when I reinstalled factorio totally because of an update, and then it worked fine w/o changing anything.
kovarex
Factorio Staff
Factorio Staff
Posts: 8293
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Change Item Crafting Speed?

Post by kovarex »

I believe, that it will affect new games.
For existing saves you need to write

Code: Select all

game.player.force.reloadrecipes()
or

Code: Select all

game.player.force.recipes["shell"].reload()
To copy the new recipe properties to the player recipes.
User avatar
Animar
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sat Dec 21, 2013 8:06 am
Contact:

Re: Change Item Crafting Speed?

Post by Animar »

Nope even deleting and reistalling Factorio solves that issue, quiet anoying
kovarex
Factorio Staff
Factorio Staff
Posts: 8293
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Change Item Crafting Speed?

Post by kovarex »

Animar wrote:Nope even deleting and reistalling Factorio solves that issue, quiet anoying
That is strange, I never encountered problem that would need to reinstall the whole Factorio.
So you are saying that when you change it and start new game, the old value is there, then you reinstall factorio, put the same mod there again, and it works correctly?
User avatar
Animar
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sat Dec 21, 2013 8:06 am
Contact:

Re: Change Item Crafting Speed?

Post by Animar »

And now it works just fine with

Code: Select all

   game.reloadscript()
game.player.force.resettechnologies()
game.player.force.resetrecipes() 
thanks a lot, didn't even thought about reset thingy
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Change Item Crafting Speed?

Post by ficolas »

Well not sure if reinstalling factorio really solves it, what I did was installing it in a different computer (maybe what is causing that is saved somewhere)
I didnt report it because I had the issue and I bought a new pc, and I didnt have the issue so I forgot.
Post Reply

Return to “Modding help”