Ground of Aces Scripting API
Get Mission Fatalities

Mission.get_mission_result

Parameters

mission_entity_id Entity ID of the mission currently accessing the mission script

Returns

int32[] An array of entity ids.

Description

Event handler that returns an array which contains the entity id of which airplanes have been shot down during the mission. This event handler is invoked once the mission is complete after the get_mission_result event handler is called and the result is written to the mission data.

@event_handler(MissionEvent.GET_MISSION_FATALITIES)
def get_mission_fatalities(mission_entity_id):
airplanes_shot_down = []
# Get whether a mission is successful or not
is_mission_successful = missions_api.IsMissionSuccessful(mission_entity_id)
if is_mission_succesful:
mission_airplane_formation = missions_api.GetMissionAirplaneFormation(mission_entity_id)
# If a mission is not successfull each plane has a 50/50 chance of being shot down
for airplane_id in mission_airplane_formation:
if random.randrange(1, 100) < 50:
airplanes_shot_down.append(airplane_id)
return airplanes_shot_down