1333 === Clans and teams === |
1333 === Clans and teams === |
1334 ==== <tt>!AddTeam(teamname, color, grave, fort, voicepack, flag)</tt> ==== |
1334 ==== <tt>!AddTeam(teamname, color, grave, fort, voicepack, flag)</tt> ==== |
1335 |
1335 |
1336 Adds a new team. Note that this can only be done in `onGameInit`, not at a later time. |
1336 Adds a new team. Note that this can only be done in `onGameInit`, not at a later time. |
1337 You *must* add at least one hedgehog with `AddHog` after calling this. The engine does not support empty teams. |
1337 You *must* add at least one hedgehog with `AddHog` after calling this. The engine does not support empty teams. |
|
1338 `AddTeam` is only supported for singleplayer missions. You *must not* use this function in multiplayer. |
1338 |
1339 |
1339 Arguments: |
1340 Arguments: |
1340 |
1341 |
1341 * `teamname`: The name of the team. |
1342 * `teamname`: The name of the team. |
1342 * `color`: Team color, usually a number from -9 to -1 (see below) |
1343 * `color`: Team color, usually a number from -9 to -1 (see below) |
1343 * `grave`: The name of the team’s grave (equals file name without the suffix) |
1344 * `grave`: The name of the team’s grave (equals file name without the suffix) |
1344 * `fort`: The name of the team’s fort (equals file name without the suffix and without the letter “L” or “R” before that suffix) |
1345 * `fort`: The name of the team’s fort (equals file name without the suffix and without the letter “L” or “R” before that suffix) |
1345 * `voicepack`: The name of the team’s voice pack (equals the directory name) |
1346 * `voicepack`: The name of the team’s voice pack (equals the directory name) |
1346 * `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. |
1347 * `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. |
1347 |
|
1348 *Note*: This works only for singleplayer training missions for now and will desync multiplayer games. |
|
1349 |
1348 |
1350 ===== Clan color ===== |
1349 ===== Clan color ===== |
1351 Each team must have a color. The color also determines clan membership: Teams with equal color are in the same clan. |
1350 Each team must have a color. The color also determines clan membership: Teams with equal color are in the same clan. |
1352 |
1351 |
1353 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: |
1352 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: |