Questions about (fluid) turrets
Posted: Sat Sep 19, 2020 2:46 pm
I've made turrets with an attack_target_mask that is set to just one custom mask, and a target entity that has only this same mask as trígger_target_mask
I've also set turret.attack_parameters.cooldown = 0.5. In regular intervals (default: 600 ticks), I create target entities within shooting distance (i.e. min_range <= target-turret distance <= range) per script. I expected that the turret would start attacking these entities as soon as the first one has been created. However, it may take a considerable time before the turret actually shoots. The targets are right in front of it, but the turret just sits there and ignores them. When it finally does start shooting, it will attack all entities. What can I do against this delay? I don't want to set turret.shooting_target explicitly in the control script, so if there's something I could change in the prototype, that would be the preferred way.
(Just an idea: The target entities are based on simple-entity-with-force, so once they've been placed, they won't move. Could it be that turrets react when they notice that an entity or unit is moving into their attack distance?)
Something else: How does attack_parameters.fire_penalty work? The wiki has this:
Can it only be >= 0, or would burning enemies be preferred over enemies that don't burn if fire_penalty is negative? That's what I would expect, like with health_penalty:
However, negative values are not mentioned at al for fire_penalty. Is that a wiki bug, or are negative values really not allowed?
Code: Select all
data.raw[WT.turret_type][WT.extinguisher_turret_name].attack_target_mask = {
WT.trigger_target_dummy,
}
entity.trigger_target_mask = {WT.trigger_target_dummy}
(Just an idea: The target entities are based on simple-entity-with-force, so once they've been placed, they won't move. Could it be that turrets react when they notice that an entity or unit is moving into their attack distance?)
Something else: How does attack_parameters.fire_penalty work? The wiki has this:
Code: Select all
fire_penalty
Type: Types/float
Default: 0
Used when searching for the nearest enemy, when this is > 0, enemies that aren't burning are preferred over burning enemies. Definition of "burning" for this: Entity has sticker attached to it, and the sticker has a spread_fire_entity set.
Code: Select all
A higher penalty will discourage turrets from targeting units with higher health. A negative penalty will encourage turrets to target units with higher health.