Difference between revisions of "Lua:SetTeamAllies"
From Fortress Forever Wiki
Jump to navigationJump to searchMulchman MM (talk | contribs) |
|||
(10 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Infobox manual/Header}} | ||
+ | ==SetTeamAllies== | ||
+ | |||
SetTeamAllies is used to ally one team to another. | SetTeamAllies is used to ally one team to another. | ||
− | The function only works within a .lua files startup() section | + | The SetTeamAllies function only works within a .lua files startup() section. This startup() function |
+ | can be added to any .lua file but there should be only one within a .lua file. | ||
− | ==.LUA startup() function== | + | ===Example .LUA startup() function=== |
<pre> | <pre> | ||
function startup() | function startup() | ||
Line 13: | Line 17: | ||
Now, the first parameter in SetTeamAllies is the team that's going to be given an ally. The second command is (for now) a bit field of the team who is going to be the ally. | Now, the first parameter in SetTeamAllies is the team that's going to be given an ally. The second command is (for now) a bit field of the team who is going to be the ally. | ||
− | + | ===Setting blue team to have an ally of yellow team=== | |
− | ==Setting blue team to have an ally of yellow team== | ||
<pre>SetTeamAllies( BLUE_TEAM, 16 );</pre> | <pre>SetTeamAllies( BLUE_TEAM, 16 );</pre> | ||
− | tells BLUE TEAM to have an ally of YELLOW TEAM. | + | This tells BLUE TEAM to have an ally of YELLOW TEAM. |
− | + | ===Setting yellow team to have an ally of blue team=== | |
− | ==Setting yellow team to have an ally of blue team== | ||
<pre>SetTeamAllies( YELLOW_TEAM, 4 );</pre> | <pre>SetTeamAllies( YELLOW_TEAM, 4 );</pre> | ||
− | tells YELLOW TEAM to have an ally of BLUE TEAM. | + | Similarly, this tells YELLOW TEAM to have an ally of BLUE TEAM. |
Listing of teams as their 'bitfield' value: | Listing of teams as their 'bitfield' value: | ||
− | ==Team 'bitfield' values== | + | ===Team 'bitfield' values=== |
<pre> | <pre> | ||
− | blue team: 4 | + | blue team: 4 |
− | red team: 8 | + | red team: 8 |
yellow team: 16 | yellow team: 16 | ||
− | green team: 32 | + | green team: 32 |
</pre> | </pre> | ||
− | [[Category: | + | [[Category:Lua_Commands]] |
+ | {{Infobox manual/Footer}} |
Latest revision as of 17:38, 31 December 2007
SetTeamAlliesSetTeamAllies is used to ally one team to another. The SetTeamAllies function only works within a .lua files startup() section. This startup() function can be added to any .lua file but there should be only one within a .lua file. Example .LUA startup() functionfunction startup() SetTeamAllies( BLUE_TEAM, 16 ); SetTeamAllies( YELLOW_TEAM, 4 ); end Now, the first parameter in SetTeamAllies is the team that's going to be given an ally. The second command is (for now) a bit field of the team who is going to be the ally. Setting blue team to have an ally of yellow teamSetTeamAllies( BLUE_TEAM, 16 ); This tells BLUE TEAM to have an ally of YELLOW TEAM. Setting yellow team to have an ally of blue teamSetTeamAllies( YELLOW_TEAM, 4 ); Similarly, this tells YELLOW TEAM to have an ally of BLUE TEAM. Listing of teams as their 'bitfield' value: Team 'bitfield' valuesblue team: 4 red team: 8 yellow team: 16 green team: 32 |