Ground of Aces Scripting API
Get Mission Result

Mission.get_mission_result

Parameters

mission_entity_id Entity ID of the mission currently accessing the mission script

Returns

Boolean The outcome of the mission.

Description

Event handler that returns whether a mission is successful or not. This event handler is invoked once the mission is complete before the get_mission_fatalities event handler.

@event_handler(MissionEvent.GET_MISSION_RESULT)
def get_mission_result(mission_entity_id):
# Get the number of formation airplanes and number of enemy airplanes
mission_formation_count = len(missions_api.GetMissionAirplaneFormation(mission_entity_id))
mission_enemy_count = missions_api.GetEnemyCount(mission_entity_id)
# Mission will be successful if the number of airplanes in the formation is greater than the enemy airplanes
return mission_formation_count > mission_enemy_count