Fortress Team Colours and names.

Post here if you need help setting up your server, etc.
Post Reply
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Fortress Team Colours and names.

Post by ed »

I've set up a fortress server 2.8rc3 unix dedicated and would like to change team colors.
Not that I have anything against Yellow and Blue, I just like other colours better. Like Red or Green.
I've tried out ALLOW_TEAM_NAME_PLAYER 1 which takes the color of the team leader, this sometimes causes confusion if the colours of the leaders are similar or unusual.

I'd also like to give teams interesting names instead of Team Blue or Team Gold. All I can find is ALLOW_TEAM_NAME_PLAYER 1 which will name the team after the leader.
Can't I have the Purple Pansies versus The Red Spoons?
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

If you compiled it yourself, or if you don't mind doing that, take a look at the start of armagetronad/src/engine/eTeam.cpp:

Code: Select all

#define TEAMCOLORS 8

static unsigned short se_team_rgb[TEAMCOLORS][3]=
    { {  4,  8, 15 } , // blue
      { 15, 15,  4 } , // gold
      { 15,  4,  4 } , // red
      {  4, 15,  4 } , // green
      { 15,  4, 15 } , // violet
      {  4, 15, 15 } , // ugly green
      { 15, 15, 15 } , // white
      {  7,  7,  7 }   // black
    };

static char* se_team_name[TEAMCOLORS]=
    {
        "$team_name_blue",
        "$team_name_gold",
        "$team_name_red",
        "$team_name_green",
        "$team_name_violet",
        "$team_name_ugly",
        "$team_name_white",
        "$team_name_black"
    };
#define TEAMCOLORS 8 is the number of colors. The triplets in se_team_rgb are 0-15 RGB colors like your player color. The strings in se_team_name are the team names, in the same order as the aforementioned colors. The $ in front means that the string is taken from the language file, e.g. from armagetronad/language/english_base.txt:

Code: Select all

team_name_blue			Team blue
team_name_gold			Team gold
team_name_red			Team red
team_name_green			Team green
team_name_violet		Team violet
team_name_ugly			Team ugly
team_name_white			Team white
team_name_black			Team black
So how would you replace Team blue by, say, Team orange? Replace the RGB triplet of blue:

Code: Select all

    { {  4,  8, 15 } , // blue
with

Code: Select all

    { {  15,  8, 0 } , // orange
As you can see I changed the numbers and the comment on the right side of //. Comments don't change anything in the result, but they can help you remind what something is.

Now change the name:

Code: Select all

        "$team_name_blue",
to

Code: Select all

        "Team orange",
You could also use the language file:

Code: Select all

        "$team_name_blue",
to

Code: Select all

        "$team_name_orange",
and

Code: Select all

team_name_blue			Team blue
to

Code: Select all

team_name_orange			Team orange
(repeat for other languages)

but that's probably not needed in your case.

Now you can build and run!

I think this is reasonably clear to non-programmers, but even if not you should now know teams are hardcoded. Perhaps the dev team will change that sometime, but not before you can modify teams yourself. :)
Last edited by Jonathan on Mon Feb 13, 2006 10:34 pm, edited 1 time in total.
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

That worked a treat. Thanks a lot.

If you want to try new colours enter "The Fortress of Death".

(and let me know if you have any suggestions for names and colours).
User avatar
Lucifer
Project Developer
Posts: 8751
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Lucifer's team. :)

rgb = 0.1, 0, 0.2

or so...
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
joda.bot
Match Winner
Posts: 421
Joined: Sun Jun 20, 2004 11:00 am
Location: Germany
Contact:

Post by joda.bot »

<-- puts another priority token on team balancing / team name support ;)
Post Reply