get_circuit_connector_sprites() from base

Place to get help with not working mods / modding interface.
Skandragon
Inserter
Inserter
Posts: 29
Joined: Fri Nov 18, 2016 9:26 am
Contact:

get_circuit_connector_sprites() from base

Post by Skandragon »

I have a mod which uses get_circuit_connector_sprites(), which used to be defined all the time, but now is in a file in base. Short of duplicating this file, is there a way to require() a file from base?

Also, when just duplicating the code, the graphics get_circuit_connector_sprites() refers to, __base__/graphics/entity/circuit-connector/circuit-connector-main.png, does not exist according to Factorio. I really don't want to also duplicate graphics...

Any ideas on how I can reuse this handy function, and the associated connector graphics?
vedrit
Filter Inserter
Filter Inserter
Posts: 293
Joined: Sun Aug 03, 2014 2:25 am
Contact:

Re: get_circuit_connector_sprites() from base

Post by vedrit »

I am also needing to know
vedrit
Filter Inserter
Filter Inserter
Posts: 293
Joined: Sun Aug 03, 2014 2:25 am
Contact:

Re: get_circuit_connector_sprites() from base

Post by vedrit »

Digging through base, it looks like "get_circuit_connector_sprites" changed to "circuit_connector_definitions[string].sprites"
No idea what the different definitions are, though, still looking...
joihoin
Burner Inserter
Burner Inserter
Posts: 15
Joined: Tue Jan 23, 2018 12:34 pm
Contact:

Re: get_circuit_connector_sprites() from base

Post by joihoin »

Looking through boblogistics code. I see this:

Code: Select all

circuit_connector_definitions["bob-valve"] = circuit_connector_definitions.create(universal_connector_template,
  {
    { variation = 2, main_offset = util.by_pixel(0, -12), shadow_offset = util.by_pixel(0, -12), show_shadow = true },
    { variation = 0, main_offset = util.by_pixel(0, -12), shadow_offset = util.by_pixel(0, -12), show_shadow = true },
    { variation = 6, main_offset = util.by_pixel(0, -12), shadow_offset = util.by_pixel(0, -12), show_shadow = true },
    { variation = 4, main_offset = util.by_pixel(0, -12), shadow_offset = util.by_pixel(0, -12), show_shadow = true },
  }
)
And it is referenced later using

Code: Select all

    
circuit_connector_sprites = circuit_connector_definitions["bob-valve"].sprites,
Post Reply

Return to “Modding help”