Page 1 of 1
Types/BaseAttackParameters: warmup and cooldown
Posted: Sun Jun 11, 2023 2:25 pm
by Pi-C
Gun prototypes have attack_parameters.cooldown and may have attack_parameters.warmup. I wonder how they are supposed to be used:
(1) Only use WARMUP ticks after setting a new target (aim, wait WARMUP ticks, shoot, wait COOLDOWN ticks, shoot, wait COOLDOWN ticks, shoot, …).
(2) Use WARMUP ticks before every shot (aim, wait WARMUP ticks, shoot, wait COOLDOWN ticks, wait WARMUP ticks, shoot, wait COOLDOWN ticks, …).
To me, (1) makes more sense, I just want to make sure that is correct.

Re: Types/BaseAttackParameters: warmup and cooldown
Posted: Sun Jun 11, 2023 3:58 pm
by Silari
They're
documented: Warmup occurs AFTER attempting to shoot. So it'd actually be attempt to shoot, warmup, shoot, cooldown, attempt to shoot, warmup, shoot, cooldown, etc.
Not sure if the movement penalty applies during the warmup period - it should for the whole cooldown. Docs are lacking on anything about movement penalty.
Re: Types/BaseAttackParameters: warmup and cooldown
Posted: Sun Jun 11, 2023 7:38 pm
by Pi-C
Silari wrote: Sun Jun 11, 2023 3:58 pm
They're
documented: Warmup occurs AFTER attempting to shoot. So it'd actually be attempt to shoot, warmup, shoot, cooldown, attempt to shoot, warmup, shoot, cooldown, etc.
Thanks! I think this makes it even easier to achieve what I want: In
Autodrive, vehicles that have at least one loaded weapon and are equipped with an enemy sensor will automatically shoot at the nearest enemy that is within their weapon's range. This happens on every tick, so a tank with a machine gun loaded with the most simple ammo will kill small to medium nests of spawners and worms because they shoot at the ridiculous speed of 60 shots/second. My goal is to nerf the shooting speed by adding a delay between shots. Now it seems it's sufficient to forbid shooting until warmup + cooldown ticks have passed.
(Just thought of this: There are researches for increasing shooting speed. Therefore, I'd also need to keep track of the research level for each force, as well as which ammo item needs what resarch -- think "flammables" vs. "projectiles". Holy shit, I think I'd better unthink this and simply ignore researches altogether!

)