Allow vehicles to retain target on move command
Retain target on movement command
- It is now possible for vehicles to retain their target when issued movement command by setting
KeepTargetOnMoveto true.- Note that no check is done whether or not the vehicle or the weapon can actually fire while moving, this is on modder's discretion.
- The target is automatically reset if the vehicle moves beyond the weapon's range from the target.
KeepTargetOnMove.ExtraDistancecan be used to modify the distance considered 'out of range' from target (it is added to weapon range), negative values work to reduce the distance.
In rulesmd.ini:
[SOMEVEHICLE] ; VehicleType
KeepTargetOnMove=false ; boolean
KeepTargetOnMove.ExtraDistance=0 ; floating point value, distance in cells
Nightly build for this pull request:
- compiled-dll-e42fd4c5b240110ad3ef5772a0b4a83b7815c128.zip These artifacts will expire in 90 days and will not be available for download after that time.
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.
Very useful improvement. Adding a global version tag in [General] would be better I think, as the flags may be used by many UnitTypes.
In this build I had a weird instance of a subterranean harvester getting stuck underground and only able to move around, but never back up to the ground. And after a while, the game crashed, but it might not be related to that harvester. Here's the link: https://drive.google.com/file/d/1Zbul8kBow3Q-zuzHt__L86NkuqHpqYLJ
https://drive.google.com/file/d/111p6BCPOZ2Js3qFYof9DcgTjbJOj1iYm Another crash in this newest build available. No idea what's the reason. The except.txt looks very similar (3 topmost elements on the stack are the same).
Besides these crashes (that might or might not be related to the build), both tags seem to work fine.
Adding a global version tag in [General] would be better I think, as the flags may be used by many UnitTypes.
@Starkku what do you think?
This was added with designing specific units in mind, not for general application - think units like Cyclone in SC2. Giving this to all globally would very likely not improve general unit behavior at all and annoy many players when a lot of imprecise "target out of range" situations happens and combat gets interrupted. But you can try, though definitely not instead of the unit-specific tag.
Yeah in no way that is going to be "instead".
Yeah in no way that is going to be "instead".
This sounds like a worse version of queue move.
Yeah in no way that is going to be "instead".
This sounds like a worse version of queue move.
Waiting for the day ZivDero restores proper Q-Move
Yeah in no way that is going to be "instead".
This sounds like a worse version of queue move.
Waiting for the day ZivDero restores proper Q-Move
As far as I can see, it's a matter of 2 hooks, each maybe a couple lines long. I can instruct you on it :P
This was pretty much explicitly trying to imitate Terran Cyclone's behaviour from SC2 rather than aiming for any sort of general unit behaviour improvement just like @Speederovsky stated so I am somewhat hesitant to add the global control and consider it to be a poor idea but if there are people who insist on it I guess I could.
Do not come complaining it plays like shit if you do though.
No global control it is then.
Waiting for the day ZivDero restores proper Q-Move