LuaAPI.wiki
changeset 181 714a208397bd
parent 180 96e6b405bcf6
child 182 b64d2239cb8c
--- a/LuaAPI.wiki	Sat Dec 10 07:24:09 2011 +0000
+++ b/LuaAPI.wiki	Sat Dec 10 08:56:39 2011 +0000
@@ -32,7 +32,7 @@
 <blockquote>This function is called before the game loads its resources. One can modify various game variables here:
 </blockquote>
  * <tt>Seed = 0</tt> - sets the seed of the random number generator
- * <tt>!GameFlags = gfSolidLand + gfArtillery + …</tt> - sets the gameflags, see above for the available flags
+ * <tt>!GameFlags = gfSolidLand + gfArtillery + ...</tt> - sets the gameflags, see above for the available flags
  * <tt>!TurnTime = 60000</tt> - set the turntime in ms
  * <tt>!CaseFreq = 0</tt> - frequency of crate drops
  * <tt>!HealthCaseProb = 35</tt> - chance of receiving a health crate
@@ -66,7 +66,7 @@
 <blockquote>This function is called on every game tick, i.e. 1000 times a second.
 </blockquote>
 
-=== <tt>onNewTurn()</tt> (0.9.15) ===
+=== <tt>onNewTurn()</tt> ===
 
 <blockquote>This function calls at the start of every turn.
 </blockquote>
@@ -80,7 +80,7 @@
 <blockquote>This function is called when a new gear is deleted. Useful in
 combination with <tt>!GetGearType(gearUid)</tt>.
 </blockquote>
-=== <tt>onGearDamage(gearUid, damage)</tt> (0.9.15) ===
+=== <tt>onGearDamage(gearUid, damage)</tt> ===
 
 <blockquote>This function is called when a gear is damaged.
 </blockquote>
@@ -93,7 +93,7 @@
             !AddCaption(!GetHogName(gear) .. ' took ' .. damage .. ' points of damage')
         end
     end</code>
-=== <tt>onGearResurrect(gearUid) (0.9.14)</tt> ===
+=== <tt>onGearResurrect(gearUid) </tt> ===
 
 <blockquote>This function is called when a gear is resurrected. CPU Hogs will resurrect if gfAISurvival is included in !GameFlags. Alternatively, specific gears can have heResurrectable set to true via !SetEffect.
 </blockquote>
@@ -147,60 +147,60 @@
 <blockquote>This function is called when you press the down key.
 </blockquote>
 
-=== <tt>onAttackUp()</tt> (0.9.17) ===
+=== <tt>onAttackUp()</tt> ===
 
 <blockquote>This function is called when you release the attack key.</blockquote>
 
-=== <tt>onDownUp()</tt> (0.9.17) ===
+=== <tt>onDownUp()</tt> ===
 
 <blockquote>This function is called when you release the down key.</blockquote>
  
-=== <tt>onHogAttack()</tt> (0.9.17) ===
+=== <tt>onHogAttack()</tt> ===
 
 <blockquote>This function is called when you press the attack key.</blockquote>
 
-=== <tt>onLeftUp()</tt> (0.9.17) ===
+=== <tt>onLeftUp()</tt> ===
 
 <blockquote>This function is called when you release the left key.</blockquote>
 
-=== <tt>onPreciseUp()</tt> (0.9.17) ===
+=== <tt>onPreciseUp()</tt> ===
 
 <blockquote>This function is called when you release the precise key.</blockquote>
 
-=== <tt>onRightUp()</tt> (0.9.17) ===
+=== <tt>onRightUp()</tt> ===
 
 <blockquote>This function is called when you release the right key.</blockquote>
 
-=== <tt>onSetWeapon()</tt> (0.9.17) ===
+=== <tt>onSetWeapon()</tt> ===
 
 <blockquote>It is get called when a weapon is selected or switched.</blockquote>
 
-=== <tt>onSlot()</tt> (0.9.17) ===
+=== <tt>onSlot()</tt> ===
 
 <blockquote>This function is called when a weapon slot (row in the weapon menu) is selected.</blockquote>
 
-=== <tt>onSwitch()</tt> (0.9.17) ===
+=== <tt>onSwitch()</tt> ===
 
 <blockquote>This function is called when a hog is switched to another.</blockquote>
 
-=== <tt>onTaunt()</tt> (0.9.17) ===
+=== <tt>onTaunt()</tt> ===
 
 <blockquote>This function is called when the player uses an animated   emote for example "/wave, /juggle and etc.</blockquote>
 
-=== <tt>onTimer()</tt> (0.9.17) ===
+=== <tt>onTimer()</tt> ===
 
 <blockquote>This function is called when one of the timer keys is pressed.</blockquote>
 
-=== <tt>onUpUp()</tt> (0.9.17) ===
+=== <tt>onUpUp()</tt> ===
 
 <blockquote>This function is called when you release the up 
 key.</blockquote>
 
-=== <tt>onHogHide()</tt> (0.9.17) ===
+=== <tt>onHogHide()</tt> (0.9.16) ===
 
 <blockquote>This function is called when a hedgehog is hidden(removed from the map).</blockquote>
 
-=== <tt>onHogRestore()</tt> (0.9.17) ===
+=== <tt>onHogRestore()</tt> (0.9.16) ===
 
 <blockquote>This function is called when a hedgehog is restored (unhidden).<blockquote>
 
@@ -225,11 +225,11 @@
     vgear = !AddVisualGear(1000, 1000, vgtExplosion, 0, false) 
 </code>
 
-=== <tt>!SpawnHealthCrate(x, y)</tt> (0.9.14) ===
+=== <tt>!SpawnHealthCrate(x, y)</tt> ===
 
 <blockquote>Spawns a health crate at the specified position.
 </blockquote>
-=== <tt>!SpawnAmmoCrate(x, y, ammoType)</tt> (0.9.14) ===
+=== <tt>!SpawnAmmoCrate(x, y, ammoType)</tt> ===
 
 <blockquote>Spawns an ammo crate at the specified position with content of ammoType (see [AmmoTypes Ammo Types]). Because by default settings the number of ammo in crates is zero it has to be increased to at least one with SetAmmo first, see the example:
 </blockquote>
@@ -237,7 +237,7 @@
 
 <code lang="lua">    !SetAmmo(amGrenade, 0, 0, 0, 1) -- see below
     !SpawnAmmoCrate(0, 0, amGrenade) -- x=y=0 means random position on map</code>
-=== <tt>!SpawnUtilityCrate(x, y, ammoType)</tt> (0.9.14) ===
+=== <tt>!SpawnUtilityCrate(x, y, ammoType)</tt> ===
 
 <blockquote>Spawns an utility crate at specified position with content of ammoType.
 </blockquote>
@@ -274,15 +274,15 @@
 
 <blockquote>returns x,y coordinates for the specified gear
 </blockquote>
-=== <tt>!GetGearRadius(gearUid)</tt> (0.9.15) ===
+=== <tt>!GetGearRadius(gearUid)</tt> ===
 
 <blockquote>Returns radius for the specified gear
 </blockquote>
-=== <tt>!GetGearVelocity(gearUid)</tt> (0.9.15) ===
+=== <tt>!GetGearVelocity(gearUid)</tt> ===
 
 <blockquote>returns tuple of dx,dy values for the specified gear
 </blockquote>
-=== <tt>!GetGearElasticity(gearUid) (0.9.15)</tt> ===
+=== <tt>!GetGearElasticity(gearUid) </tt> ===
 
 <blockquote>Returns the elasticity of the specified gear. Useful for determining if a hog is on a rope or not. If a hog is attached to a rope, or is busy firing one, the elasticity of the rope will be non-zero.
 </blockquote>
@@ -334,20 +334,20 @@
 
 <blockquote>Returns the uid of the gear that is currently being followed.
 </blockquote>
-=== <tt>!GetTimer(gearUid)</tt> (0.9.14) ===
+=== <tt>!GetTimer(gearUid)</tt> ===
 
 <blockquote>returns the timer of the gear. This is for example the time it takes for watermelon, mine, etc. to explode. This is also the time used to specify the blowtorch or rcplane time.
 </blockquote>
-=== <tt>!GetHealth(gearUid)</tt> (0.9.14) ===
+=== <tt>!GetHealth(gearUid)</tt> ===
 
 <blockquote>returns the health of the gear
 </blockquote>
-=== <tt>!GetHogLevel(gearUid)</tt> (0.9.14) ===
+=== <tt>!GetHogLevel(gearUid)</tt> ===
 
 <blockquote>returns the bot level from 0 to 5. 0 means human player.
 </blockquote>
 
-=== <tt>!GetVisualGearValues(vgUid)</tt> (0.9.15) ===
+=== <tt>!GetVisualGearValues(vgUid)</tt> ===
 
 <blockquote>This returns the typically set visual gear values, useful if manipulating things like smoke or bubbles or circles.  It returns the following values:
 X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint 
@@ -366,19 +366,19 @@
 <blockquote>Deletes a Gear</blockquote>
 Example:
 
-<code lang="lua">    gear = !AddGear(…)
+<code lang="lua">    gear = !AddGear(...)
     !DeleteGear(gear) -- Delete the newly created gear.</code>
 
-=== <tt>!DeleteVisualGear(vgUid)</tt> (0.9.15) ===
+=== <tt>!DeleteVisualGear(vgUid)</tt> ===
 
 <blockquote>Deletes a Visual Gear.  Note, most visual gears delete themselves.</blockquote>
 Example:
 
-<code lang="lua">    vgear = !AddVisualGear(…)
+<code lang="lua">    vgear = !AddVisualGear(...)
     !DeleteVisualGear(vgear) -- Delete the newly created visual gear.</code>
 
 
-=== <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint)</tt> (0.9.15) ===
+=== <tt>!SetVisualGearValues(vgUid, X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint)</tt> ===
 
 <blockquote>This allows manipulation of many of the visual gear values.  Calling GetVisualGearValues first is recommended on most visual gears unless you are controlling all the key values.  In the case of vgtCircle, the visual gear values are mapped as follows.  X, Y: position.  State: radius. Timer: Thickness.  FrameTicks: pulsation speed (0 to disable).  dX, dY: min/max pulsation opacity (0-255). Tint: colour, RGBA.
 Most visual gears require little to no modification of parameters.
@@ -395,7 +395,7 @@
 </blockquote>
 Example:
 
-<code lang="lua">    gear = !AddGear(…)
+<code lang="lua">    gear = !AddGear(...)
     !FindPlace(gear, true, 0, LAND_WIDTH) -- places the gear randomly between 0 and LAND_WIDTH</code>
 === <tt>!HogSay(gearUid, text, manner)</tt> ===
 
@@ -419,7 +419,7 @@
 
 <blockquote>Places the specified gear exactly at the position (x,y).
 </blockquote>
-=== <tt>!SetGearVelocity(gearUid, dx, dy)</tt> (0.9.15) ===
+=== <tt>!SetGearVelocity(gearUid, dx, dy)</tt> ===
 
 <blockquote>Gives the specified gear the velocity of dx, dy.
 </blockquote>
@@ -476,7 +476,7 @@
             !SetEffect(gear, hePoisoned, true)
         end
     end</code>
-Notice: In 0.9.14 this function takes 0 or 1 instead of true/false.
+
 === <tt>CopyPV(gearUid, gearUid)</tt> ===
 
 <blockquote>This sets the position and velocity of the second gear to the first one.
@@ -517,12 +517,12 @@
 <blockquote>Sets the tag of the specified gear, different for every gear.
 </blockquote>
 
-=== <tt>!SetTimer(gearUid, timer)</tt> (0.9.14) ===
+=== <tt>!SetTimer(gearUid, timer)</tt> ===
 
 <blockquote>Sets the timer of the specified gear. Also see !GetTimer.
 </blockquote>
 
-=== <tt>!SetHogLevel(gearUid)</tt> (0.9.16) ===
+=== <tt>!SetHogLevel(gearUid)</tt> ===
 
 <blockquote>Sets the bot level from 0 to 5. 0 means human player.
 </blockquote>
@@ -557,7 +557,7 @@
 <blockquote>Hides the mission. This function is currently bugged somehow and will completely ruin your life, and your script should you happen to use it.
 </blockquote>
 
-=== <tt>!AddCaption(text)</tt> (0.9.14) ===
+=== <tt>!AddCaption(text)</tt> ===
 
 <blockquote>Display event text in the upper part of the screen.
 </blockquote>
@@ -577,12 +577,12 @@
 <blockquote>Plays the specified sound.
 </blockquote>
 
-=== <tt>!PlaySound(soundId, gearUid)</tt> (0.9.15) ===
+=== <tt>!PlaySound(soundId, gearUid)</tt> ===
 
 <blockquote>Plays the specified sound for the chosen hedgehog's team.
 </blockquote>
 
-=== <tt>!SetInputMask(mask)</tt> (0.9.15) ===
+=== <tt>!SetInputMask(mask)</tt> ===
 
 <blockquote>Masks specified player input.
 </blockquote>
@@ -594,41 +594,41 @@
 		</code>
 Note: Using the input mask is an effective way to script uninterrupted cinematics, or create modes such as No Jumping. 
 
-=== <tt>!SetZoom(zoomLevel)</tt> (0.9.14) ===
+=== <tt>!SetZoom(zoomLevel)</tt> ===
 
 <blockquote>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
 </blockquote>
 
-=== <tt>!GetZoom()</tt> (0.9.14) ===
+=== <tt>!GetZoom()</tt> ===
 
 <blockquote>Returns the current zoom level
 </blockquote>
 
-=== <tt>!GetRandom(number)</tt> (0.9.14) ===
+=== <tt>!GetRandom(number)</tt> ===
 
 <blockquote>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 can use the Lua random, but adding a regular gear should use GetRandom.
 </blockquote>
 
-=== <tt>!SetWind(windSpeed)</tt> (0.9.15) ===
+=== <tt>!SetWind(windSpeed)</tt> ===
 
 <blockquote>Sets the current wind in the range of -100 to 100. Use together with gfDisableWind for full control.
 </blockquote>
 
-=== <tt>!GetDataPath()</tt> (0.9.15) ===
+=== <tt>!GetDataPath()</tt> ===
 
 <blockquote>Returns the path to the data directory, used when adding libraries.
 </blockquote>
 
-=== <tt>!GetUserDataPath()</tt> (0.9.15) ===
+=== <tt>!GetUserDataPath()</tt> ===
 
 <blockquote>Returns the path to the user data directory, used when adding libraries.
 </blockquote>
 
-=== <tt>!GetClanColor(clan)</tt> (0.9.15) ===
+=== <tt>!GetClanColor(clan)</tt> ===
 
 <blockquote>Returns the colour of the chosen clan by its number.
 </blockquote>
-=== <tt>!SetClanColor(clan, color)</tt> (0.9.15) ===
+=== <tt>!SetClanColor(clan, color)</tt> ===
 
 <blockquote>Sets the colour of the chosen clan by its number.
 </blockquote>
@@ -654,13 +654,7 @@
 
 == Debugging Functions ==
 
-=== <tt>!WriteLnToConsole(string)</tt> (0.9.14) ===
+=== <tt>!WriteLnToConsole(string)</tt> ===
 
 <blockquote>Writes (string) to the chat place, as if you had pressed t and typed it.
-</blockquote>
-
-== Currently undocumented functions ==
-
-May only be available in -dev
-
-see http://hw.ercatec.net/docs/lua_wiki_check.php
\ No newline at end of file
+</blockquote>
\ No newline at end of file