LuaAPI.wiki
changeset 1656 a262e8d3380d
parent 1655 e7d9a849444b
child 1657 899707a349b3
equal deleted inserted replaced
1655:e7d9a849444b 1656:a262e8d3380d
   186 
   186 
   187 The proper way to disable Sudden Death is by setting both `WaterRise` and `HealthDecrease` to `0`.
   187 The proper way to disable Sudden Death is by setting both `WaterRise` and `HealthDecrease` to `0`.
   188 
   188 
   189 If you want to add teams or hogs manually, you have to do it here. If you want to draw your own map using `AddPoint` and `FlushPoints`, you have to do this within this function as well.
   189 If you want to add teams or hogs manually, you have to do it here. If you want to draw your own map using `AddPoint` and `FlushPoints`, you have to do this within this function as well.
   190 
   190 
   191 ==== `WorldEdge` ====
   191 ==== <tt>!WorldEdge</tt> ====
   192 The value of `WorldEdge` can have the following values:
   192 The value of `WorldEdge` can have the following values:
   193 
   193 
   194 || *Identifier* || *Meaning* ||
   194 || *Identifier* || *Meaning* ||
   195 || `weNone` || No world edges ||
   195 || `weNone` || No world edges ||
   196 || `weBounce` || Bouncy world edges ||
   196 || `weBounce` || Bouncy world edges ||
   393 === <tt>onRubberPlacement(frameIdx, centerX, centerY)</tt> ===
   393 === <tt>onRubberPlacement(frameIdx, centerX, centerY)</tt> ===
   394 This function is called when a rubber has been placed.
   394 This function is called when a rubber has been placed.
   395 
   395 
   396 `frameIdx` is used for the rubber orientation. The possible values are explained in `PlaceRubber`. `centerX` and `centerY` are the coordinates of the rubber’s center.
   396 `frameIdx` is used for the rubber orientation. The possible values are explained in `PlaceRubber`. `centerX` and `centerY` are the coordinates of the rubber’s center.
   397 
   397 
   398 === `onSpecialPoint(x, y, flags)` ===
   398 === <tt>onSpecialPoint(x, y, flags)</tt> ===
   399 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 (as of 0.9.23).
   399 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 (as of 0.9.23).
   400 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.
   400 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.
   401 
   401 
   402 This function is used in Racer and !TechRacer to define waypoints.
   402 This function is used in Racer and !TechRacer to define waypoints.
   403 
   403 
   404 === `onAchievementsDeclaration()` ===
   404 === </t>onAchievementsDeclaration()</tt> ===
   405 This function is called after the stats for the stats screen (after the game) have been generated. You are supposed to call `DeclareAchievement` here.
   405 This function is called after the stats for the stats screen (after the game) have been generated. You are supposed to call `DeclareAchievement` here.
   406 
   406 
   407 == Functions for creating gears ==
   407 == Functions for creating gears ==
   408 
   408 
   409 === <tt>!AddGear(x, y, gearType, state, dx, dy, timer)</tt> ===
   409 === <tt>!AddGear(x, y, gearType, state, dx, dy, timer)</tt> ===
   499 This function returns the [VisualGearTypes visual gear type] for the specified visual gear, if it exists.  If it doesn't exist, `nil` is returned.
   499 This function returns the [VisualGearTypes visual gear type] for the specified visual gear, if it exists.  If it doesn't exist, `nil` is returned.
   500 
   500 
   501 === <tt>!GetGearPosition(gearUid)</tt> ===
   501 === <tt>!GetGearPosition(gearUid)</tt> ===
   502 Returns x,y coordinates for the specified gear. Not to be confused with `GetGearPos`.
   502 Returns x,y coordinates for the specified gear. Not to be confused with `GetGearPos`.
   503 
   503 
   504 === `GetGearCollisionMask(gearUid)` ===
   504 === <tt>GetGearCollisionMask(gearUid)</tt> ===
   505 Returns the current collision mask of the given gear. See `SetGearCollisionMask` for an explanation of the mask.
   505 Returns the current collision mask of the given gear. See `SetGearCollisionMask` for an explanation of the mask.
   506 
   506 
   507 === <tt>!GetGearRadius(gearUid)</tt> ===
   507 === <tt>!GetGearRadius(gearUid)</tt> ===
   508 Returns the `Radius` value for the specified gear. For most [GearTypes gear types] for “projectile” gears (like `gtShell` or `gtGrenade`), the radius refers to the gear's collision radius. This is an invisible circle around the center of the gear which is used for the collision checks. For a few gear types, its radius means something different, see [GearTypes] for a full list.
   508 Returns the `Radius` value for the specified gear. For most [GearTypes gear types] for “projectile” gears (like `gtShell` or `gtGrenade`), the radius refers to the gear's collision radius. This is an invisible circle around the center of the gear which is used for the collision checks. For a few gear types, its radius means something different, see [GearTypes] for a full list.
   509 
   509 
   786 
   786 
   787 Example:
   787 Example:
   788 
   788 
   789 <code language="lua">    gear = AddGear(...)
   789 <code language="lua">    gear = AddGear(...)
   790     FindPlace(gear, true, 0, LAND_WIDTH) -- places the gear randomly between 0 and LAND_WIDTH</code>
   790     FindPlace(gear, true, 0, LAND_WIDTH) -- places the gear randomly between 0 and LAND_WIDTH</code>
   791 === `HogSay(gearUid, text, manner [,vgState])` ===
   791 === <tt>HogSay(gearUid, text, manner [,vgState])</tt> ===
   792 Makes the specified gear say, think, or shout some text in a comic-style speech or thought bubble. `gearUid` is _not_ limited to hedgehogs, altough the function name suggests otherwise.
   792 Makes the specified gear say, think, or shout some text in a comic-style speech or thought bubble. `gearUid` is _not_ limited to hedgehogs, altough the function name suggests otherwise.
   793 
   793 
   794 The `manner` parameter specifies the type of the bubble and can have one of these values:
   794 The `manner` parameter specifies the type of the bubble and can have one of these values:
   795 
   795 
   796 || *Value of `manner`* || *Looks* ||
   796 || *Value of `manner`* || *Looks* ||
   818 <code language="lua">    HogTurnLeft(CurrentHedgehog, true) -- turns CurrentHedgehog left 
   818 <code language="lua">    HogTurnLeft(CurrentHedgehog, true) -- turns CurrentHedgehog left 
   819     HogTurnLeft(CurrentHedgehog, false) -- turns CurrentHedgehog right</code>
   819     HogTurnLeft(CurrentHedgehog, false) -- turns CurrentHedgehog right</code>
   820 === <tt>!SetGearPosition(gearUid, x, y)</tt> ===
   820 === <tt>!SetGearPosition(gearUid, x, y)</tt> ===
   821 Places the specified gear exactly at the position (`x`,`y`). Not to be confused with `SetGearPos`.
   821 Places the specified gear exactly at the position (`x`,`y`). Not to be confused with `SetGearPos`.
   822 
   822 
   823 === `SetGearCollisionMask(gearUid, mask)` ===
   823 === <tt>SetGearCollisionMask(gearUid, mask)</tt> ===
   824 Set the collision mask of the given gear with `gearUid`.
   824 Set the collision mask of the given gear with `gearUid`.
   825 The collision mask defines with which gears and terrain types the gear can collide.
   825 The collision mask defines with which gears and terrain types the gear can collide.
   826 
   826 
   827 `mask` is a number between `0x0000` and `0xFFFF` and used as a bitfield, which means you can combine these flags with `bor`. These are the available flags:
   827 `mask` is a number between `0x0000` and `0xFFFF` and used as a bitfield, which means you can combine these flags with `bor`. These are the available flags:
   828 
   828 
   896             -- Turn mine into dud
   896             -- Turn mine into dud
   897             SetHealth(gear, 0)
   897             SetHealth(gear, 0)
   898        end
   898        end
   899     end</code>
   899     end</code>
   900 
   900 
   901 === `HealHog(gearUid, healthBoost[, showMessage[, tint]])` (0.9.24) ===
   901 === <tt>HealHog(gearUid, healthBoost[, showMessage[, tint]])</tt> (0.9.24) ===
   902 Convenience function to increase the health of a hedgehog with default visual effects.
   902 Convenience function to increase the health of a hedgehog with default visual effects.
   903 
   903 
   904 Specifically, this increases the health of the hedgehog gear with the given ID `gearUid` by `healthBoost`, displays some healing particles at the hedgehog and shows the health increae as a message. This is similar to the behavour after taking a health crate, or getting a health boost from vampirism.
   904 Specifically, this increases the health of the hedgehog gear with the given ID `gearUid` by `healthBoost`, displays some healing particles at the hedgehog and shows the health increae as a message. This is similar to the behavour after taking a health crate, or getting a health boost from vampirism.
   905 
   905 
   906 If `showMessage` is false, no message is shown. With `tint` you can set the RGBA color of the particles (default: `0x00FF00FF`).
   906 If `showMessage` is false, no message is shown. With `tint` you can set the RGBA color of the particles (default: `0x00FF00FF`).
   987 Sets the timer of the specified gear. Also see `GetTimer`.
   987 Sets the timer of the specified gear. Also see `GetTimer`.
   988 
   988 
   989 === <tt>!SetHogLevel(gearUid, level)</tt> ===
   989 === <tt>!SetHogLevel(gearUid, level)</tt> ===
   990 Sets the bot level from 0 to 5. `1` is the strongest bot level and `5` is the weakest one (this is the reverse of what players see). `0` means human player.
   990 Sets the bot level from 0 to 5. `1` is the strongest bot level and `5` is the weakest one (this is the reverse of what players see). `0` means human player.
   991 
   991 
   992 === `SetGearAIHints(gearUid, aiHint)` ===
   992 === <tt>SetGearAIHints(gearUid, aiHint)</tt> ===
   993 Set some behaviour hints for computer-controlled hedgehogs for any given gear with `gearUid`.
   993 Set some behaviour hints for computer-controlled hedgehogs for any given gear with `gearUid`.
   994 
   994 
   995 Set `aiHint` to either of:
   995 Set `aiHint` to either of:
   996 
   996 
   997  * `aihUsualProcessing`: AI hogs treat this gear the usual way. This is the default.
   997  * `aihUsualProcessing`: AI hogs treat this gear the usual way. This is the default.
  1021 
  1021 
  1022 ==== <tt>!GetGameFlag(gameflag)</tt> ====
  1022 ==== <tt>!GetGameFlag(gameflag)</tt> ====
  1023 Returns `true` if the specified gameflag is enabled, otherwise `false`.
  1023 Returns `true` if the specified gameflag is enabled, otherwise `false`.
  1024 
  1024 
  1025 === Turns ===
  1025 === Turns ===
  1026 ==== `SkipTurn()` (0.9.24) ====
  1026 ==== <tt>SkipTurn()</tt> (0.9.24) ====
  1027 Forces the current hedgehog to skip its turn.
  1027 Forces the current hedgehog to skip its turn.
  1028 
  1028 
  1029 ==== `EndTurn([noTaunts])` (0.9.23) ====
  1029 ==== <tt>EndTurn([noTaunts])</tt> (0.9.23) ====
  1030 Ends the current turn immediately.
  1030 Ends the current turn immediately.
  1031 
  1031 
  1032 Normally, a “Coward” taunt may be played and an announcer message may be shown (depending on the situation). Set the optional `noTaunts` parameter to `true` to force the engine to never play a taunt or show a message. `noTaunts` is `false` by default.
  1032 Normally, a “Coward” taunt may be played and an announcer message may be shown (depending on the situation). Set the optional `noTaunts` parameter to `true` to force the engine to never play a taunt or show a message. `noTaunts` is `false` by default.
  1033 
  1033 
  1034 ==== `Retreat(time [, respectGetAwayTimeFactor)` (0.9.25) ====
  1034 ==== <tt>Retreat(time [, respectGetAwayTimeFactor)</tt> (0.9.25) ====
  1035 Forces the current turn into the retreating phase, as if the hog made an attack. That is, the current hedgehog is unable to attack or select a weapon, only movement is possible until the retreat time is up.
  1035 Forces the current turn into the retreating phase, as if the hog made an attack. That is, the current hedgehog is unable to attack or select a weapon, only movement is possible until the retreat time is up.
  1036 
  1036 
  1037 The retreat time must be set with `time` in milliseconds. By default, this time is automatically multiplied with get-away time percentage from the game scheme for seamless integration with schemes. If you want to ignore the game scheme for some reason and set the retreat time no matter what, set `respectGetAwayTimeFactor` to `false`.
  1037 The retreat time must be set with `time` in milliseconds. By default, this time is automatically multiplied with get-away time percentage from the game scheme for seamless integration with schemes. If you want to ignore the game scheme for some reason and set the retreat time no matter what, set `respectGetAwayTimeFactor` to `false`.
  1038 
  1038 
  1039 If the current hedgehog was busy doing an attack, the attack is aborted, no shot is made. If this function is called in the ready phase of af a turn, the ready phase continues normally, but the turn will begin in the retreat phase instead.
  1039 If the current hedgehog was busy doing an attack, the attack is aborted, no shot is made. If this function is called in the ready phase of af a turn, the ready phase continues normally, but the turn will begin in the retreat phase instead.
  1313 See also [GearMessages].
  1313 See also [GearMessages].
  1314 
  1314 
  1315 ==== <tt>!GetInputMask()</tt> ====
  1315 ==== <tt>!GetInputMask()</tt> ====
  1316 Returns the current input mask of the player.
  1316 Returns the current input mask of the player.
  1317 
  1317 
  1318 ==== `SetVampiric(bool)` (0.9.24) ====
  1318 ==== <tt>!SetVampiric(bool)</tt> (0.9.24) ====
  1319 Toggles vampirism mode for this turn. Set `bool` to `true` to enable (same effect as if the hedgehog has used Vampirism), `false` to disable.
  1319 Toggles vampirism mode for this turn. Set `bool` to `true` to enable (same effect as if the hedgehog has used Vampirism), `false` to disable.
  1320 
  1320 
  1321 ==== `GetVampiric()` (0.9.25) ====
  1321 ==== <tt>!GetVampiric()</tt> (0.9.25) ====
  1322 Returns true if vampirism mode is currently active.
  1322 Returns true if vampirism mode is currently active.
  1323 
  1323 
  1324 ==== `SetLaserSight(bool)` (0.9.24) ====
  1324 ==== <tt>!SetLaserSight(bool)</tt> (0.9.24) ====
  1325 Toggles laser sight for this turn. Set `bool` to `true` to enable (same effect as if the hedgehog has used Laser Sight), `false` to disable.
  1325 Toggles laser sight for this turn. Set `bool` to `true` to enable (same effect as if the hedgehog has used Laser Sight), `false` to disable.
  1326 
  1326 
  1327 ==== `GetLaserSight()` (0.9.25) ====
  1327 ==== <tt>!GetLaserSight()</tt> (0.9.25) ====
  1328 Returns true if laser sight (as utility) is currently active. The sniper rifle's built-in laser sight does not count.
  1328 Returns true if laser sight (as utility) is currently active. The sniper rifle's built-in laser sight does not count.
  1329 
  1329 
  1330 ==== `EnableSwitchHog()` (0.9.25) ====
  1330 ==== <tt>!EnableSwitchHog()</tt> (0.9.25) ====
  1331 Enable hog switching mode for the current hedgehog. This function should be called while the hedgehog is standing on solid ground (`GetFlightTime` returns 0).
  1331 Enable hog switching mode for the current hedgehog. This function should be called while the hedgehog is standing on solid ground (`GetFlightTime` returns 0).
  1332 
  1332 
  1333 Internally, this tries to spawn a `gtSwitcher` gear which, as long it exists, handles the hog switching. You can delete this gear to stop the hog switching prematurely. If there already is a `gtSwitcher` gear, no additional gear is spawned.
  1333 Internally, this tries to spawn a `gtSwitcher` gear which, as long it exists, handles the hog switching. You can delete this gear to stop the hog switching prematurely. If there already is a `gtSwitcher` gear, no additional gear is spawned.
  1334 
  1334 
  1335 On success, returns the `gtSwitcher` gear being spawned or, if hog switching mode is already active, returns the exsting gear. On failure, returns `nil`.
  1335 On success, returns the `gtSwitcher` gear being spawned or, if hog switching mode is already active, returns the exsting gear. On failure, returns `nil`.
  1391 ==== <tt>!DismissTeam(teamname)</tt> ====
  1391 ==== <tt>!DismissTeam(teamname)</tt> ====
  1392 Vaporizes all the hogs of the team with the given team name in a puff of smoke.
  1392 Vaporizes all the hogs of the team with the given team name in a puff of smoke.
  1393 
  1393 
  1394 This function must not be called while it's the team's turn.
  1394 This function must not be called while it's the team's turn.
  1395 
  1395 
  1396 ==== `SetTeamLabel(teamname[, label])` (0.9.24) ====
  1396 ==== <tt>!SetTeamLabel(teamname[, label])</tt> (0.9.24) ====
  1397 Set or remove a label for the team with the given team name. The label is a string and will be displayed next to the team's health bar.
  1397 Set or remove a label for the team with the given team name. The label is a string and will be displayed next to the team's health bar.
  1398 
  1398 
  1399 If `label` is `nil`, the label will be removed.
  1399 If `label` is `nil`, the label will be removed.
  1400 
  1400 
  1401 There's a special case: If the AI Survival game modifier is active, the AI kill counter will be replaced by the custom team label if it has been set. If `label` is set to `nil`, the default AI counter is shown again.
  1401 There's a special case: If the AI Survival game modifier is active, the AI kill counter will be replaced by the custom team label if it has been set. If `label` is set to `nil`, the default AI counter is shown again.
  1489 Sets the zoom level. The value for maximum zoom is currently 1.0 and for minimum 3.0 The default zoom level is 2.0
  1489 Sets the zoom level. The value for maximum zoom is currently 1.0 and for minimum 3.0 The default zoom level is 2.0
  1490 
  1490 
  1491 === <tt>!GetZoom()</tt> ===
  1491 === <tt>!GetZoom()</tt> ===
  1492 Returns the current zoom level.
  1492 Returns the current zoom level.
  1493 
  1493 
  1494 === `SetCinematicMode(enable)` (0.9.23) ===
  1494 === <tt>!SetCinematicMode(enable)</tt> (0.9.23) ===
  1495 Turns on or off cinematic mode. Cinematic mode can be used for cutscenes etc.
  1495 Turns on or off cinematic mode. Cinematic mode can be used for cutscenes etc.
  1496 If `enable` is set to `true`, cinematic mode is enabled,
  1496 If `enable` is set to `true`, cinematic mode is enabled,
  1497 if it is `false`, cinematic mode is disabled.
  1497 if it is `false`, cinematic mode is disabled.
  1498 
  1498 
  1499 == Sound functions ==
  1499 == Sound functions ==
  1500 === `PlaySound(soundId, [gearUid [, instaVoice]])` ===
  1500 === <tt>!PlaySound(soundId, [gearUid [, instaVoice]])</tt> ===
  1501 Plays the specified sound. Possible values for `soundId` are listed on the [Sounds] page.
  1501 Plays the specified sound. Possible values for `soundId` are listed on the [Sounds] page.
  1502 
  1502 
  1503 To play a voice (see [Taunts] for a list), you must also set `gearUid`. `gearUid` is the hedgehog gear which is used to “talk”.
  1503 To play a voice (see [Taunts] for a list), you must also set `gearUid`. `gearUid` is the hedgehog gear which is used to “talk”.
  1504 
  1504 
  1505 If you play a voice, by default the voice will respect an internal queue and might be played with an delay in order to prevent annoying voice overlapping. Since version 0.9.24, you can disable this behaviour and force Hedgewars to instantly play the voice by also setting `instaVoice` to `true`. Only use `instaVoice` when you really need it.
  1505 If you play a voice, by default the voice will respect an internal queue and might be played with an delay in order to prevent annoying voice overlapping. Since version 0.9.24, you can disable this behaviour and force Hedgewars to instantly play the voice by also setting `instaVoice` to `true`. Only use `instaVoice` when you really need it.
  1506 
  1506 
  1507 === `PlayMusicSound(soundId)` (0.9.25) ===
  1507 === <tt>!PlayMusicSound(soundId)</tt> (0.9.25) ===
  1508 Plays a sound as replacement for the background music. The sound is played once. The main music is paused and the sound is played instead. The main background music does not resume automatically, so you should call `StopMusicSound` after a while.
  1508 Plays a sound as replacement for the background music. The sound is played once. The main music is paused and the sound is played instead. The main background music does not resume automatically, so you should call `StopMusicSound` after a while.
  1509 
  1509 
  1510 Example:
  1510 Example:
  1511 <code language="lua">
  1511 <code language="lua">
  1512 PlayMusicSound(sndRideOfTheValkyries) -- Replace the background music the Ride of the Valkyries
  1512 PlayMusicSound(sndRideOfTheValkyries) -- Replace the background music the Ride of the Valkyries
  1513 </code>
  1513 </code>
  1514 
  1514 
  1515 === `StopMusicSound(soundId)` (0.9.25) ===
  1515 === <tt>!StopMusicSound(soundId)</tt> (0.9.25) ===
  1516 Stops the specified “music sound” (if it was still playing) and resumes the main background music.
  1516 Stops the specified “music sound” (if it was still playing) and resumes the main background music.
  1517 
  1517 
  1518 === `SetSoundMask(soundId, isMasked)` (0.9.24) ===
  1518 === <tt>!SetSoundMask(soundId, isMasked)</tt> (0.9.24) ===
  1519 Disables a given sound (including taunts) from being played by the engine. `soundId` is a valid sound ID on [Sounds] or [Taunts]. `isMasked` is a boolean. If `true`, the sound will not be played by the engine anymore. If `false`, playing this sound is allowed again.
  1519 Disables a given sound (including taunts) from being played by the engine. `soundId` is a valid sound ID on [Sounds] or [Taunts]. `isMasked` is a boolean. If `true`, the sound will not be played by the engine anymore. If `false`, playing this sound is allowed again.
  1520 
  1520 
  1521 Sounds played by the Lua function `PlaySound` will always work, however, and ignore the sound mask.
  1521 Sounds played by the Lua function `PlaySound` will always work, however, and ignore the sound mask.
  1522 
  1522 
  1523 Note: Due to the way the voices work internally in Hedgewars, if you want to play a masked voice, you have to set `instaVoice` to `true` when you call `PlaySound`. Otherwise, it won't work.
  1523 Note: Due to the way the voices work internally in Hedgewars, if you want to play a masked voice, you have to set `instaVoice` to `true` when you call `PlaySound`. Otherwise, it won't work.
  1661 === <tt>bnot(value)</tt> ===
  1661 === <tt>bnot(value)</tt> ===
  1662 Returns the bitwise logical NOT of `value`.
  1662 Returns the bitwise logical NOT of `value`.
  1663 
  1663 
  1664 
  1664 
  1665 == Debugging Functions ==
  1665 == Debugging Functions ==
  1666 === `WriteLnToConsole(string)` ===
  1666 === <tt>WriteLnToConsole(string)</tt> ===
  1667 Writes `string` to `Logs/game0.log`, found in the user data directory.
  1667 Writes `string` to `Logs/game0.log`, found in the user data directory.
  1668 
  1668 
  1669 === `WriteLnToChat(string)` (0.9.24) ===
  1669 === <tt>WriteLnToChat(string)</tt> (0.9.24) ===
  1670 Writes `string` into the chat.
  1670 Writes `string` into the chat.
  1671 
  1671 
  1672 === `DumpPoint(x, y)` (0.9.23) ===
  1672 === <tt>DumpPoint(x, y)</tt> (0.9.23) ===
  1673 Converts the whole numbers `x` and `y` to strings and writes them to `Logs/game0.log`, one line each.
  1673 Converts the whole numbers `x` and `y` to strings and writes them to `Logs/game0.log`, one line each.
  1674 
  1674 
  1675 === `StartGhostPoints(count)` ===
  1675 === <tt>StartGhostPoints(count)</tt> ===
  1676 Just prints out “GHOST_POINTS” and the argument on the console. This function might change in later versions.
  1676 Just prints out “GHOST_POINTS” and the argument on the console. This function might change in later versions.
  1677 
  1677 
  1678 === `DeclareAchievement(id, teamname, location, value)` ===
  1678 === <tt>DeclareAchievement(id, teamname, location, value)</tt> ===
  1679 Declares an achievement with the identifier `id` achieved by the team `teamname` on the map `location` with an achievement value (e.g. score) of `value`. `value` must be an integer. You are supposed to call this function inside an `onAchievementsDeclaration` callback.
  1679 Declares an achievement with the identifier `id` achieved by the team `teamname` on the map `location` with an achievement value (e.g. score) of `value`. `value` must be an integer. You are supposed to call this function inside an `onAchievementsDeclaration` callback.
  1680 
  1680 
  1681 Currently, this actually just triggers a console output, but it might be changed later. The idea is to track multiplayer records.
  1681 Currently, this actually just triggers a console output, but it might be changed later. The idea is to track multiplayer records.
  1682 
  1682 
  1683 Example:
  1683 Example: