Page 1 of 1

get_circuit_connector_sprites() from base

Posted: Fri Dec 15, 2017 3:19 am
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?

Re: get_circuit_connector_sprites() from base

Posted: Fri Dec 15, 2017 4:46 am
by vedrit
I am also needing to know

Re: get_circuit_connector_sprites() from base

Posted: Fri Dec 15, 2017 5:17 am
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...

Re: get_circuit_connector_sprites() from base

Posted: Thu Feb 01, 2018 11:32 pm
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,