Page 1 of 1

Protoype types

Posted: Mon Mar 27, 2017 10:39 am
by Bilka
I'm having a problem with protoype types. Currently I'm using the decorative type for my entity prototype so that I can customize the render_layer of the entity. But this means that the entity gets removed if concrete is placed over it and that I can't have it be animated. Is there a prototype type that let's me animate the entity and change the render layer? Preferably that entity type should be not operable and not rotatable by default so that I don't have the ugly error message appear when the player tries to open/rotate it.

Re: Protoype types

Posted: Tue Mar 28, 2017 4:21 pm
by 321freddy
smoke is exactly what you want.
Supports a custom render layer, an animation and you cannot interact with it.
The only drawback is that it cannot have any collision box (and collision mask for that matter).

Here's an example of an animated smoke prototype that lasts (almost) forever:

Code: Select all

{
    type = "smoke",
    name = "smoke-test",
    flags = {"not-repairable", "not-blueprintable", "not-deconstructable", "placeable-off-grid", "not-on-map"},
    duration = 99999999,
    color = { r = 1, g = 1, b = 1, a = 1 },
    cyclic = true,
    affected_by_wind = false,
    show_when_smoke_off = true,
    movement_slow_down_factor = 0,
    vertical_speed_slowdown = 0,
    render_layer = "tile",
    animation =
    {
		filename = "__core__/graphics/cancel.png",
		width = 32,
		height = 32,
		shift = { 0, 1 },
		frame_count = 1
	}
  }

Re: Protoype types

Posted: Tue Mar 28, 2017 7:59 pm
by Bilka
I had the problem that it moved and was slightly transparent. I'll look at your code tomorrow.

Re: Protoype types

Posted: Wed Mar 29, 2017 1:14 pm
by Bilka
Your code seems to do what I desire, thanks!

Edit: Nevermind, smoke won't go over collision boxes.