Code: Select all
data.raw.recipe["assembling-machine-3"].ingredients[1][2] = 1
Code: Select all
data.raw.recipe["assembling-machine-3"].ingredients[1][2] = 1
No, [2][2].DaveMcW wrote:You want [2][1].
Code: Select all
for _, ingredient in pairs (data.raw.recipe["assembling-machine-3"].ingredients) do
if (ingredient[1] == "assembling-machine-2") then
ingredient[2] = 1
end
end
Code: Select all
data.raw.recipe["assembling-machine-3"]
Code: Select all
{
type = "recipe",
name = "assembling-machine-3",
enabled = false,
ingredients =
{
{"speed-module", 4},
{"assembling-machine-2", 2}
},
result = "assembling-machine-3"
}
Code: Select all
data.raw.recipe["assembling-machine-3"].ingredients
Code: Select all
{
{"speed-module", 4},
{"assembling-machine-2", 2}
}
Code: Select all
data.raw.recipe["assembling-machine-3"].ingredients[1]
Code: Select all
{
"speed-module",
4
}
Code: Select all
data.raw.recipe["assembling-machine-3"].ingredients[1][2]
Code: Select all
4
Code: Select all
data.raw.recipe["assembling-machine-3"].ingredients[1]
Code: Select all
data.raw.recipe["assembling-machine-3"].ingredients[2]
Code: Select all
data.raw.recipe["assembling-machine-3"].ingredients[2][2]
Thanksprg wrote:No, [2][2].DaveMcW wrote:You want [2][1].
How do you make the game print that stuff? I triedkeyboardhack wrote:All that stuff
Code: Select all
/c print(data.raw.recipe["assembling-machine-3"])
Code: Select all
/c game.player.print(game.player.force.recipes["assembling-machine-3"].ingredients[1].name)
/c game.player.print(game.player.force.recipes["assembling-machine-3"].ingredients[1].amount)
Code: Select all
/c game.player.print(game.player.force.recipes["assembling-machine-3"]
Code: Select all
/c game.player.print(game.player.force.recipes["assembling-machine-3"].ingredients[1]
Code: Select all
/c
for i,ingredient in pairs(game.player.force.recipes["assembling-machine-3"].ingredients) do
game.player.print(ingredient.name .. " - " .. ingredient.amount)
end
Not from the console in a running game, but from data*.lua.oLaudix wrote:You can't print it like that.
Code: Select all
print(serpent.block(data.raw.recipe["assembling-machine-3"].ingredients))
Code: Select all
{
{
"speed-module",
4
} --[[table: 0x2c28580]],
{
"assembling-machine-2",
2
} --[[table: 0x2c28610]]
} --[[table: 0x2c284f0]]
That's going to stdout, so you can see it nicely formatted in the terminal you're running Factorio in. (Or if it's too much output, like when you're dumping all of data.raw, redirect it to a file or pipe it to less or something)orzelek wrote:Where do you get output from print thats running in data phase?