Other great resources: Official JS API docs, Scripting Forum
eventAttackedUnthrottled()
Throttled event
The event is "unthrottled", which means that it is called for every single attack. It's therefore useful for micromanagement of droids when they are engaged in battle or come under attack.
If you do not require droid micromanagement, use eventAttacked() instead as it puts less strain on the CPU and is less likely to cause game lag.
Overview
This event is called when your droids or structures are attacked.This event is useful for retreating damaged units, or repairing damage buildings, after an enemy attacks them.
Availability
Warzone 3.2 and above.
Syntax
function eventAttackedUnthrottled(victim, attacker) { // do stuff }
Parameters
Parameter | Type | Mandatory | Description | Game version |
---|---|---|---|---|
victim | Which of my things did the enemy attack? | 3.2 | ||
attacker | What did the enemy use to attack me? | 3.2 |
Return value
Warzone does not process the event handler's return value.
Example
See eventAttacked() for examples.
See also
- bind() – monitor when stuff that doesn't belong to you gets destroyed
- Droids – summary of all API features relating to droids
- eventAttacked() – throttled version of eventAttackedUnthrottled()
- eventDestroyed() – monitor when your stuff gets destroyed
- Structures – summary of all API features relating to structures