sticker filters for area action in prototypes

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1207
Joined: Wed May 18, 2016 4:55 pm
Contact:

sticker filters for area action in prototypes

Post by Mooncat »

Request: 2 additional attributes for "area" type action, one for selecting entities that only have the said stickers, the other one for selecting entities that DON'T have the said stickers.

AFAIK, for actions with type = "area", we already have "collision_mask", "force" and "entity_flags" to filter entities. I hope we can make use of the sticker system so that we can also filter entities according to the existence of stickers on entities.
The format may be like this:

Code: Select all

action =
{
    type = "area",
    perimeter = 11,
    with_stickers = {"death-fire"},
    action_delivery =
    {
        type = "instant",
        target_effects =
        {
            type = "damage", damage = {amount = 999999, type = "fire"}
        }
    }
}
so this will deal 999999 fire damage to the entities that have the sticker "death-fire" on them.

Or,

Code: Select all

action =
{
    type = "area",
    perimeter = 11,
    without_stickers = {"chained-lightning"},
    action_delivery =
    {
        type = "beam",
        target_effects =
        {
            beam = "chained-lightning-beam-1",
	    max_length = 30,
	    duration = 20,
           source_offset = {0, 0}
        }
    }
}
this will shoot "chained-lightning-beam-1" to the entities that don't have "chained-lightning" sticker. Imagine the beam will create the "chained-lightning" sticker on the target entity, and also shoot "chained-lightning-beam-2" and then 3 and 4.... with the same filter and effect. We can then create true chained lightning. :P
Post Reply

Return to “Modding interface requests”