Ground of Aces Modding
Loading...
Searching...
No Matches
Get Time to Start

Missions.get_time_to_start

Parameters

mission_entity_id Entity ID of the mission currently accessing the mission script

Returns

Int The amount of time available to start the mission, in game minutes

Description

Event handler that returns how long the player has to launch the mission before it is cancelled and leaves the war map (the game then fires send_mission_cancelled_text). It is called once, while the mission is created, and only for a mission without a .json - a mission with JSON rolls its _timeToStartRange instead. When the handler is missing the game uses 60 minutes.

Returning 0 or a negative number cancels the mission on the next minute tick; unlike the JSON field there is no "never expires" value here.

import random
from Blindflug.FlightMission import MissionEvent
@event_handler(MissionEvent.GET_TIME_TO_START)
def get_time_to_start(mission_entity_id):
# Return a random start time between two and four hours
return random.randrange(120, 240)
Definition FlightMissionEcsInstaller.cs:7