Search found 5 matches

by codyfactorio
Sat Jun 08, 2024 11:46 pm
Forum: Modding help
Topic: Issue extending data with new item
Replies: 1
Views: 559

Re: Issue extending data with new item

Ah the issue was you also need to extend an item, in addition to the entity.


data:extend(
{
{
type = "item",
name = "rose",
icon = "__base__/graphics/icons/solar-panel.png",
icon_size = 64,
icon_mipmaps = 4,
subgroup = "energy",
order = "e[accumulator]-a[accumulator]-a",
place_result ...
by codyfactorio
Sat Jun 08, 2024 11:29 pm
Forum: Modding help
Topic: Issue extending data with new item
Replies: 1
Views: 559

Issue extending data with new item

I'm trying to add, let's say, a red accumulator. I have the code setup, and there are no errors. But when I try to insert it into my inventory, it says "Unknown item name: rose"

As an example, this code piece is straight from the fire-armor tutorial.

This works ~ /c game.player.insert{name="green ...
by codyfactorio
Thu Jun 06, 2024 7:47 pm
Forum: Modding help
Topic: How to see what modules are in a placed assembler
Replies: 1
Views: 587

Re: How to see what modules are in a placed assembler

I figured it out.

https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area
- Look at entities

https://lua-api.factorio.com/latest/classes/LuaEntity.html
* get_module_inventory()

https://lua-api.factorio.com/latest/classes/LuaInventory.html
- get_contents
- Remove(items ...
by codyfactorio
Thu Jun 06, 2024 6:45 pm
Forum: Modding help
Topic: How to see what modules are in a placed assembler
Replies: 1
Views: 587

How to see what modules are in a placed assembler

I'm ideating developing a mode where you can select a bunch of entities with the blueprint selector, and then hot swap all the modules inside with a different type.

I see the CraftingMachinePrototype has ModuleSpecification
https://lua-api.factorio.com/latest/prototypes/CraftingMachinePrototype ...

Go to advanced search