OverrideRespecSoldierProjectPoints

Tracking Issue: #624

Tags: events

The 'OverrideRespecSoldierProjectPoints' event that allows mods to override the number of project points, i.e. time required to respec a given soldier.

The listener is passed the Unit State of the soldier that is to be respecced and the current amount of project points required, either from the base game's config, or from a listener that has fired earlier. To override the project points, the listener simply needs to provide a new value for the ProjectPoints element of the tuple.

OverrideRespecSoldierProjectPoints event

Param Value
EventID OverrideRespecSoldierProjectPoints
EventData XComLWTuple
EventSource XComGameState_HeadquartersProjectRespecSoldier
NewGameState none

Tuple contents

Index Name Type Direction
0 Unit XComGameState_Unit in
1 ProjectPoints int inout

Listener template

static function EventListenerReturn OnOverrideRespecSoldierProjectPoints(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComGameState_HeadquartersProjectRespecSoldier RespecProject;
    local XComLWTuple Tuple;
    local XComGameState_Unit Unit;
    local int ProjectPoints;

    RespecProject = XComGameState_HeadquartersProjectRespecSoldier(EventSource);
    Tuple = XComLWTuple(EventData);

    Unit = XComGameState_Unit(Tuple.Data[0].o);
    ProjectPoints = Tuple.Data[1].i;

    // Your code here

    Tuple.Data[1].i = ProjectPoints;

    return ELR_NoInterrupt;
}

Source code references