And the recently added template object (despite being experimental) a .type = TEMPLATE_DATA ?
@NoQ: Why not just have an eventSensorLock(sensor[, target]):
* Triggers when a sensor droid locks on to a target (which means it also fires when a new target is selected)
* Triggers when sensor droid no longer has a target, 'target' = not defined in this scenario
Code: Select all
eventSensorLock(sensor, target) {
if (!target) // sensor is inactive
}
* null -- the droid is not currently targeting any game object or position
* the target a sensor is locked on to
* the structure a truck is building
* the object a weapon is attacking
* the repair/rearm pad a droid is going to or at
* the POSITION on the map a droid is moving to, circling, etc.
* the patrol points, expressed as an AREA object (droid patrols between x1,y1 and x2,y2)
* etc...
So .target could be an object of types: DROID, STRUCTURE, FEATURE, POSITION
It could that sensor targets are split out in to a .sensorTarget property instead?