LuaGameplay.wiki
changeset 1757 2c7eba50e7b0
parent 1754 33355f5010ce
child 1776 16cb66ab3488
--- a/LuaGameplay.wiki	Wed Apr 17 12:54:45 2019 +0100
+++ b/LuaGameplay.wiki	Wed Apr 17 12:57:07 2019 +0100
@@ -3,30 +3,32 @@
 = Lua API: Gameplay functions =
 This page is a list of all gameplay-related functions in the [LuaAPI Lua API].
 
-=== `GameFlags` functions ===
+<wiki:toc max_depth="3" />
 
-==== <tt>!ClearGameFlags()</tt> ====
+== `GameFlags` functions ==
+
+=== <tt>!ClearGameFlags()</tt> ===
 Disables *all* !GameFlags.
 
-==== <tt>!DisableGameFlags(gameflag, ...)</tt> ====
+=== <tt>!DisableGameFlags(gameflag, ...)</tt> ===
 Disables the listed !GameFlags, without changing the status of other !GameFlags.
 
-==== <tt>!EnableGameFlags(gameflag, ...)</tt> ====
+=== <tt>!EnableGameFlags(gameflag, ...)</tt> ===
 Enables the listed !GameFlags, without changing the status of other !GameFlags. In missions, no !GameFlags are set initially.
 
-==== <tt>!GetGameFlag(gameflag)</tt> ====
+=== <tt>!GetGameFlag(gameflag)</tt> ===
 Returns `true` if the specified gameflag is enabled, otherwise `false`.
 
-=== Turns ===
-==== <tt>SkipTurn()</tt> (0.9.24) ====
+== Turns ==
+=== <tt>SkipTurn()</tt> (0.9.24) ===
 Forces the current hedgehog to skip its turn.
 
-==== <tt>EndTurn([noTaunts])</tt> (0.9.23) ====
+=== <tt>EndTurn([noTaunts])</tt> (0.9.23) ===
 Ends the current turn immediately.
 
 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.
 
-==== <tt>Retreat(time [, respectGetAwayTimeFactor)</tt> (0.9.25) ====
+=== <tt>Retreat(time [, respectGetAwayTimeFactor)</tt> (0.9.25) ===
 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.
 
 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`.
@@ -35,42 +37,42 @@
 
 Note: If you want the turn to end instantly, it is recommended to use `EndTurn` instead.
 
-==== <tt>!SetTurnTimeLeft(newTurnTimeLeft)</tt> (0.9.25) ====
+=== <tt>!SetTurnTimeLeft(newTurnTimeLeft)</tt> (0.9.25) ===
 Set the remaining turn time in milliseconds. The current remaining turn time can be read from the variable `TurnTimeLeft`.
 
-==== <tt>!SetReadyTimeLeft(newReadyTimeLeft)</tt> (0.9.25) ====
+=== <tt>!SetReadyTimeLeft(newReadyTimeLeft)</tt> (0.9.25) ===
 Set the remaining ready time in milliseconds. This function should only be called in onNewTurn. The current remaining ready time can be read from the variable `ReadyTimeLeft`.
 
-==== <tt>!SetTurnTimePaused(isPaused)</tt> (0.9.25) ====
+=== <tt>!SetTurnTimePaused(isPaused)</tt> (0.9.25) ===
 Pauses the turn time indefinitely if `isPaused` is set to `true`, disabled the turn time pause if `isPaused` is set to `false`.
 
-==== <tt>!GetTurnTimePaused()</tt> (0.9.25) ====
+=== <tt>!GetTurnTimePaused()</tt> (0.9.25) ===
 Returns `true` if the turn time is currently paused by `SetTurnTimePaused`, otherwise returns `false`.
 
-==== <tt>!EndGame()</tt> ====
+=== <tt>!EndGame()</tt> ===
 Makes the game end.
 
-=== Environment ===
-==== <tt>!SetGravity(percent)</tt> ====
+== Environment ==
+=== <tt>!SetGravity(percent)</tt> ===
 Changes the current gravity of the game in percent (relative to default, integer value).
 Setting it to 100 will set gravity to default gravity of Hedgewars, 200 will double it, etc.
 
-==== <tt>!GetGravity()</tt> ====
+=== <tt>!GetGravity()</tt> ===
 Returns the current gravity in percent.
 
-==== <tt>!SetWaterLine(waterline)</tt> ====
+=== <tt>!SetWaterLine(waterline)</tt> ===
 Sets the water level (`WaterLine`) to the specified y-coordinate.
 
-==== <tt>!SetWind(windSpeed)</tt> ====
+=== <tt>!SetWind(windSpeed)</tt> ===
 Sets the current wind in the range of -100 to 100 inclusive. Use together with `gfDisableWind` for full control.
 
-==== <tt>!GetWind()</tt> (0.9.24) ====
+=== <tt>!GetWind()</tt> (0.9.24) ===
 Returns current wind, expressed as a floating point number between -100 to 100 inclusive. Note there may be rounding errors.
 
-==== <tt>!SetMaxBuildDistance(distInPx)</tt> ====
+=== <tt>!SetMaxBuildDistance(distInPx)</tt> ===
 Sets the maximum building distance for of girders and rubber bands in pixels to `distInPx`. If `distInPx` is `0`, the limit is disabled. If called without arguments, the distance will be reset to the default value.
 
-==== <tt>Explode(x, y, radius[, options])</tt> (0.9.24) ====
+=== <tt>Explode(x, y, radius[, options])</tt> (0.9.24) ===
 Cause an explosion or erase land, push or damage gears.
 
 By default, an explosion destroys a circular piece of land and damages and pushes gears in its radius.
@@ -108,8 +110,8 @@
 Explode(500, 100, 100, EXPLNoDamage + EXPLDoNotTouchAny + EXPLNoGfx)
 </code>
 
-=== Ammo ===
-==== <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> ====
+== Ammo ==
+=== <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> ===
 This updates the settings (initial ammo, crate probability, etc.) for a specified [AmmoTypes ammo type]. This must only be used in the `onAmmoStoreInit()` event handler. In other places, this function will not work.
 
 In Lua missions, for *all* ammo types, the ammo count, probability, delay and number in crates is set to 0 initially. Note: This also includes skip!
@@ -130,7 +132,7 @@
 
 Hint: It is recommended to always enable skip in missions. Only in exceptional circumstances you should choose to not enable skip.
 
-==== <tt>!GetAmmo(ammoType)</tt> ====
+=== <tt>!GetAmmo(ammoType)</tt> ===
 Returns ammo settings (initial ammo, crate probability, etc.) for a specified [AmmoTypes ammo type]. This function is analogue to `SetAmmo`.
 
 This function returns four numbers, in this order: initial ammo count, probability, delay and number in crate. These values correspond to the parameters 2-5 provided in `SetAmmo` and have the same meaning.
@@ -139,10 +141,10 @@
 
 <code language="lua">count, prob, delay, numberInCrate = GetAmmo(amGrenade) -- Get ammo settings of amGrenade</code>
 
-==== <tt>!SetAmmoDelay(ammoType, delay)</tt> ====
+=== <tt>!SetAmmoDelay(ammoType, delay)</tt> ===
 Changes the delay of a specified [AmmoTypes Ammo Type].
 
-==== <tt>!SetAmmoTexts(ammoType, name, caption, description [, showExtra])</tt> (0.9.23) ====
+=== <tt>!SetAmmoTexts(ammoType, name, caption, description [, showExtra])</tt> (0.9.23) ===
 Allows you to overwrite the displayed name and tooltip descriptions of a given ammo type. This function must only be called either inside the `onGameStart` callback function, or after the engine has called `onGameStart`.
 
  * `ammoType`: The ammo type to set the text for
@@ -158,7 +160,7 @@
 -- Overwrites bazooka name and description
 SetAmmoTexts(amBazooka, "Spoon Missile", "Crazy weapon", "This crazy weapon looks like a spoon and explodes on impact.|Attack: Hold to launch with more power")</code>
 
-==== <tt>!SetAmmoDescriptionAppendix(ammoType, descAppend)</tt> (0.9.23) ====
+=== <tt>!SetAmmoDescriptionAppendix(ammoType, descAppend)</tt> (0.9.23) ===
 Will set a string `descAppend` to be appended below the “core” description (ammo tooltip) of the specified `ammoType`, without changing the ordinary description.
 Note that calling this function always sets the complete appended string, you can't use this function to append multiple texts in row.
 
@@ -169,22 +171,22 @@
 -- Appends a text to the ammo tooltip of the bazooka but leaves name and main description intact
 SetAmmoTexts(amBazooka, "This weapon deals double the damage than usually.")</code>
 
-==== <tt>!AddAmmo(gearUid, ammoType, ammoCount)</tt> ====
+=== <tt>!AddAmmo(gearUid, ammoType, ammoCount)</tt> ===
 Adds `ammoType` to the specified gear. The amount added is determined by the arguments passed via `SetAmmo()` in the `onAmmoStoreInit()` event handler. `ammoCount` is an optional parameter. If this is set, the ammo will *not* be added, but instead set to `ammoCount`. A value of `0` will remove the weapon, a value of `AMMO_INFINITE` will give infinite ammo.
 
 Note: By default, ammo is per-team, so calling `AddAmmo` for a hedgehog will give the ammo for the whole team. The game flags `gfPerHogAmmo` and `gfSharedAmmo` change how ammo is managed in the game, so these game flags also affect `AddAmmo`.
 
-==== <tt>!GetAmmoName(ammoType [, ignoreOverwrite ])</tt> (0.9.23) ====
+=== <tt>!GetAmmoName(ammoType [, ignoreOverwrite ])</tt> (0.9.23) ===
 Returns the localized name for the specified `ammoType`, taking an ammo name overwritten by `SetAmmoTexts` into account. If `ignoreOverwrite` is `true`, this function will always return the original ammo name of the weapon and ignores names which may have been overwritten by `SetAmmoTexts`.
 
-=== Map ===
-==== <tt>!MapHasBorder()</tt> ====
+== Map ==
+=== <tt>!MapHasBorder()</tt> ===
 Returns `true`/`false` if the map has a border or not.
 
-==== <tt>!TestRectForObstacle(x1, y1, x2, y2, landOnly)</tt> ====
+=== <tt>!TestRectForObstacle(x1, y1, x2, y2, landOnly)</tt> ===
 Checks the rectangle between the given coordinates for possible collisions. Set `landOnly` to `true` if you don’t want to check for collisions with gears (hedgehogs, etc.).
 
-==== <tt>!PlaceGirder(x, y, frameIdx)</tt> ====
+=== <tt>!PlaceGirder(x, y, frameIdx)</tt> ===
 Attempts to place a girder with centre points `x`, `y` and a certain length and orientation, specified by `frameIdx`. The girder can only be placed in open space and must not collide with anything so this function may fail. It will return `true` on successful placement and `false` on failure.
 
 These are the accepted values for `frameIdx`:
@@ -199,7 +201,7 @@
 || 6 || long || vertical ||
 || 7 || long || increasing right ||
 
-==== <tt>!PlaceRubber(x, y, frameIdx)</tt> (0.9.23) ====
+=== <tt>!PlaceRubber(x, y, frameIdx)</tt> (0.9.23) ===
 Attempts to place a rubber with centre points `x`, `y` and a certain orientation, specified by `frameIdx`. The rubber can only be placed in open space and must not collide with anything so this function may fail. It will return `true` on successful placement and `false` on failure.
 
 These are the accepted values for `frameIdx`:
@@ -210,7 +212,7 @@
 || 2 || vertical ||
 || 3 || increasing right ||
 
-==== <tt>!PlaceSprite(x, y, sprite, frameIdx, tint, behind, flipHoriz, flipVert, [, landFlag, ...])</tt> ====
+=== <tt>!PlaceSprite(x, y, sprite, frameIdx, tint, behind, flipHoriz, flipVert, [, landFlag, ...])</tt> ===
 Places a [Sprites sprite] at the specified position (`x`, `y`) on the map, it behaves like terrain then. Unlike `PlaceGirder`, this function does not check for collisions, so the sprite can be placed anywhere within map boundaries. The function returns `true` if the placement was successful, `false` otherwise. `frameIdx` is the frame index starting by 0. `frameIdx` is used if the sprite consists of several sub-images. Only a subset of the sprites is currently supported by this function:
 
  * `sprAmGirder`
@@ -251,7 +253,7 @@
 <code language="lua">PlaceSprite(1411, 625, sprAmRubber, 1, nil, nil, nil, nil, lfBouncy)
 -- Places the rubber band sprite as bouncy terrain at (2836, 634). The `frameIdx` 1 is for the decreasing right rubber band.</code>
 
-==== <tt>!EraseSprite(x, y, sprite, frameIdx, eraseOnLFMatch, onlyEraseLF, flipHoriz, flipVert, [, landFlag, ...])</tt> ====
+=== <tt>!EraseSprite(x, y, sprite, frameIdx, eraseOnLFMatch, onlyEraseLF, flipHoriz, flipVert, [, landFlag, ...])</tt> ===
 Erases a [Sprites sprite] at the specified position (`x`, `y`) on the map. `frameIdx` is the frame index starting by 0. `sprite`, `frameIdx`, `flipHoriz` and `flipVert` behave the same as in `PlaceSprite`. For `sprite`, the same subset of sprites is permitted.
 
 Set `eraseOnLFMatch` to `true` to erase all land for a pixel that matches any of the passed in land flags.  This is useful if, for example, an `lfBouncy` sprite was placed “behind” land using `PlaceSprite` and you want to remove it without destroying the non-bouncy terrain.
@@ -265,7 +267,7 @@
 <code language="lua">EraseSprite(1411, 625, sprAmRubber, 1, true, true, nil, nil, lfIndestructible)
 -- Removes indestructibility from a rubber band sprite at (2836, 634). The frameIdx 1 is for the decreasing right rubber band.</code>
 
-==== <tt>!AddPoint(x, y [, width [, erase] ])</tt> ====
+=== <tt>!AddPoint(x, y [, width [, erase] ])</tt> ===
 This function is used to draw your own maps using Lua. The maps drawn with this are of type “hand-drawn”.
 
 The function takes a `x`,`y` location, a `width` (means start of a new line) and `erase` (if `false`, this function will draw normally, if `true`, this function will erase drawn stuff).
@@ -274,18 +276,18 @@
 
 See [LuaDrawning] for some examples.
 
-==== <tt>!FlushPoints()</tt> ====
+=== <tt>!FlushPoints()</tt> ===
 Makes sure that all the points/lines specified using `AddPoint` are actually applied to the map. This function must be called within `onGameInit`.
 
-=== Current hedgehog ===
+== Current hedgehog ==
 
-==== <tt>!GetCurAmmoType()</tt> ====
+=== <tt>!GetCurAmmoType()</tt> ===
 Returns the currently selected [AmmoTypes Ammo Type].
 
-==== <tt>!SwitchHog(gearUid)</tt> ====
+=== <tt>!SwitchHog(gearUid)</tt> ===
 This function will switch to the hedgehog with the specifiedd `gearUid`.
 
-==== <tt>!SetWeapon(ammoType)</tt> ====
+=== <tt>!SetWeapon(ammoType)</tt> ===
 Sets the selected weapon of `CurrentHedgehog` to one of the [AmmoTypes Ammo Type].
 
 Examples:
@@ -297,10 +299,10 @@
   SetWeapon(amNothing) -- unselects the weapon.
 </code>
 
-==== <tt>!SetNextWeapon()</tt> ====
+=== <tt>!SetNextWeapon()</tt> ===
 This function makes the current hedgehog switch to the next weapon in list of available weapons. It can be used for example in trainings to pre-select a weapon.
 
-==== <tt>!SetInputMask(mask)</tt> ====
+=== <tt>!SetInputMask(mask)</tt> ===
 Masks specified player input. This means that Hedgewars ignores certain player inputs, such as walking or jumping.
 
 Example: 
@@ -315,34 +317,34 @@
 
 See also [GearMessages].
 
-==== <tt>!GetInputMask()</tt> ====
+=== <tt>!GetInputMask()</tt> ===
 Returns the current input mask of the player.
 
-==== <tt>!SetVampiric(bool)</tt> (0.9.24) ====
+=== <tt>!SetVampiric(bool)</tt> (0.9.24) ===
 Toggles vampirism mode for this turn. Set `bool` to `true` to enable (same effect as if the hedgehog has used Vampirism), `false` to disable.
 
-==== <tt>!GetVampiric()</tt> (0.9.25) ====
+=== <tt>!GetVampiric()</tt> (0.9.25) ===
 Returns true if vampirism mode is currently active.
 
-==== <tt>!SetLaserSight(bool)</tt> (0.9.24) ====
+=== <tt>!SetLaserSight(bool)</tt> (0.9.24) ===
 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.
 
-==== <tt>!GetLaserSight()</tt> (0.9.25) ====
+=== <tt>!GetLaserSight()</tt> (0.9.25) ===
 Returns true if laser sight (as utility) is currently active. The sniper rifle's built-in laser sight does not count.
 
-==== <tt>!EnableSwitchHog()</tt> (0.9.25) ====
+=== <tt>!EnableSwitchHog()</tt> (0.9.25) ===
 Enable hog switching mode for the current hedgehog. This function should be called while the hedgehog is standing on solid ground (`GetFlightTime` returns 0).
 
 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.
 
 On success, returns the `gtSwitcher` gear being spawned or, if hog switching mode is already active, returns the exsting gear. On failure, returns `nil`.
 
-=== Randomness ===
-==== <tt>!GetRandom(number)</tt> ====
+== Randomness ==
+=== <tt>!GetRandom(number)</tt> ===
 Returns a randomly generated number in the range of 0 to number - 1. This random number uses the game seed, so is synchronised, and thus safe for multiplayer and saved games. Use `GetRandom` for anything that could impact the engine state. For example, a visual gear could simply use Lua’s `math.random`, but adding a regular gear should use `GetRandom`.
 
-=== Clans and teams ===
-==== <tt>!AddTeam(teamname, color, grave, fort, voicepack, flag)</tt> ====
+== Clans and teams ==
+=== <tt>!AddTeam(teamname, color, grave, fort, voicepack, flag)</tt> ===
 
 Adds a new team.
 
@@ -359,7 +361,7 @@
  * `voicepack`: The name of the team’s voice pack (equals the directory name)
  * `flag`: Optional argument for the name of the team’s flag (equals file name without the suffix). If set to `nil`, the flag “hedgewars” is used.
 
-===== Clan color =====
+=== Clan color ===
 Each team must have a color. The color also determines clan membership: Teams with equal color are in the same clan.
 
 The team color is specified as a number from -9 to -1. This will select one of the 9 possible team colors as specified in the player's settings. As the actual colors are set by the player, you can't predict them, but you can usually trust these defaults:
@@ -376,13 +378,13 @@
 
 An older (and now discouraged) method of specifying the color is by hardcoding it as an RGB color (i.e. `0xDD0000`). This practice is now strongly discouraged because it will ignore the player-chosen color (which is *bad* for players with color blindness) and in 99% of cases you don't need it anyway. It should be only used for testing and debugging. 
 
-===== Example =====
+=== Example ===
 
 <code language="lua">AddTeam("team 1", -1, "Simple", "Tank", "Default", "hedgewars")
 --[[ Adds a new team with name “team 1”, the first default color (usually red), the grave “Simple”,
 the fort “Tank” the voicepack “Default” and the flag “hedgewars”. ]]</code>
 
-==== <tt>!AddMissionTeam(color)</tt> (0.9.25) ====
+=== <tt>!AddMissionTeam(color)</tt> (0.9.25) ===
 Adds a new team using the player-chosen team identity when playing a singleplayer mission. Does not work in multiplayer.
 
 This function is very similar to `AddTeam`. Team settings like team name and flag will be taken from the player-chosen team.
@@ -394,21 +396,21 @@
 <code language="lua">-- Add mission team with default clan color
 AddMissionTeam(-1)</code>
 
-==== <tt>!GetTeamName(teamIdx)</tt> (0.9.24) ====
+=== <tt>!GetTeamName(teamIdx)</tt> (0.9.24) ===
 Returns the name of the team with the index `teamIdx`. `teamIdx` is a number between 0 and `TeamsCount-1`.
 
-==== <tt>!GetTeamIndex(teamname)</tt> (0.9.24) ====
+=== <tt>!GetTeamIndex(teamname)</tt> (0.9.24) ===
 Returns the team index (number between 0 and `TeamsCount-1`) of the team with the name `teamName`.
 
-==== <tt>!GetTeamClan(teamname)</tt> (0.9.24) ====
+=== <tt>!GetTeamClan(teamname)</tt> (0.9.24) ===
 Returns the clan ID of the team with the given `teamName`.
 
-==== <tt>!DismissTeam(teamname)</tt> ====
+=== <tt>!DismissTeam(teamname)</tt> ===
 Vaporizes all the hogs of the team with the given team name in a puff of smoke.
 
 This function must not be called while it's the team's turn.
 
-==== <tt>!SetTeamLabel(teamname[, label])</tt> (0.9.24) ====
+=== <tt>!SetTeamLabel(teamname[, label])</tt> (0.9.24) ===
 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.
 
 If `label` is `nil`, the label will be removed.
@@ -417,29 +419,29 @@
 
 Use this to display a score, power value or another important team attribute. There's no hard length limit, but please try to keep it as short as possible to avoid visual clutter.
 
-=== <tt>SetTeamPassive(teamname, isPassive)</tt> (1.0.0) ===
+== <tt>SetTeamPassive(teamname, isPassive)</tt> (1.0.0) ==
 Mark a team as passive if `isPassive` is `true`. Passive teams do not participate in the game and are treated like frozen teams. When determining the team order, passive teams are completely ignored.
 
-==== <tt>!GetClanColor(clan)</tt> ====
+=== <tt>!GetClanColor(clan)</tt> ===
 Returns the RGBA color of the chosen clan by its number. The color data type is described in [LuaOverview#Color].
 
-==== <tt>!SetClanColor(clan, color)</tt> ====
+=== <tt>!SetClanColor(clan, color)</tt> ===
 Sets the RGBA color of the chosen clan by its number. The color data type is described in [LuaOverview#Color]. The new clan color *must* be different from the color of all clans (you can't use this function to change clan memberships of teams).
 
 Note: The stats graph does not support changing clan colors. If the clan colors change in mid-game, the graph might get confused and shows weird stuff. You may want to turn off the graph with if this is the case (see `SendHealthStatsOff`).
 
-=== Campaign management ===
-==== <tt>!SaveCampaignVar(varname, value)</tt> ====
+== Campaign management ==
+=== <tt>!SaveCampaignVar(varname, value)</tt> ===
 Stores the value `value` (a string) into the campaign variable `varname` (also a string). Campaign variables allow you to save progress of a team in a certain campaign. Campaign variables are saved on a per-team per-campaign basis. They are written into the team file (see [ConfigurationFiles#TeamName.hwt]).
 
 There are some special campaign variables which are used by Hedgewars to determine which missions to display in the campaign menu. This is described [ConfigurationFiles#%5BCampaign%20%3CCAMPAIGN_NAME%3E%5D here].
 
-==== <tt>!GetCampaignVar(varname)</tt> ====
+=== <tt>!GetCampaignVar(varname)</tt> ===
 Returns the value of the campaign variable `varname` as a string. See also `SaveCampaignVar`.
 
-==== <tt>!SaveMissionVar(varname, value)</tt> (0.9.25) ====
+=== <tt>!SaveMissionVar(varname, value)</tt> (0.9.25) ===
 Stores the value `value` (a string) into the mission variable `varname` (also a string). A mission variable is like a campaign variable, but it applies for singleplayer missions only (Training/Challenge/Scenario), excluding campaign missions.
 
-==== <tt>!GetMissionVar(varname)</tt> (0.9.25) ====
+=== <tt>!GetMissionVar(varname)</tt> (0.9.25) ===
 Returns the value of the mission variable `varname` as a string. See also `SaveMissionVar`.