LuaEvents.wiki
changeset 1774 086bebb89963
parent 1770 729bef6b40da
child 1775 9a5472760632
equal deleted inserted replaced
1773:ea37b1f499dd 1774:086bebb89963
    74 
    74 
    75 If a crate was dropped, `gear` is the crate gear that was dropped, if no crate was dropped, `gear` is `nil`.
    75 If a crate was dropped, `gear` is the crate gear that was dropped, if no crate was dropped, `gear` is `nil`.
    76 
    76 
    77 This function is useful to add custom crate drops as well.
    77 This function is useful to add custom crate drops as well.
    78 
    78 
       
    79 === <tt>onSuddenDeath()</tt> ===
       
    80 This function is called on the start of Sudden Death.
       
    81 
    79 === <tt>onGameResult(winningClan)</tt> (0.9.25) ===
    82 === <tt>onGameResult(winningClan)</tt> (0.9.25) ===
    80 This function calls when the game ends with a winner or in a draw. If a clan wins, `winningClan` is the clan ID of the winning clan. If the game ends in a draw, `winningClan` is set to -1.
    83 This function calls when the game ends with a winner or in a draw. If a clan wins, `winningClan` is the clan ID of the winning clan. If the game ends in a draw, `winningClan` is set to -1.
    81 
    84 
    82 === <tt>onSuddenDeath()</tt> ===
    85 === <tt>onAchievementsDeclaration()</tt> ===
    83 This function is called on the start of Sudden Death.
    86 This function is called after the stats for the stats screen (after the game) have been generated. You are supposed to call `DeclareAchievement` here.
    84 
    87 
    85 === <tt>onUsedAmmo(ammoType)</tt> ===
    88 === <tt>onUsedAmmo(ammoType)</tt> ===
    86 Called after a weapon has been used completely, with `ammoType` as the used ammo type.
    89 Called after a weapon has been used completely, with `ammoType` as the used ammo type.
    87 
    90 
    88 For example, it is called right after a bazooka is fired, when both shots of a shotgun have been fired, when extra time is used, or when all 4 shots of a portable portal device have been fired. It is also called when using a multi-shot ammo has been aborted by changing the weapon selection mid-way, because this still uses up the ammo.
    91 For example, it is called right after a bazooka is fired, when both shots of a shotgun have been fired, when extra time is used, or when all 4 shots of a portable portal device have been fired. It is also called when using a multi-shot ammo has been aborted by changing the weapon selection mid-way, because this still uses up the ammo.
   229 === <tt>onSpecialPoint(x, y, flags)</tt> ===
   232 === <tt>onSpecialPoint(x, y, flags)</tt> ===
   230 This is used while a special hand-drawn map is loaded. The engine is building these hand-drawn maps by reading points from the map definition. Optionally, some of these points may be “special”. These are not actually drawn on the map, but are used to store additional information for a position on the map. Special points currently need to be added manually in the map, the in-game editor is not able to add those yet.
   233 This is used while a special hand-drawn map is loaded. The engine is building these hand-drawn maps by reading points from the map definition. Optionally, some of these points may be “special”. These are not actually drawn on the map, but are used to store additional information for a position on the map. Special points currently need to be added manually in the map, the in-game editor is not able to add those yet.
   231 Now, when such a special point at the coordinates `x` and `y` with an assigned value of `flags` is added, this function is called. `flags` is a whole number between `0` and `255` inclusive.
   234 Now, when such a special point at the coordinates `x` and `y` with an assigned value of `flags` is added, this function is called. `flags` is a whole number between `0` and `255` inclusive.
   232 
   235 
   233 This function is used in Racer and !TechRacer to define waypoints.
   236 This function is used in Racer and !TechRacer to define waypoints.
   234 
       
   235 == Achievements ==
       
   236 === <tt>onAchievementsDeclaration()</tt> ===
       
   237 This function is called after the stats for the stats screen (after the game) have been generated. You are supposed to call `DeclareAchievement` here.