However in testing, source_offset doesn't seem to work at all for streams despite being documented as available. Compare and contrast the following scripted dying_trigger_effect first using a stream then a beam. The stream's create_entity call is defined something like this:
Code: Select all
entity.surface.create_entity{
name = "flamethrower-fire-stream",
force = entity.force,
position = entity.position,
source_position = entity.position,
source_offset = {0,-4},
target_position = position,
raise_built = false,
create_build_effect_smoke = false,
}
The beam's create_entity call is identical except for the addition of the duration parameter and that the given name is "laser-beam", and produces this:
The source_offset is {0,-4} in both cases, which is also the offset of the explosion the particles are supposed to be coming from (specified by the ExplosionPrototype's height property). But while the beams are rendered as coming from that offset, the streams aren't. I've tried specifying source as the entity or a position and omitting source_position, or omitting source and only specifying source_position, but nothing works. You can't just offset the stream's actual position because then the stream isn't rendered properly (it looks like it's coming from the ground four tiles north, which is exactly what you told it to do). When you create streams as part of an action_delivery in a prototype (e.g. flamethrower turrets), there is also a source_offset parameter there, which does work. But it is ignored for streams when scripted with create_entity.