21948 Posts in 3768 Topics - by 7901 Members - Latest Member: Balindrum

Author Topic: I've messed something up with factories, and I need help (please)  (Read 374 times)

Hammelpilaw

  • Full Member
  • ***
  • Posts: 246
    • View Profile
    • Scrap Yard - Factory calculator
Re: I've messed something up with factories, and I need help (please)
« Reply #15 on: December 01, 2017, 10:18:05 PM »
It does not matter where you add new productions to productionsindex.lua, at the top or bottom or middle or wherever. Never modded new goods, but i think it should be the same there.
What you may do in an existing galaxy:
  • Add/change/delete entries in productionindex.lua (existing stations are not affected by changes in this file)
  • Add new goods to goodsindex.lua
  • Change stats of existing goods like price or size (but not the name)
What you must NOT do in an existing galaxy:
  • Change good names
  • Delete goods
The reason is, that productionsindex.lua is only used when stations are created/generated. The productions and consumtions will be saved at the entity and the values of productionsindex.lua does not do anything to this station anymore.
But goodsindex.lua is always used to load goods. As soon as you implement "Aluminum" (the wrong spelled one) to the galaxy, you must have this good in your goodsindex.lua, or you get errors. If you change the size of any good, all existing goods of this type will use the new value cause its always loaded from goodsindex.lua.

Azerik

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: I've messed something up with factories, and I need help (please)
« Reply #16 on: December 01, 2017, 10:28:08 PM »
From my observations, it might matter where in goodsindex you put the new stuff.

When I first tried to implement this for testing on the server (kinda stupid in retrospect, though I wouldn't have caught this w/o it), suddenly all the factories and mines I'd made were making something different.  When I un-built and re-built them they seemed to work, but when I put in some more stuff, boom, all the factories were messed up again.

Going forward, I'm going to keep my new factories at the top of the file to make them easier to see and work with, but I'm going to add new goods to the bottom of the file so they don't mess up ordering.  I will have to do some testing where I make some factories and then add some new goods and see if it messes things up.

Azerik

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: I've messed something up with factories, and I need help (please)
« Reply #17 on: December 07, 2017, 05:27:33 AM »
I'm stumped again.  I added the last 7 factories I needed and the final good today.  Everything is running without errors, but I can't spawn the last 7 factories either through the debug menu or by founding a station with a ship.

The last good in the goodsindex also doesn't show up in the spawn cargo tab on the debug menu either.

I've installed it locally, I've installed it on the server.  I've double checked to see that the stuff *is* in the files in the game folders.  Restarted my game totally, even snuck in a reboot on the computer.  I even started a new single player world and still can't found them or spawn one in.  Everything from the BBQ Sauce Bottling Factory on down is MIA, and so is Stuffing.

Any ideas?  See what I've missed?

productionsindex.lua
Code: [Select]
table.insert(productions, {factory="${good} Bottling Factory ${size}", ingredients={{name="Tomato", amount=50, optional=0}, {name="Fruit", amount=50, optional=0}, {name="Anchovy", amount=50, optional=0}, {name="Spices", amount=10, optional=0}}, results={{name="Brown Sauce", amount=100}}, garbages={}})
table.insert(productions, {factory="${good} Factory ${size}", ingredients={{name="Rice", amount=100, optional=0}, {name="Spices", amount=5, optional=0}, {name="Vegetable", amount=40, optional=0}, {name="Chicken", amount=20, optional=0}, {name="Egg", amount=10, optional=0}}, results={{name="Fried Rice", amount=25}}, garbages={}})
table.insert(productions, {factory="${good} Factory ${size}", ingredients={{name="Wheat", amount=1, optional=0}, {name="Egg", amount=1, optional=0}, {name="Water", amount=1, optional=0}}, results={{name="Noodle", amount=1}}, garbages={}})
table.insert(productions, {factory="${good} Factory ${size}", ingredients={{name="Pork", amount=5, optional=0}, {name="Wood", amount=1, optional=0}, {name="Spices", amount=1, optional=0}}, results={{name="Pulled Pork", amount=7}}, garbages={}})
table.insert(productions, {factory="${good} Bottling Factory ${size}", ingredients={{name="Tomato", amount=20, optional=0}, {name="Wood", amount=10, optional=0}, {name="Spices", amount=5, optional=0}, {name="Sugar", amount=10, optional=1}, {name="Acid", amount=3, optional=1}}, results={{name="BBQ Sauce", amount=50}}, garbages={}})
table.insert(productions, {factory="${good} Factory ${size}", ingredients={{name="Bacon", amount=4, optional=0}, {name="Bread", amount=2, optional=0}, {name="Dairy", amount=1, optional=0}, {name="Brown Sauce", amount=1, optional=0}, {name="Ketchup", amount=1, optional=1}}, results={{name="Bacon Sandwich", amount=5}}, garbages={}})
table.insert(productions, {factory="${good} Factory ${size}", ingredients={{name="Sheep", amount=4, optional=0}, {name="Onion", amount=15, optional=0}, {name="Oat", amount=20, optional=0}, {name="Spices", amount=2, optional=0}, {name="Cattle", amount=1, optional=1}}, results={{name="Haggis", amount=13}}, garbages={}})
table.insert(productions, {factory="${good} Factory ${size}", ingredients={{name="Noodle", amount=5, optional=0}, {name="Cheese", amount=2, optional=0}, {name="Dairy", amount=5, optional=0}, {name="Water", amount=10, optional=0}}, results={{name="Mac n Cheese", amount=7}}, garbages={}})
table.insert(productions, {factory="${good} Farm ${size}", ingredients={{name="Energy Cell", amount=5, optional=0}, {name="Water", amount=10, optional=0}, {name="Fertilizer", amount=5, optional=0}}, results={{name="Onion", amount=75}}, garbages={}})
table.insert(productions, {factory="${good} Factory ${size}", ingredients={{name="Vegetable", amount=5, optional=0}, {name="Potato", amount=5, optional=0}, {name="Dairy", amount=2, optional=0}}, results={{name="Neeps n Tatties", amount=6}}, garbages={}})
table.insert(productions, {factory="${good} Bakery ${size}", ingredients={{name="Wheat", amount=20, optional=0}, {name="Egg", amount=5, optional=0}, {name="Dairy", amount=15, optional=0}, {name="Sugar", amount=10, optional=0}}, results={{name="Cake", amount=15}}, garbages={}})
table.insert(productions, {factory="${good} Factory ${size}", ingredients={{name="Bread", amount=10, optional=0}, {name="Meat", amount=10, optional=0}, {name="Lettuce", amount=10, optional=0}, {name="Cheese", amount=10, optional=0}, {name="Ketchup", amount=5, optional=1}, {name="Mustard", amount=5, optional=1}, {name="BBQ Sauce", amount=5, optional=1}}, results={{name="Hamburger", amount=1}}, garbages={}})

goodsindex.lua
Code: [Select]
goods["Sushi"] = {name="Sushi", plural="Sushi", description="Select cuts of raw fish on rice wrapped in seaweed.", icon="mods/pizzaplus/data/textures/icons/fishing.png", price=150, size=0.1, level=4, importance=0, illegal=false, dangerous=false, }
goods["Pulled Pork"] = {name="Pulled Pork", plural="Pulled Pork", description="The second most magical product derived from pigs.", icon="mods/pizzaplus/data/textures/icons/magick-trick.png", price=169, size=0.5, level=3, importance=2, illegal=false, dangerous=false, }
goods["Hamburger"] = {name="Hamburger", plural="Hamburgers", description="A ground meat sandwich.", icon="mods/pizzaplus/data/textures/icons/hamburger.png", price=7741, size=1, level=6, importance=0, illegal=false, dangerous=false, }
goods["Fish and Chips"] = {name="Fish and Chips", plural="Fish and Chips", description="Breaded, deep fried fish with deep fried potatos.", icon="mods/pizzaplus/data/textures/icons/fish-smoking.png", price=300, size=0.5, level=4, importance=0, illegal=false, dangerous=false, }
goods["Bacon Sandwich"] = {name="Bacon Sandwich", plural="Bacon Sandwiches", description="A sandwich of cooked back bacon between bread that is usually spread with butter, and may be seasoned with ketchup or brown sauce.", icon="mods/pizzaplus/data/textures/icons/sliced-bread.png", price=150, size=0.1, level=4, importance=0, illegal=false, dangerous=false, }
goods["Stuffing"] = {name="Stuffing", plural="Stuffing", description="Bread based dressing originally cooked in the cavity of a turkey.", icon="mods/pizzaplus/data/textures/icons/fleshy-mass.png", price=65, size=0.1, level=4, importance=0, illegal=false, dangerous=false, }