Page 1 of 1

Items not showing

Posted: Thu Mar 06, 2014 6:16 pm
by Deathmage
I have been having a problem with making a mod for more turrets, none of the components appear in the crafting grid,and ideas?
https://www.dropbox.com/s/c904wo3uhg5qk ... urrets.rar this is the link for it, hopefuly i can fix this large bug.

Re: Items not showing

Posted: Thu Mar 06, 2014 6:53 pm
by FreeER
  • 1) you need a data.lua file (see code block below but, this is the file that Factorio actually loads for your prototypes, typically it's used as a place to require the prototype files), without it the mod is practically ignored.
  • 2) in item.lua you use "shock-absorbers" and in recipe you use "shock-absorber" (I'm assuming they are meant to be the same)
  • 3) in item.lua you have a place-result for the "shock-absorbers" but no entity is defined so the place-result on the item causes an error (either create an entity if you meant for it to be placed, or if you meant it only as an intermediate recipe item then simply remove the place-result line).
  • 4) in recipe.lua you use "lubericant" as an ingredient in the "shock-absorber", but the proper spelling is "lubricant"
  • 5) the lubricant fluid (I believe) needs to be specified as {type="fluid", name="lubricant", amount=10}, (otherwise Factorio only searches for an item not a fluid).
  • 6) you can not use fluids in the default crafting category (ie, cannot craft by hand an item that requires a fluid), so add category = "chemistry", (or create your own machine and crafting_category).
  • 7) in item.lua you use the base iron gear icon for the "shock-absorbers" but it is spelled as "iron-gear.png" instead of "iron-gear-wheel.png" and Factorio produces an error of "Sprite outside of "...png" (at 32, 32, size of 0x0 of 0x0)"
here's the data.lua to load what you have

Code: Select all

require("prototypes.entity.projectiles")
require("prototypes.entity.turrets")
require("prototypes.item.item")
require("prototypes.recipe.recipe")

--uncomment the technology and tile when you add them by removing the "--" in front of them
--require("prototypes.technology.technology")
--require("prototypes.tile.tile")
Hope that helps you out :D

Re: Items not showing

Posted: Fri Mar 07, 2014 1:35 am
by immibis
Alternatively, put your data:extend calls directly in data.lua. Nothing actually forces you to have separate files.

Re: Items not showing

Posted: Fri Mar 07, 2014 8:16 am
by ficolas
immibis wrote:Alternatively, put your data:extend calls directly in data.lua. Nothing actually forces you to have separate files.
That will make you need to put all base edits in the data.lua

Re: Items not showing

Posted: Fri Mar 07, 2014 8:53 am
by AlexPhoenix
ficolas wrote:
immibis wrote:Alternatively, put your data:extend calls directly in data.lua. Nothing actually forces you to have separate files.
That will make you need to put all base edits in the data.lua
for me it dosnt make sence, i use my own utils for making mods.
so utils count all, not i.


also if you comment code then it is rather easy to find all items.

also with advanced editor you can use diffenent data:extend add different data types, and simply fold them

Re: Items not showing

Posted: Fri Mar 07, 2014 4:33 pm
by Deathmage
Thanks i had a feeling that it was just syntax bugs and misspells but i wasn't completely sure. Thanks FreeER :)