UnitFindTarget callin?
Posted: 04 Jul 2010, 14:30
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() --> "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.