So I wanted to make a new science pack. I copied science pack 1, changed the name, graphics, and recipe , but it isn't showing up on the laboratories screen. Is there something else I have to do?
Thanks!
How to make a new science pack?
- firestar246
- Inserter
- Posts: 29
- Joined: Sun Feb 19, 2017 11:25 am
- Contact:
How to make a new science pack?
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord.
Re: How to make a new science pack?
firestar246 wrote:So I wanted to make a new science pack. I copied science pack 1, changed the name, graphics, and recipe , but it isn't showing up on the laboratories screen. Is there something else I have to do?
Thanks!
Code: Select all
data.raw.lab.lab.inputs[1] = "science-pack-1"
data.raw.lab.lab.inputs[2] = "science-pack-2"
data.raw.lab.lab.inputs[3] = "science-pack-3"
data.raw.lab.lab.inputs[4] = "military-science-pack"
data.raw.lab.lab.inputs[5] = "production-science-pack"
data.raw.lab.lab.inputs[6] = "high-tech-science-pack"
data.raw.lab.lab.inputs[7] = "space-science-pack"
- firestar246
- Inserter
- Posts: 29
- Joined: Sun Feb 19, 2017 11:25 am
- Contact:
Re: How to make a new science pack?
Thanks for helping me again! Out of curiosity, what would happen if I had this mod and another mod on at the same time that added an 8th input to the lab? Would they conflict or would the game fix it somehow? Just curios...darkfrei wrote:firestar246 wrote:So I wanted to make a new science pack. I copied science pack 1, changed the name, graphics, and recipe , but it isn't showing up on the laboratories screen. Is there something else I have to do?
Thanks!Add here your item.Code: Select all
data.raw.lab.lab.inputs[1] = "science-pack-1" data.raw.lab.lab.inputs[2] = "science-pack-2" data.raw.lab.lab.inputs[3] = "science-pack-3" data.raw.lab.lab.inputs[4] = "military-science-pack" data.raw.lab.lab.inputs[5] = "production-science-pack" data.raw.lab.lab.inputs[6] = "high-tech-science-pack" data.raw.lab.lab.inputs[7] = "space-science-pack"
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord.
- Arch666Angel
- Smart Inserter
- Posts: 1636
- Joined: Sun Oct 18, 2015 11:52 am
- Contact:
Re: How to make a new science pack?
Code: Select all
table.insert(data.raw["lab"]["lab"].inputs, "your-science-pack")
Angels Mods
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: How to make a new science pack?
Yeah, he gave you bad advice. this isn't an array, it's a table, you don't need to specifically reference each item by it's index number to add a new one, simply table.insert. Like what angel posted.firestar246 wrote:Thanks for helping me again! Out of curiosity, what would happen if I had this mod and another mod on at the same time that added an 8th input to the lab? Would they conflict or would the game fix it somehow? Just curios...darkfrei wrote:firestar246 wrote:So I wanted to make a new science pack. I copied science pack 1, changed the name, graphics, and recipe , but it isn't showing up on the laboratories screen. Is there something else I have to do?
Thanks!Add here your item.Code: Select all
data.raw.lab.lab.inputs[1] = "science-pack-1" data.raw.lab.lab.inputs[2] = "science-pack-2" data.raw.lab.lab.inputs[3] = "science-pack-3" data.raw.lab.lab.inputs[4] = "military-science-pack" data.raw.lab.lab.inputs[5] = "production-science-pack" data.raw.lab.lab.inputs[6] = "high-tech-science-pack" data.raw.lab.lab.inputs[7] = "space-science-pack"
Arch666Angel wrote:Code: Select all
table.insert(data.raw["lab"]["lab"].inputs, "your-science-pack")
Re: How to make a new science pack?
All is table in lua. Of coarse new value must be added to inputs with function table.insert. https://www.lua.org/pil/19.2.htmlbobingabout wrote:Yeah, he gave you bad advice. this isn't an array, it's a table, you don't need to specifically reference each item by it's index number to add a new one, simply table.insert. Like what angel posted.firestar246 wrote:Thanks for helping me again! Out of curiosity, what would happen if I had this mod and another mod on at the same time that added an 8th input to the lab? Would they conflict or would the game fix it somehow? Just curios...darkfrei wrote:firestar246 wrote:So I wanted to make a new science pack. I copied science pack 1, changed the name, graphics, and recipe , but it isn't showing up on the laboratories screen. Is there something else I have to do?
Thanks!Add here your item.Code: Select all
data.raw.lab.lab.inputs[1] = "science-pack-1" data.raw.lab.lab.inputs[2] = "science-pack-2" data.raw.lab.lab.inputs[3] = "science-pack-3" data.raw.lab.lab.inputs[4] = "military-science-pack" data.raw.lab.lab.inputs[5] = "production-science-pack" data.raw.lab.lab.inputs[6] = "high-tech-science-pack" data.raw.lab.lab.inputs[7] = "space-science-pack"
Arch666Angel wrote:Code: Select all
table.insert(data.raw["lab"]["lab"].inputs, "your-science-pack")
And vanilla inputs can be written as list:
Code: Select all
data.raw.lab.lab.inputs = {"science-pack-1", "science-pack-2", "science-pack-3", "military-science-pack", "production-science-pack", "high-tech-science-pack", "space-science-pack"}
- Arch666Angel
- Smart Inserter
- Posts: 1636
- Joined: Sun Oct 18, 2015 11:52 am
- Contact:
Re: How to make a new science pack?
There is a significant one: Table.insert appends your argument to the end of the existing table, what you do is override the whole table with your new definition.
Angels Mods
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"