2024-04-24 01:05 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004443Spring engineUnit Scriptingpublic2014-07-08 14:41
ReporterFLOZi 
Assigned ToKloot 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
Product Version97.0.1+git 
Target VersionFixed in Version 
Summary0004443: The case for 'maneuverleashlength'
DescriptionLong story as short as I can muster: in OTA there was a tag 'maneuverleashlength' which determined how far away a unit could be 'kited' by an enemy when set to Maneuver

In Spring it looks like that is hardcoded to magic 500 https://github.com/spring/spring/blob/develop/rts/Sim/Units/CommandAI/MobileCAI.cpp#L690

Could we have a unitdef tag? I know, I know... no more unitdef tags. But this replaces magic number and is much cleaner than rewriting whole movestate control in lua.
Additional InformationA real-game example of where this is useful:

US riflemen in S44 have shorter range than other teams (0000119:0000130 elmo).
On Hold Position they sit there and die whilst being fired upon.

On Maneuver they move to attack anything within 500 elmo + max range (535), which usually means they walk into a machinegun and die.

We would like to be able to make them move to attack anything within say 130 elmo + max range so they close the gap with enemy riflemen but don't go trying to attack the howitzer on the other side of the map.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0013411

FLOZi (reporter)

"Change the constant into a unit member variable and make that assignable from Lua (at *run*time) instead."

As there is currently no suitable API function to add this to, I can either

1. Add a new one-off function e.g. Spring.SetUnitManeuverLeash(unitID, leashLength)

2. Add it as a new key to Spring.MoveCtrl.SetGroundMoveTypeData instead

[3. Implement "a proper generic SetUnitParam callout for runtime-manipulable data." But that is something better left to the experts.]

Please advise to which implementation is preferable.

~0013412

abma (administrator)

jk said 2. is prefered
+Notes

-Issue History
Date Modified Username Field Change
2014-06-17 23:59 FLOZi New Issue
2014-07-06 19:05 FLOZi Note Added: 0013411
2014-07-06 19:28 abma Note Added: 0013412
2014-07-08 14:41 Kloot Status new => resolved
2014-07-08 14:41 Kloot Resolution open => fixed
2014-07-08 14:41 Kloot Assigned To => Kloot
+Issue History