No such node error

Place to get help with not working mods / modding interface.
Post Reply
chernosliv
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Aug 01, 2015 2:31 am
Contact:

No such node error

Post by chernosliv »

Hello! Trying to make colouring entities with (Tint) - it`s faster then hand painting, and get an ''error while loading entity prototype ''advanced-accumulator''(accumulator); No such node (filename)
Here is content of file;
function Accumulators(Tint)
return {
picture =
{
filename = "__base__/graphics/entity/basic-accumulator/basic-accumulator.png",
priority = "extra-high",
width = 124,
height = 103,
shift = {0.7, -0.2},
tint = Tint
}
}
end

function AccumulatorsCharge(Tint)
return {
charge_animation =
{
filename = "__base__/graphics/entity/basic-accumulator/basic-accumulator-charge-animation.png",
width = 138,
height = 135,
line_length = 8,
frame_count = 24,
shift = {0.482, -0.638},
animation_speed = 0.5,
tint = Tint
}
}
end

function AccumulatorsDischarge(Tint)
return {
discharge_animation =
{
filename = "__base__/graphics/entity/basic-accumulator/basic-accumulator-discharge-animation.png",
width = 147,
height = 128,
line_length = 8,
frame_count = 24,
shift = {0.395, -0.525},
animation_speed = 0.5,
tint = Tint
}
}
end

It works with pipes. What`s wrong? Please help!

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: No such node error

Post by prg »

How are you calling those functions to create your accumulator prototype?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

chernosliv
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Aug 01, 2015 2:31 am
Contact:

Re: No such node error

Post by chernosliv »

It looks like:
picture = Accumulators(T1),
charge_animation = AccumulatorsCharge(T1),
charge_cooldown = 30,
charge_light = {intensity = 0.3, size = 7},
discharge_animation = AccumulatorsDischarge(T1),
discharge_cooldown = 60,
discharge_light = {intensity = 0.7, size = 7},

T1 - tint color
Files i made:
https://www.dropbox.com/s/kya192k6c4rjs ... s.lua?dl=0
https://www.dropbox.com/s/l953862yl52le ... r.lua?dl=0
Last edited by chernosliv on Sun Jan 24, 2016 12:50 pm, edited 1 time in total.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: No such node error

Post by prg »

Look at what the functions are returning: function Accumulators(Tint) return { picture = { ... } } end
So your definition would result in picture = { picture = { ... } }. Try removing the surrounding picture={} from the return value.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

chernosliv
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Aug 01, 2015 2:31 am
Contact:

Re: No such node error

Post by chernosliv »

Not working - expected (to close `function` at line 1) near `=`
Forgot to mention 12.10

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: No such node error

Post by prg »

Well remove the picture={} in such a way that you don't break the syntax of the rest of the function. Paste the broken code, there must be a brace missing now somewhere or something.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

chernosliv
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Aug 01, 2015 2:31 am
Contact:

Re: No such node error

Post by chernosliv »

Nothing changed

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: No such node error

Post by prg »

Err... huh? "Nothing changed" because of what? By "paste the broken code" I meant put it here on the forum so we can look at it.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

chernosliv
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Aug 01, 2015 2:31 am
Contact:

Re: No such node error

Post by chernosliv »

I put links to my files in previous reply. It should be better.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: No such node error

Post by prg »

Would be way easier if I could just have a look at the code directly here on the forum. Anyway, the linked file still contains "function Accumulators(Tint) return { picture = { ... } } end". Paste the code where you attempted to remove the picture={}.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: No such node error

Post by prg »

I'm taking another stab at interpreting your "Nothing changed" post. Do you mean you managed to fix your Accumulators function so it now returns the proper table without causing a syntax error, but you're still getting the same error message as before? That would be because all the other functions you've defined have exactly the same problem with the same solution, so you still need to fix those, too. (When I said "Look at what the functions are returning" the Accumulators one was just an example)
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

chernosliv
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Aug 01, 2015 2:31 am
Contact:

Re: No such node error

Post by chernosliv »

I not understand what part of code should i post and decided to post both parts.

Code: Select all

picture =
    {
      filename = "__base__/graphics/entity/basic-accumulator/basic-accumulator.png",
      priority = "extra-high",
      width = 124,
      height = 103,
      shift = {0.7, -0.2},
      tint = Tint
    }
And what`s left

Code: Select all

function Accumulators(Tint)
  return {   
  }
end

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: No such node error

Post by prg »

You still need to return the contents of the table, just not a table within a table. Try

Code: Select all

function Accumulators(Tint)
  return {   
      filename = "__base__/graphics/entity/basic-accumulator/basic-accumulator.png",
      priority = "extra-high",
      width = 124,
      height = 103,
      shift = {0.7, -0.2},
      tint = Tint
  }
end
and do the same for the other functions.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

chernosliv
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Aug 01, 2015 2:31 am
Contact:

Re: No such node error

Post by chernosliv »

Thanks for illustrative example, it fixes the problem. I make this looking on Dytech pipes for example. Now i understand my mistake.

Post Reply

Return to “Modding help”