I'm not sure how possible this would be to integrate with the current code however would it be possible to add a call-in where when a unit is looking for a target to attack it first calls:
UnitFindTarget() --> "unitID, unitDefID, teamID, engineTarget, validTargets"
Where validTargets is a table of enemy unitID's which are being assessed for targeting and engineTarget is what the engine would have chosen.
You could then either return engineTarget or perform some operations on validTargets to return a different preferred target or even return false to force hold fire.
This would allow you to do stuff like write your own priority code, and handle Neutral units which are neutral to certain teams only and many other things.
UnitFindTarget callin?
Moderator: Moderators
- TheFatController
- Balanced Annihilation Developer
- Posts: 1177
- Joined: 10 Dec 2006, 18:46
Re: UnitFindTarget callin?
sounds like what "TargetWeight" (COB+LUS) does :x
- TheFatController
- Balanced Annihilation Developer
- Posts: 1177
- Joined: 10 Dec 2006, 18:46
Re: UnitFindTarget callin?
Problem there is editing every unit script and dealing with the undocumented cob aiming code rather than being able to apply blanket rules and behaviour via a single script.jK wrote:sounds like what "TargetWeight" (COB+LUS) does