Mission.send_mission_event
Parameters
| |
mission_entity_id | Entity ID of the mission currently accessing the mission script |
Description
Event handler is called periodically at a rate of event_count / mission_duration
where event_count
defined by get_mission_event_count and mission_duration
defined by getMissionCompletionTime. The send_mission_event event handler is intended for relaying information on how the mission is being carried out, change the outcome of the mission, or even influence the crew morale present in the airbase.
@event_handler(MissionEvent.GET_MISSION_EVENTS_COUNT)
def get_mission_events_count(mission_entity_id):
return 5
@event_handler(MissionEvent.SEND_MISSION_EVENT)
def send_mission_event(mission_entity_id):
events_sent_count = missions_api.GetNumberOfEventsSent(mission_entity_id)
if events_sent_count == 0:
localization.SetTerm("en", "mission_event", "mission started")
elif events_sent_count == 1:
localization.SetTerm("en", "mission_event", "airplane formation reaching target")
elif events_sent_count == 2:
localization.SetTerm("en", "mission_event", "airplane formation")
elif events_sent_count == 3:
localization.SetTerm("en", "mission_event", "airplane formation returning")
elif events_sent_count == 4:
localization.SetTerm("en", "mission_event", "airplane formation gonna land")
event_log.Create("mission_event")