My initial assumption was that you can use it to force a unit with long-ranged weapons to close in to a shorter range when having an Attack order.
e.g. unit has three weapons, longest ranged one has 600 range, so it normally tries to close to 600 range and then stops
but with Spring.SetUnitMaxRange(unitID, 100), it closes to 100 range.
However, in Spring 100 and 100.0.1-289-g236a068, all it actually seems to do is change the leash range at which units which are idle or have Fight/Patrol orders move to attack nearby enemies. The unit will always camp at its longest weapon range when Attacking, no matter what.
Do I mantis this? Is there a way to do the thing described in the first paragraph?
What does Spring.SetUnitMaxRange() do exactly?
Moderator: Moderators
- KingRaptor
- Zero-K Developer
- Posts: 838
- Joined: 14 Mar 2007, 03:44
Re: What does Spring.SetUnitMaxRange() do exactly?
I think you'll have to make your own custom attack command to do it properly, MaxRange only sets leash for patrol/fight as you said, though this is also tied to movestate, so you will get different results for hold / manuever / roam.
Re: What does Spring.SetUnitMaxRange() do exactly?
You're correct, units stop trying to close distance once they can fire at their target with any weapon, so as FLOZi said, you must implement a custom command.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: What does Spring.SetUnitMaxRange() do exactly?
Didn't units once stop once their first weapon is in range? Have we lost functionality somewhere?
Re: What does Spring.SetUnitMaxRange() do exactly?
That's the current situation as well.Google_Frog wrote:Didn't units once stop once their first weapon is in range? Have we lost functionality somewhere?
Re: What does Spring.SetUnitMaxRange() do exactly?
Are you sure?hokomoko wrote:That's the current situation as well.Google_Frog wrote:Didn't units once stop once their first weapon is in range? Have we lost functionality somewhere?
I think it is now the longest ranged weapon (though may depend on movestate)
Re: What does Spring.SetUnitMaxRange() do exactly?
Ah, communication issue! I thought:
First weapon = the first to be in range
and not
First weapon = weapons[1]
First weapon = the first to be in range
and not
First weapon = weapons[1]
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: What does Spring.SetUnitMaxRange() do exactly?
I'm guessing that it completely ignores categories? I hope not. Otherwise you might have a long range aa unit with a shorter range ground weapon happily stopping short of a ground target with it's thumb lodged directly up it's ass.
That's of course just one scenario... What if it is a ground unit with a ground weapon but can't fire at a target due to categories? Spring allows targeting of things that the unit can't fire at when there is no better target around, it just isn't able to fire at those things it has targeted. This behavior is especially irritating with air units.
That's of course just one scenario... What if it is a ground unit with a ground weapon but can't fire at a target due to categories? Spring allows targeting of things that the unit can't fire at when there is no better target around, it just isn't able to fire at those things it has targeted. This behavior is especially irritating with air units.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: What does Spring.SetUnitMaxRange() do exactly?
GF is right though, it used to be first weapon and was changed, a long time ago, afaik by accident since I never saw it in the changelog. BAs chickens suffers a bit as a result.
Re: What does Spring.SetUnitMaxRange() do exactly?
My hope was for the function to allow us to set it arbitrarily but I didn't go deep enough
Re: What does Spring.SetUnitMaxRange() do exactly?
last time I checked, if you make a gunship-type aircraft with both a med range weapon and a long range weapon (ex: 450 range rockets and 700 range missiles), it'll hover at the longest weapon range instead of closing in to fire with both.