Page 1 of 1

[solved] My Entity in existing Technology, path?!

Posted: Mon Oct 03, 2016 6:35 pm
by Shiny_Martin
I am currently attempting to add my own entity to a existing technology. I've tried searching for an aswer and this is the code I found and my attempt.

Code: Select all

table.insert(data.raw["technology"]["automation-2"].effects, {type = "unlock-recipe",recipe = "assembling-machine-1.1"})
The error message I get when I launch the game is following:
Error
Error in assignID, recepie with name "assembling-machine-1.1" does not exist.


My recipe does exist. I've even copied the name to be certain.
Though if I change the code to unlock a recipe existing in the base, it works. Example of that code:

Code: Select all

table.insert(data.raw["technology"]["automation-2"].effects, {type = "unlock-recipe",recipe = "player-port"})
This is my data.lua:

Code: Select all

require ("prototype.item")
require ("prototype.entity")
require ("prototype.recipe")
table.insert(data.raw["technology"]["automation-2"].effects, {type = "unlock-recipe",recipe = "assembling-machine-1.1"})
What do I need to change?
Thanks in advance!

Re: My Entity in existing Technology, path?!

Posted: Mon Oct 03, 2016 6:59 pm
by Nexela
99% sure the problem is the name. Rename your entity/recipe etc to remove the period

assembling-machine-1.1

Re: My Entity in existing Technology, path?!

Posted: Mon Oct 03, 2016 6:59 pm
by aubergine18
What does your recipe code look like? It seems that's where problem is but it's only bit of code you've not shown.

Re: My Entity in existing Technology, path?!

Posted: Mon Oct 03, 2016 7:37 pm
by Nexela
aubergine18 wrote:What does your recipe code look like? It seems that's where problem is but it's only bit of code you've not shown.
something along the lines of this is what is probably happening

name = "assembling-machine-1.1" --->

data.raw.item["assembling-machine-1"].1

Re: My Entity in existing Technology, path?!

Posted: Mon Oct 03, 2016 8:44 pm
by Shiny_Martin
I did try to rename it to assembling-machine-1-1 with no success. The recipie code below:

Code: Select all

data:extend({
{
    type = "recipe",
    name = "assembling-machine-1.1",
    enabled = true,
    ingredients =
    {
      {"assembling-machine-1", 1},
      {"electronic-circuit", 5},
	  {"iron-gear-wheel", 5},
	  {"iron-plate", 5},
    },
    result = "assembling-machine-1.1",
    requester_paste_multiplier = 4
  }
  })

Re: My Entity in existing Technology, path?!

Posted: Mon Oct 03, 2016 10:26 pm
by DaveMcW
Shiny_Martin wrote:I did try to rename it to assembling-machine-1-1 with no success.
Try "assembling-machine-shiny-1". The game does not like double 1's.

Re: My Entity in existing Technology, path?!

Posted: Tue Oct 04, 2016 7:48 am
by Shiny_Martin
DaveMcW wrote:
Shiny_Martin wrote:I did try to rename it to assembling-machine-1-1 with no success.
Try "assembling-machine-shiny-1". The game does not like double 1's.
Guess what? I changed the name to assembling-machine-1one...
And it worked!

Thank you! :D