Difference between revisions of "Lua:SetTeamAllies"

From Fortress Forever Wiki
Jump to navigationJump to search
Line 3: Line 3:
 
The function only works within a .lua files startup() section
 
The function only works within a .lua files startup() section
  
==Example==
+
==.LUA startup() function==
 
<pre>
 
<pre>
 
function startup()
 
function startup()
Line 14: Line 14:
  
 
So,  
 
So,  
==EXAMPLE==
+
==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.
 
tells BLUE TEAM to have an ally of YELLOW TEAM.
  
 
Similarly,
 
Similarly,
==EXAMPLE==
+
==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.
 
tells YELLOW TEAM to have an ally of BLUE TEAM.
  
 
Listing of teams as their 'bitfield' value:
 
Listing of teams as their 'bitfield' value:
==EXAMPLE==
+
==Team 'bitfield' values==
 
<pre>
 
<pre>
 
blue team: 4
 
blue team: 4

Revision as of 15:52, 28 May 2006

SetTeamAllies is used to ally one team to another.

The function only works within a .lua files startup() section

.LUA startup() function

function 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.

So,

Setting blue team to have an ally of yellow team

SetTeamAllies( BLUE_TEAM, 16 );

tells BLUE TEAM to have an ally of YELLOW TEAM.

Similarly,

Setting yellow team to have an ally of blue team

SetTeamAllies( YELLOW_TEAM, 4 );

tells YELLOW TEAM to have an ally of BLUE TEAM.

Listing of teams as their 'bitfield' value:

Team 'bitfield' values

blue team: 4
red team: 8
yellow team: 16
green team: 32