Ground of Aces Modding
Loading...
Searching...
No Matches
Get Mission Result

Missions.get_mission_result

Parameters

mission_entity_id Entity ID of the mission currently accessing the mission script

Returns

Boolean True when the mission succeeded.

Description

Event handler that decides whether a mission is successful or not. It is called once, when the flight completes, and only for a mission without a .json - a mission with JSON picks one of its four _missionOutcomes from the as-planned roll and the skill roll instead, and never calls this handler.

For a mission without JSON it is required: if it is missing the game throws Mission result not available when the flight completes. After it returns, set_mission_impact runs and the result is written to the mission.

from Blindflug.FlightMission import MissionEvent
@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
Definition FlightMissionEcsInstaller.cs:7