Message Location Explained

Straight from the Source

These 2 sections of Quake II CTF source code (from g_ctf.c) will show you how the new message variables work, and how the location variable determines what is the closest significant item to report.

Section 1 (from the CTFSay_Team procedure)

switch (*++msg) {
        case 'l' :
        case 'L' :
               CTFSay_Team_Location(who, buf);
               strcpy(p, buf);
               p += strlen(buf);
               break;
        case 'a' :
        case 'A' :
               CTFSay_Team_Armor(who, buf);
               strcpy(p, buf);
               p += strlen(buf);
               break;
        case 'h' :
        case 'H' :
               CTFSay_Team_Health(who, buf);
               strcpy(p, buf);
               p += strlen(buf);
               break;
        case 't' :
        case 'T' :
               CTFSay_Team_Tech(who, buf);
               strcpy(p, buf);
               p += strlen(buf);
               break;
        case 'w' :
        case 'W' :
               CTFSay_Team_Weapon(who, buf);
               strcpy(p, buf);
               p += strlen(buf);
               break;
        case 'n' :
        case 'N' :
                CTFSay_Team_Sight(who, buf);
               strcpy(p, buf);
               p += strlen(buf);
               break;

This switch/case statement is called every time a % character is encountered during a say_team message. It checks for 6 possible character values (in both lower and upper case so you don't have to worry about making your message aliases case-sensitive) and then executes a specific procedure if it finds that one of the 6 characters was used following the % sign. If a valid value is used, the specific procedure call brings back a certain piece of information that gets output in the say_team message...
The possible values are:

Variable Value

Function

%L

Report the player's current location relative to various items on the map (see the source code in Section 2 for a prioritized list of which items will be chosen as the location marker)

%A

Report how much armor the player is currently wearing

%H

Report how much health the player currently has

%T

Report what Tech (if any) the player possesses

%W

Report what weapon the player is currently using

%N

Report the name of another player in the line-of-sight of the player (i.e. report the name of the player that you're currently looking at, similar to the "id" command)

Note that the location variable can provide several pieces of information in its phrasing...here are some general tips:

The possibilities of improved team communication using these variables are incredible (thanks, Zoid). Here's some examples of basic say_team aliases that you can use these variables in (there's lots of potential here, I'm just going to do some obvious and simple ones...):

bind (key) "say_team Coming in with the Flag. Current Location: %L"
When flagrunning, this alias will allow you to quickly keep your teammates informed of your progress towards base.

bind (key) "say_team %N, please move out of my way..."
This alias will allow you to tell a teammate who's blocking your path to move so you can get through.

bind (key) "say_team Combat Status: Health=%H, Armor=%A, Weapon=%W, Tech=%T"
This alias will send your teammates a quick snapshot of your current situation.

Warning: Please don't overuse these messages...your teammates will start ignoring and/or hating you :)...

Ok, let's move on to the second section of code...

Section 2

// This array is in 'importance order', it indicates what items are
// more important when reporting their names.
struct {
        char *classname;
        int priority;
} loc_names[] = 
{
        {       "item_flag_team1",                    1 },
        {       "item_flag_team2",                    1 },
        {       "item_quad",                          2 }, 
        {       "item_invulnerability",               2 },
        {       "weapon_bfg",                         3 },
        {       "weapon_railgun",                     4 },
        {       "weapon_rocketlauncher",       4 },
        {       "weapon_hyperblaster",         4 },
        {       "weapon_chaingun",                    4 },
        {       "weapon_grenadelauncher",      4 },
        {       "weapon_machinegun",           4 },
        {       "weapon_supershotgun",         4 },
        {       "weapon_shotgun",                     4 },
        {       "item_power_screen",           5 },
        {       "item_power_shield",           5 },
        {       "item_armor_body",                    6 },
        {       "item_armor_combat",           6 },
        {       "item_armor_jacket",           6 },
        {       "item_silencer",                      7 },
        {       "item_breather",                      7 },
        {       "item_enviro",                        7 },
        {       "item_adrenaline",                    7 },
        {       "item_bandolier",                     8 },
        {       "item_pack",                          8 },
        { NULL, 0 }
};

This code outlines the order in which the location marker is selected. It first checks to see if you're near either Flag, then it checks for the Quad or Invulnerability, then the weapons in descending order, etc. So if, for example, you're standing next to a Rocket Launcher, a Railgun, and a Rebreather, the location variable will report "near the Railgun", because it occurs first in the prioritized list. Note here that if the Railgun in this location happened to be one dropped by a fragged player, then the location should be "near the Rocket Launcher", because the location is determined by item spawning spots, not by the actual item...this makes sense since reporting to your teammates that you're near a dropped weapon (or another "randomly" placed item like a Tech) would be almost useless...

I hope you've found this information useful...I took this info directly from the source code and tested a few things that were not readily apparent to me from perusing the code, so if you find behaviors that are different that what I've described here (or a new version comes out that invalidates parts of this article), please let me know (Scythe[SC]).