Page 1 of 1

Change Item Crafting Speed?

Posted: Wed May 22, 2013 5:37 am
by metzyn
How can I change the crafting speed of new items I've made for my mod?

Re: Change Item Crafting Speed?

Posted: Wed May 22, 2013 6:53 am
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.

Re: Change Item Crafting Speed?

Posted: Wed May 22, 2013 9:18 am
by kovarex

Re: Change Item Crafting Speed?

Posted: Wed May 22, 2013 12:59 pm
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!

Re: Change Item Crafting Speed?

Posted: Sat Dec 21, 2013 9:38 am
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"
}

Re: Change Item Crafting Speed?

Posted: Sat Dec 21, 2013 10:40 am
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.

Re: Change Item Crafting Speed?

Posted: Sat Dec 21, 2013 10:53 am
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.

Re: Change Item Crafting Speed?

Posted: Sat Dec 21, 2013 10:56 am
by Animar
Nope even deleting and reistalling Factorio solves that issue, quiet anoying

Re: Change Item Crafting Speed?

Posted: Sat Dec 21, 2013 11:03 am
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?

Re: Change Item Crafting Speed?

Posted: Sat Dec 21, 2013 11:16 am
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

Re: Change Item Crafting Speed?

Posted: Sun Dec 22, 2013 5:57 pm
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.