Module in mod-factory

Place to get help with not working mods / modding interface.
Post Reply
SeelenJaegerTee
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Aug 14, 2016 7:38 pm
Contact:

Module in mod-factory

Post by SeelenJaegerTee »

Hi for some reason I can't use modules in my factory.
Speed module can't be used in FOO
Right now I have:

Code: Select all

    module_specification =
    {
      module_slots = 2
    },
    allowed_effects = {"productivity", "speed", "pollution"},
What else do I need to be able to put the modules in the entity?

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Module in mod-factory

Post by aubergine18 »

You've made sure the module item is type = 'module' ?

here's a rough template I use when defining modules:

Code: Select all

    data:extend {{
      type = 'module',
      name = id,
      icon = '__mymod__/graphics/item/'..name..'.png',
      flags = { 'goes-to-main-inventory' },
      subgroup = 'module',
      category = category,
      tier = 1,
      order = order,
      stack_size = stack,
      default_request_amount = 10,
      effect = { [ name ] = { bonus = 1.0 } }
    }}
EDIT: Or are you making a custom factory and it's the factory that won't accept the module?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

SeelenJaegerTee
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Aug 14, 2016 7:38 pm
Contact:

Re: Module in mod-factory

Post by SeelenJaegerTee »

aubergine18 wrote: [...]
EDIT: Or are you making a custom factory and it's the factory that won't accept the module?
This.
Sorry I should have been more precise. My custom factories don't take the Vanilla modules.
This ist the full code for the factory

Code: Select all

	{
    type = "assembling-machine",
	localised_name = "FOO",
    name = "FOO",
    icon = "__BAR__/graphics/icons/FOO.png",
	flags = {"placeable-neutral","player-creation"},
    minable = {mining_time = 1, result = "FOO"},
	fast_replaceable_group = "FOO",
    max_health = 300,
	corpse = "big-remnants",
    dying_explosion = "medium-explosion",
    collision_box = {{-2.4, -2.4}, {2.4, 2.4}},
    selection_box = {{-2.5, -2.5}, {2.5, 2.5}},
    module_specification =
    {
      module_slots = 2
    },
    allowed_effects = {"productivity", "speed", "pollution"},
    crafting_categories = {"FooManFoo"},
    crafting_speed = 0.75,
    energy_source =
    {
      type = "electric",
      usage_priority = "secondary-input",
      emissions = 0.02 / 2
    },
    energy_usage = "200kW",
    ingredient_count = 3,
    animation ={
        filename = "__BAR__/graphics/entity/FOO.png",
		priority = "extra-high",
        width = 192,
        height = 192,
        frame_count = 16,
		line_length = 4,
        shift = {0.45, 0.7},
		animation_speed = 0.5
	},
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
    working_sound =
    {
    {
      [...]--Soundstuff
    }
    },
	fluid_boxes =
    {
      [...]--FLuidboxstuff
    }
    },
    pipe_covers = pipecoverspictures()
    },
Am I missing something?

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Module in mod-factory

Post by aubergine18 »

Ah, I've not tried creating a custom factory so not ran in to this problem. I'm actually having the exact opposite problem - I've made some custom modules and can't figure out a reliable way to prevent them being installed on vanilla factories (I can limit them a bit based on recipe, but that doesn't work for things like mines and radar).
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

Post Reply

Return to “Modding help”