OverrideEnemyFactionsAlertsOutsideVision

Tracking Issue: #1036

Tags: events

Fires an event that allows listeners to override whether a given alert cause can be triggered by AI units outside of XCOM's vision. For example, you could use this event to allow enemy pods to activate one another outside of XCOM vision for a given set of alert causes.

Return true in AllowThisCause if the alert cause can be triggered in such situations. Leave AllowThisCause untouched to retain the default behavior.

OverrideEnemyFactionsAlertsOutsideVision event

Param Value
EventID OverrideEnemyFactionsAlertsOutsideVision
EventData XComLWTuple
EventSource none
NewGameState none

Tuple contents

Index Name Type Direction
0 AlertCause enum (EAlertCause) in
1 AllowThisCause bool inout

Listener template

static function EventListenerReturn OnOverrideEnemyFactionsAlertsOutsideVision(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComLWTuple Tuple;
    local EAlertCause AlertCause;
    local bool AllowThisCause;

    Tuple = XComLWTuple(EventData);

    AlertCause = EAlertCause(Tuple.Data[0].i);
    AllowThisCause = Tuple.Data[1].b;

    // Your code here

    Tuple.Data[1].b = AllowThisCause;

    return ELR_NoInterrupt;
}

Source code references