Skip to content

Dgun prioritisation (for coms)#5764

Open
Stiofan-K wants to merge 1 commit into
ZeroK-RTS:masterfrom
Stiofan-K:com-dgun-prioritisation
Open

Dgun prioritisation (for coms)#5764
Stiofan-K wants to merge 1 commit into
ZeroK-RTS:masterfrom
Stiofan-K:com-dgun-prioritisation

Conversation

@Stiofan-K

Copy link
Copy Markdown
Contributor

A workaround attempt to avoid forcefire/settarget from conflicting with dgun commands.

Does some manual shenanigans to gurantee that a dgun will (eventually) be prioritised over a set target/force fire command.
@Stiofan-K

Stiofan-K commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Issue is reproducable by setting forcefire/set target and then dgunning the opposite direction. Not really an issue for small or 0 aim deviations, but I assume it's the underlying cause of some dguns not firing.

Doesnt feel like a clean fix, though I used it for Dante too. PR is more to get the ball rolling and some insights.

From observation, it seems that it's set target and forcefire that conflict with dgun orders, while a commander given a stop command and as such has no target set, prioritises it's dgun without need for workaround even if it shoots other things inbetween.

I've tried to unset the target through Spring.SetUnitTarget and the Unitrules param "target_type" as the unit_target_on_the_move gadget does it, but that didnt seem to do the same thing as a stop command, with some linger data that I assume causes the resulting jittering/aim conflict.

@GoogleFrog

Copy link
Copy Markdown
Contributor

A more robust fix may be to set some GG in script.AimWeapon for the num corresponding to manual fire. The GG would index by unitID, and have the frame it was set as a value. The set target gadget would then avoid setting targets if the unit attempted to dgun too recently (the GG could even be cleared on script.Shot, or whatever turns out to be approriate).

There is a related problem with set target where Attack commands fight for priority. This could be dealt with by setting the frame offset in the gadget equal to the SlowUpdate offset in the engine, but at some point SlowUpdates became staggered and the engine does not expose their offsets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants