Protoype types

Place to get help with not working mods / modding interface.
Post Reply
Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Protoype types

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: Protoype types

Post 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
	}
  }

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Protoype types

Post by Bilka »

I had the problem that it moved and was slightly transparent. I'll look at your code tomorrow.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Protoype types

Post by Bilka »

Your code seems to do what I desire, thanks!

Edit: Nevermind, smoke won't go over collision boxes.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Modding help”