#okay to address to code how do I make it

1 messages · Page 1 of 1 (latest)

trail talon
#

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

lone kernel
#

I have two separate item textures how do I sign it from the graphics folder

trail talon
#

you want both pictures on the same item?

lone kernel
#

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

trail talon
#

ok so then you just update the icon line with info for the first item image. its your mod name/graphics/compact-circuit.png

lone kernel
trail talon
#

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
  }
})```
lone kernel
trail talon
#

that looks right

lone kernel
#

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
}
})

trail talon
lone kernel
#

okay so I did everything correctly?

trail talon
#

yes

lone kernel
#

so if I load this into the game it should work

trail talon
#

it should. currently its just an item so it wont show in the crafting menu and can only be cheated in

lone kernel
#

ok

#

let me do a test

trail talon
#

did you remove the double underscores from around the mod name in the icon line? should be __Compaction__

lone kernel
#

no

#

oh wait I did

#

I used an infinite item chest

trail talon
#

looks like its working now. just needs localized to fix the unknown key

lone kernel
#

how would i do that

trail talon
#

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

lone kernel
#

okay what

#

I'm not understanding what to do can you please add more steps so I understand

rustic pier
#

add a file in the path kingarthur mentioned (relative to mod root folder), then put that content in there

lone kernel
#

?

#

where am I adding this folder

trail talon
#

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

lone kernel
rustic pier
#

I'm pretty sure the tutorial on the wiki tells you very explicitly about this btw lol

lone kernel
#

do I include the [item name]

trail talon
trail talon
lone kernel
trail talon
lone kernel
trail talon
#

looks correct

lone kernel
#

can't let me put it in game and see if it worked

rustic pier
# trail talon it does but its also absolute shit at it

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.

lone kernel
rustic pier
#

what does "didn't work" mean?

#

is your config in the correct place? (ie in /locale/en/)

lone kernel
#

en

#

I forgot that

#

it works

#

it works

#

okay

#

now how can I add it to assemblers / crafting menu

#

and possibly research

scenic oar
#

Assemblers and crafting menu is handled through recipes and research needs a technology

lone kernel
#

before I go down that rabbit hole

#

is there anyway I can convert the way I have it into prototype folder

trail talon
#

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" }

lone kernel
trail talon
#

Just add it below that smart battery block

lone kernel
#

oh so we're not going to use prototypes folder yet

#

ok

trail talon
#

You can but that's just an organization thing. Might as well get all the basics covered

lone kernel
#

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

trail talon
#

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} },

lone kernel
#

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"
}
})

trail talon
#

Looks good

lone kernel
#

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

scenic oar
#

You can change the category property inside your recipe to advanced-crafting

lone kernel
#

ok

#

okay how can I add research

celest cosmos
#

for that you need a new technology

lone kernel
#

I'm getting tired I'm going to do all that tomorrow

digital fossil
#

Now that you understand the basics, you culd probably learn by looking at a mod. I used PyAlienLife

stoic micaBOT