Page 1 of 1

allow sprite variation in constant-combinator

Posted: Sun May 21, 2017 5:50 pm
by gheift
Please allow multiple sprites in the constant-combinator prototype, these can then be selected with entity.graphics_variation like with the simple-entity:

Code: Select all

data:extend{{
    name = "my-entity",
    type = "constant-combinator",
    sprites = {
        north = {
            { filename = "__mod__/graphic/sprite-north-1.png", width = 32, height = 32, },
            { filename = "__mod__/graphic/sprite-north-2.png", width = 32, height = 32, },
        },
        east = {
            { filename = "__mod__/graphic/sprite-east-1.png", width = 32, height = 32, },
            { filename = "__mod__/graphic/sprite-east-2.png", width = 32, height = 32, },
        },
        south = {
            { filename = "__mod__/graphic/sprite-south-1.png", width = 32, height = 32, },
            { filename = "__mod__/graphic/sprite-south-2.png", width = 32, height = 32, },
        },
        west = {
            { filename = "__mod__/graphic/sprite-west-1.png", width = 32, height = 32, },
            { filename = "__mod__/graphic/sprite-west-2.png", width = 32, height = 32, },
        },
    -- ...
}}
Thanks,
Gerhard

Re: allow sprite variation in constant-combinator

Posted: Sun May 21, 2017 10:40 pm
by Rseding91
Why? That's just more data we would have to save per constant combinator (the graphics variation) that would never get used in the base game.

Re: allow sprite variation in constant-combinator

Posted: Wed May 24, 2017 1:17 am
by gheift
It would be 8 byte per constant combinator, which would be added in the base game.

The reason I would like to have this is to have a simple entity, which is able to change the sprite and is able to be connected to the circuit network. The current solution is to make the constant combinator transparent (which looks wired on placing) and managing a simple-entity in parallel for the sprites, which is possible, but needs more memory and processing time than just adding one field to the constant-combinator.

Re: allow sprite variation in constant-combinator

Posted: Wed May 24, 2017 1:34 am
by Rseding91
I meant why would this ever be needed? constant combinators don't use the concept of direction and don't need to.

Re: allow sprite variation in constant-combinator

Posted: Wed May 24, 2017 1:50 am
by gheift
The constant-combinator is already rotateable/has a direction in the base game without any mods. If you place one, it can be rotated. The example code I gave above is just a modified version of the normal entity definition from data/prototypes/entity/entities.lua. The structure entity.sprites.north etc is form the original one.