Page 1 of 1

UnitFindTarget callin?

Posted: 04 Jul 2010, 14:30
by TheFatController
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.

Re: UnitFindTarget callin?

Posted: 04 Jul 2010, 15:40
by jK
sounds like what "TargetWeight" (COB+LUS) does :x

Re: UnitFindTarget callin?

Posted: 04 Jul 2010, 19:50
by TheFatController
jK wrote:sounds like what "TargetWeight" (COB+LUS) does :x
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.