[Rseding91] [1.0.0] Trivial-Smoke created via API ignores movement_slow_down_factor of 1

Bugs that are actually features.
Post Reply
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

[Rseding91] [1.0.0] Trivial-Smoke created via API ignores movement_slow_down_factor of 1

Post by Muppet9010 »

Trivial smoke generated via LuaSurface.create_trivial_smoke{} ignores the movement_slow_down_factor option when set to 1 in the trivial smoke prototype. This causes it to move around randomly. When this same trivial smoke is created via a trigger item it stays still.

My test trivial smoke example code:

Code: Select all

{
    type = "trivial-smoke",
    name = "stasis_mine-stasis_target_impact_effect",
    animation = {
        filename = Constants.AssetModName .. "/graphics/entity/stasis_impact_effect.png",
        flags = {"trilinear-filtering"},
        line_length = 4,
        width = 91,
        height = 93,
        frame_count = 16,
        direction_count = 1,
        tint = nil,
        scale = 1
    },
    duration = tonumber(settings.startup["stasis_mine-stasis_time"].value) * 60,
    fade_in_duration = 120,
    fade_away_duration = 30,
    movement_slow_down_factor = 1,
    cyclic = true,
    affected_by_wind = false,
    show_when_smoke_off = true
}
When called from an area trigger effect from a landmine action the smoke doesn't move:

Code: Select all

action = {
                type = "direct",
                action_delivery = {
                    type = "instant",
                    source_effects = {
                        {
                            type = "nested-result",
                            affects_target = true,
                            action = {
                                type = "area",
                                radius = 6,
                                action_delivery = {
                                    type = "instant",
                                    target_effects = {
                                        {
                                            type = "create-trivial-smoke",
                                            smoke_name = "stasis_mine-stasis_target_impact_effect"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
When called from LuaSurface create_trivial_smoke API the smoke does move:

Code: Select all

entity.surface.create_trivial_smoke {
        name = "stasis_mine-stasis_target_impact_effect",
        position = entity.position
    }

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] [1.0.0] Trivial-Smoke created via API ignores movement_slow_down_factor of 1

Post by Rseding91 »

Can you please post a working example? (one I can load into the game and see the differences?) The example code you've posted references assets that don't exist anywhere I know of.
If you want to get ahold of me I'm almost always on Discord.

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [Rseding91] [1.0.0] Trivial-Smoke created via API ignores movement_slow_down_factor of 1

Post by posila »

movement_slow_down_factor = 1 making smoke never slowdown is correct, if you want it to be in place, use movement_slow_down_factor = 0.
The smoke created through trigger doesn't move because it ends up having zero movement vector, as you didn't specify speed_from_center, so it'll default to 0.

EDIT: I fixed the movement_slow_down_factor doc on wiki

Post Reply

Return to “Not a bug”