OverrideEligibleStartingRegion

Tracking Issue: #1303

Tags: events

This Event allows mods to override the default behavior for whether a region is allowed to be the starting region. The default behavior is that a region is eligible to be the starting region if it has at least two links to regions on the same continent as itself.

To override that behavior, add a listener that has RegisterInCampaignStart set to true and within the listener function simply change the value of the ValidStartRegion field in the given tuple data. For example, you could always set it to true to remove the constraints completely, so that any region is a valid starting region.

This event is triggered during a start state, which you can access via XComGameStateHistory:GetStartState().

OverrideEligibleStartingRegion event

Param Value
EventID OverrideEligibleStartingRegion
EventData XComLWTuple
EventSource XComGameState_WorldRegion
NewGameState none

Tuple contents

Index Name Type Direction
0 ValidStartRegion bool inout

Listener template

static function EventListenerReturn OnOverrideEligibleStartingRegion(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComGameState_WorldRegion PotentialStartRegion;
    local XComLWTuple Tuple;
    local bool ValidStartRegion;

    PotentialStartRegion = XComGameState_WorldRegion(EventSource);
    Tuple = XComLWTuple(EventData);

    ValidStartRegion = Tuple.Data[0].b;

    // Your code here

    Tuple.Data[0].b = ValidStartRegion;

    return ELR_NoInterrupt;
}

Source code references