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

Place to get help with not working mods / modding interface.
Shiny_Martin
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Sep 26, 2016 11:41 am
Contact:

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

Post 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!
Last edited by Shiny_Martin on Tue Oct 04, 2016 7:49 am, edited 1 time in total.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: My Entity in existing Technology, path?!

Post by Nexela »

99% sure the problem is the name. Rename your entity/recipe etc to remove the period

assembling-machine-1.1

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

Re: My Entity in existing Technology, path?!

Post 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.
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.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: My Entity in existing Technology, path?!

Post 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

Shiny_Martin
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Sep 26, 2016 11:41 am
Contact:

Re: My Entity in existing Technology, path?!

Post 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
  }
  })

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3713
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: My Entity in existing Technology, path?!

Post 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.

Shiny_Martin
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Sep 26, 2016 11:41 am
Contact:

Re: My Entity in existing Technology, path?!

Post 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

Post Reply

Return to “Modding help”