Ground of Aces Scripting API
Get Enemy Count

Mission.get_enemy_count

Parameters

mission_entity_id Entity ID of the mission currently accessing the mission script

Returns

Int The number of enemies airplanes will have.

Description

Event handler that returns the number of enemy airplanes the pilots participating in the mission will have to face. After 18 enemy planes the UI will not work properly. This event handler is invoked during the initialization of the mission.

import random
@event_handler(MissionEvent.GET_ENEMY_COUNT)
def get_enemy_count(mission_entity_id):
# Return a random number of enemies between 2 and 10
return random.randrange(2, 10)