AllowNoSquadSizeUpgradeAchievement

Tracking Issue: #994

Tags: events

The achievement "The Few and the Proud" requires the player to defeat the aliens on Commander or Legend difficulty without increasing their squad size. The default logic checks specifically for the GTS upgrades SquadSizeIUnlock and SquadSizeIIUnlock and rewards the achievement if the player has neither upgrade purchased.

The event AllowNoSquadSizeUpgradeAchievement is triggered after the player finishes the final mission, in X2AchievementTracker. It resides in a static function, so there is no EventSource nor XComGameState passed. The EventData that is passed contains a LWTuple with a single boolean value. The value is initially set to the result of the default logic described above. Modders should check whatever they need to check and return the tuple value as true if the achievement should be awarded, or false otherwise.

AllowNoSquadSizeUpgradeAchievement event

Param Value
EventID AllowNoSquadSizeUpgradeAchievement
EventData XComLWTuple
EventSource none
NewGameState none

Tuple contents

Index Name Type Direction
0 AllowAchievement bool inout

Listener template

static function EventListenerReturn OnAllowNoSquadSizeUpgradeAchievement(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComLWTuple Tuple;
    local bool AllowAchievement;

    Tuple = XComLWTuple(EventData);

    AllowAchievement = Tuple.Data[0].b;

    // Your code here

    Tuple.Data[0].b = AllowAchievement;

    return ELR_NoInterrupt;
}

Source code references