LuaAPI.wiki
changeset 476 dd4470df66ad
parent 461 168508caf60d
child 477 8c326a00ead3
--- a/LuaAPI.wiki	Fri Dec 12 00:06:20 2014 +0000
+++ b/LuaAPI.wiki	Sat Dec 13 15:21:20 2014 +0000
@@ -6,7 +6,7 @@
 
 Version 0.9.13 of Hedgewars introduced the ability to use Lua scripts to modify Hedgewars behaviour for different maps without having to recompile the whole game. The till then used triggers (only appeared in training maps) were removed.
 
-Lua is an easy to learn scripting language that's implemented using open source libraries. If you'd like to learn more about Lua, have a look at [http://www.lua.org Lua's official homepage]. Even though its easy to learn syntax this wiki page won't explain all basics of using Lua, e.g. declaring variables or using control structures. There are tons of step-by-step tutorials and documentation available on the internet. Just throw "Lua" into your favourite search engine and give it a try.
+Lua is an easy to learn scripting language that's implemented using open/v source libraries. If you'd like to learn more about Lua, have a look at [http://www.lua.org Lua's official homepage]. Even though its easy to learn syntax this wiki page won't explain all basics of using Lua, e.g. declaring variables or using control structures. There are tons of step-by-step tutorials and documentation available on the internet. Just throw "Lua" into your favourite search engine and give it a try.
 
 
 How Hedgewars handles Lua scripts As of Version 0.9.13 Hedgewars supports Lua scripts for two similar tasks: Define tutorial missions or provide special map behaviour for precreated maps.
@@ -881,13 +881,25 @@
 === Clans and teams ===
 ==== <tt>!AddTeam(teamname, color, grave, fort, voicepack, flag)</tt> ====
 
-<blockquote>Adds a new team. Note that this can only be done in `onGameInit`, not at a later time. First argument is the team name followed by color, grave, fort, voicepack and flag settings.
-</blockquote>
-Notice: This works only for singleplayer's training missions for now and will desync multiplayer games. Flag setting is dev only.
+Adds a new team. Note that this can only be done in `onGameInit`, not at a later time.
+You *must* add at least one hedgehog with `AddHog` after calling this. The engine does not support empty teams.
+
+Arguments:
+
+ * `teamname`: The name of the team.
+ * `color`: The color of the team, provided as a 3-byte number
+ * `grave`: The name of the team’s grave (equals file name without the suffix)
+ * `fort`: The name of the team’s fort
+ * `voicepack`: The name of the team’s voice pack (equals the directory name)
+ * `flag`: Optional argument (only in development version at the moment) for the name of the team’s flag (equals file name without the suffix)
+
+Note: This works only for singleplayer's training missions for now and will desync multiplayer games.
 
 Example:
 
-<code language="lua">    AddTeam("team 1", 0xDD0000, "Simple", "Island", "Default", "hedgewars")</code>
+<code language="lua">AddTeam("team 1", 0xDD0000, "Simple", "Tank", "Default", "hedgewars")
+--[[ Adds a new team with name “team 1”, red color (hexadecimal notation), the grave “Simple”,
+the fort “Tank” the voicepack “Default” and the flag “hedgewars”. ]]</code>
 
 ==== <tt>!DismissTeam(teamname)</tt> ====
 Removes the team with the given team name from the game.