LuaLibraryUtils.wiki
changeset 1830 e562fccced8e
parent 1829 d92951dbb8b6
equal deleted inserted replaced
1829:d92951dbb8b6 1830:e562fccced8e
    22 == `updateChallengeRecord(recordType, value[, stat])` (1.0.0) ==
    22 == `updateChallengeRecord(recordType, value[, stat])` (1.0.0) ==
    23 Report a new team record attempt in a [Missions mission] (preferably challenge missions). In missions, the team file of the mission team (see `AddMissionTeam` for more infos) can store several records (such as highscores) which will be shown in the frontend when the mission is selected. Note this only works for non-campaign missions so far.
    23 Report a new team record attempt in a [Missions mission] (preferably challenge missions). In missions, the team file of the mission team (see `AddMissionTeam` for more infos) can store several records (such as highscores) which will be shown in the frontend when the mission is selected. Note this only works for non-campaign missions so far.
    24 
    24 
    25 Calling this function means the team has made a record attempt of a given record type (e.g. fastest time or highscore) with a given `value`. If the team's own record has been beaten, or is has set the first record, the team file is being updated.
    25 Calling this function means the team has made a record attempt of a given record type (e.g. fastest time or highscore) with a given `value`. If the team's own record has been beaten, or is has set the first record, the team file is being updated.
    26 
    26 
    27  * `recordType`: Type of record (see [ConfigurationFiles#%5BMission%2520%3CMISSION_NAME%3E%5D here] for a list)
    27 Usually you want to call this function at the end of a mission, when it has completed and the final score/time/whatever is known.
       
    28 
       
    29 Parameters:
       
    30 
       
    31  * `recordType`: Type of record (see [ConfigurationFiles#%5BMission%2520%3CMISSION_NAME%3E%5D here] for a list), as a string
    28  * `value`: Value that has been achieved by the team
    32  * `value`: Value that has been achieved by the team
    29  * `stat`: If `true` (default), will also write a message in the stats screen (whether record has been beaten, or current record if not). Otherwise, this writes nothing.
    33  * `stat`: If `true` (default), will also write a message in the stats screen (whether record has been beaten, or current record if not). Otherwise, this writes nothing.
       
    34 
       
    35 Example:
       
    36 <code lang="lua">
       
    37 -- Report a team score of 12000 to the game
       
    38 updateChallengeRecord("Highscore", 12000)
       
    39 </code>
    30 
    40 
    31 == `getReadableChallengeRecord(recordType)` (1.0.0) ==
    41 == `getReadableChallengeRecord(recordType)` (1.0.0) ==
    32 Returns a human-readable description of a team record of the mission team (see also: `AddMissionTeam`) for the current challenge [Missions mission]. Team records are read from the team file. `recordType` is a record type. Possible record types are listed [ConfigurationFiles#%5BMission%2520%3CMISSION_NAME%3E%5D here]. This can be useful to display something in `ShowMission`.
    42 Returns a human-readable description of a team record of the mission team (see also: `AddMissionTeam`) for the current challenge [Missions mission]. Team records are read from the team file. `recordType` is a record type. Possible record types are listed [ConfigurationFiles#%5BMission%2520%3CMISSION_NAME%3E%5D here]. This can be useful to display something in `ShowMission`.
    33 
    43 
    34 If the team does not have a record for the given record type yet, the empty string is returned. If the record type is invalid, `nil` is returned.
    44 If the team does not have a record for the given record type yet, the empty string is returned. If the record type is invalid, `nil` is returned.