#okay to address to code how do I make it
1 messages · Page 1 of 1 (latest)
add a .png file to the mod folder and replace icon = "__base__/graphics/icons/iron-plate.png" with icon = "__yourmodname__/youricon.png" and then update icon_size from 64 to 32
you want both pictures on the same item?
no
no I want each picture to be on a different item
Compact-Circuit
Smart-Battery
that's the names of the two items and the names of the texture
ok so then you just update the icon line with info for the first item image. its your mod name/graphics/compact-circuit.png
the second one will require another item so you copy the whole item block and change the name and icon file name.
data:extend({
{
type = "item",
name = "compact-circuit",
icon = "__your mod name__/graphics/compact-circuit.png",
icon_size = 32,
subgroup = "raw-material",
order = "b[iron-plate]",
stack_size = 100
},
{
type = "item",
name = "smart-battery",
icon = "__your mod name__/graphics/smart-battery.png",
icon_size = 32,
subgroup = "raw-material",
order = "b[iron-plate]",
stack_size = 100
}
})```
that looks right
data:extend({
{
type = "item",
name = "Compact-Circuit",
icon = "Compaction/graphics/Compact-Circuit.png",
icon_size = 32, icon_mipmaps = 4,
subgroup = "raw-material",
order = "b[iron-plate]",
stack_size = 25
},
{
type = "item",
name = "Smart-Battery",
icon = "Compaction/graphics/Smart-Battery.png",
icon_size = 32, icon_mipmaps = 4,
subgroup = "raw-material",
order = "b[iron-plate]",
stack_size = 25
}
})
I don't think so
something doesn't look right
I think that should be it looks
and how do I change the battery from being an iron plate to an actual battery
data:extend({
{
type = "item",
name = "Compact-Circuit",
icon = "Compaction/graphics/Compact-Circuit.png",
icon_size = 32, icon_mipmaps = 4,
subgroup = "raw-material",
order = "b[iron-plate]",
stack_size = 25
},
{
type = "item",
name = "Smart-Battery",
icon = "Compaction/graphics/Smart-Battery.png",
icon_size = 32, icon_mipmaps = 4,
subgroup = "raw-material",
order = "b[battery]",
stack_size = 25
}
})
i dont understand what you mean? its now a new item with the batteries name and icon and isnt the iron plate item anymore
okay so I did everything correctly?
yes
so if I load this into the game it should work
it should. currently its just an item so it wont show in the crafting menu and can only be cheated in
did you remove the double underscores from around the mod name in the icon line? should be __Compaction__
looks like its working now. just needs localized to fix the unknown key
how would i do that
got to create a locale folder with a language folder inside it with a whatever.cfg file. default is locale/en/locale.cfg
then in the .cfg file add [item-name] Smart-Battery=Smart-Batttery
okay what
I'm not understanding what to do can you please add more steps so I understand
add a file in the path kingarthur mentioned (relative to mod root folder), then put that content in there
in the mod folder at the same level as info.json
create a folder named locale
in the localefolder create another folder named en
in the en folder create a file called locale.cfg
in locale.cfg add [item-name] Smart-Battery=Smart-Batttery
I'm pretty sure the tutorial on the wiki tells you very explicitly about this btw lol
do I include the [item name]
yes you need that
it does but its also absolute shit at it
looks correct
can't let me put it in game and see if it worked
disagree; there's a whole section on it
Locale
If you've already tried loading up Factorio and trying the mod so far (which you can at this point without it crashing), you may have noticed that the item name of the armor says "Unknown key". This means that Factorio has the internal name, but it doesn't know what it should look like to the user. So, we need to create a locale for our mod.
In the mod folder, create a folder called locale, then create another folder inside that called en, then a file called any_name_can_be_here.cfg.
If you know another language, you can also translate your mod by making other language code files inside locale, such as de for German.
Inside the .cfg file, paste the following:
[item-name]
fire-armor=Fire armor[item-description]
fire-armor=An armor that seems to catch the ground itself on fire when you take a step. It's warm to the touch.Notice how this is not a lua file. Locale is handled with C config files, so the format is different.
it didn't work
what does "didn't work" mean?
is your config in the correct place? (ie in /locale/en/)
en
I forgot that
it works
it works
okay
now how can I add it to assemblers / crafting menu
and possibly research
Assemblers and crafting menu is handled through recipes and research needs a technology
before I go down that rabbit hole
is there anyway I can convert the way I have it into prototype folder
you need to add a recipe to that data extend block { type = "recipe", name = "iron-plate", category = "crafting", energy_required = 3.2, ingredients = {{"iron-ore", 1}}, result = "iron-plate" }
Just add it below that smart battery block
You can but that's just an organization thing. Might as well get all the basics covered
data:extend({
{
type = "item",
name = "Compact-Circuit",
icon = "Compaction/graphics/Compact-Circuit.png",
icon_size = 32, icon_mipmaps = 4,
subgroup = "raw-material",
order = "b[iron-plate]",
stack_size = 25
},
{
type = "item",
name = "Smart-Battery",
icon = "Compaction/graphics/Smart-Battery.png",
icon_size = 32, icon_mipmaps = 4,
subgroup = "raw-material",
order = "b[battery]",
stack_size = 25
},
{
type = "recipe",
name = "Compact-Circuit",
category = "crafting",
energy_required = 3.2,
ingredients = {{"iron-plate", 1}},
result = "Compact-Circuit"
}
})
I also wanted to acquire 3 copper cable
how do I add another ingredients
add a new line to the ingredients table block same as we did for the items and recipes. it should look like this ingredients = { {"iron-ore", 1}, {"copper-cable", 3} },
data:extend({
{
type = "item",
name = "Compact-Circuit",
icon = "Compaction/graphics/Compact-Circuit.png",
icon_size = 32, icon_mipmaps = 4,
subgroup = "raw-material",
order = "b[iron-plate]",
stack_size = 25
},
{
type = "item",
name = "Smart-Battery",
icon = "Compaction/graphics/Smart-Battery.png",
icon_size = 32, icon_mipmaps = 4,
subgroup = "raw-material",
order = "b[battery]",
stack_size = 25
},
{
type = "recipe",
name = "Compact-Circuit",
category = "crafting",
energy_required = 3.2,
ingredients = {
{"iron-ore", 1},
{"copper-cable", 3}},
result = "Compact-Circuit"
}
})
Looks good
I've added new items and recipes and it works
now how would I add a new machine
Big Stretch
or make something that can only be crafted in assembler
You can change the category property inside your recipe to advanced-crafting
I'm getting tired I'm going to do all that tomorrow
Now that you understand the basics, you culd probably learn by looking at a mod. I used PyAlienLife