send_incident

This function sends an "incident" to the game engine. Incidents can be announcer voiceovers, medals (to be awarded to the "cause" player), or even triggers for unlocking achievements.

Arguments

incident

The ID of an event that the game engine can be told about.

cause

The cause of the incident: a player or team , or the value all_players.

target

The target of the incident: a player or team , or the value all_players.

detail

A numeric constant or variable.

Example

--
-- Code for awarding the "Dive Bomber" DLC achievement, which you earn by 
-- killing a player with an assassination while they're using a jetpack:
--
-- (Assumes Forge Label #0 is an unnamed label referring to jetpacks.)
--
for each player do -- award Dive Bomber achievement as appropriate
   alias killer    = global.player[0]
   alias killer_aa = global.object[0]
   alias death_mod = global.number[2]
   if current_player.killer_type_is(kill) then 
      killer    = no_player
      killer    = current_player.try_get_killer()
      death_mod = 0
      death_mod = current_player.try_get_death_damage_mod()
      if death_mod == enums.damage_reporting_modifier.assassination then 
         killer_aa = no_object
         killer_aa = killer.try_get_armor_ability()
         if killer_aa.has_forge_label(0) and killer_aa.is_in_use() then 
            send_incident(dlc_achieve_2, killer, killer, 65)
         end
      end
   end
end