![]() | Friendly Codes |
Friendly codes are three-letter codes serving as a password for a planet's or starship's computer systems. Two objects having the same friendly code appear friendly to each other.
Some friendly codes activate special missions for the planet or the starship. PHost aims to move away from using friendly code for these cases, towards extended missions and commands, but the friendly codes are still supported.
Friendly codes can contain any printable character from the ASCII set (i.e. no control characters, no high-ASCII characters).
Starships and planets have their own Friendly Code. Starbases always use the same friendly code as the planet they orbit.
Mine fields are controlled by the planet belonging to the owner of the mine field and being located nearest to the mine field center.
Each minefield has an own, "local" friendly code (as above). In addition, you can define a "universal" minefield friendly code. For this, set a planet to mfX, where X can be any character. Ships can then use this friendly code to safely pass all your minefields.
This is useful when you want to grant a (not-yet-)ally free flight through your minefields without granting him access to your planet.
mfX is not considered a special friendly code.
What happens when friendly codes match? (This list doesn't claim to be complete.)
Now when are two friendly codes are considered matching? When they are identical, character by character, of course. Friendly codes are case-sensitive, a lower-case 'a' doesn't match an upper-case 'A'. However, in PHost, there's one big exception: Special Friendly Codes Never Match!
If a ship has a special friendly code (either registered friendly codes or the unregistered ones) then it will never match the friendly code of another ship, planet, or minefield. For example, if a ship has a friendly code of mkt then it will fight an enemy ship even if the enemy ship also has a friendly code of mkt. This holds true even for unregistered games.
All the special friendly codes defined by PHost are listed below. Add-ons may define their own special friendly codes. At host-side, these codes are listed in a file xtrfcode.txt. Players can use the send fcodes command to request a copy of that file. The file format is described below.
All special friendly codes are case-sensitive in PHost, that is, you must match the spelling exactly to trigger the special action. In HOST, some friendly codes are case-insensitive.
ald, alt, alm | Registered Players Only |
When used on a Merlin Class Alchemy ship, tells it to produce only one mineral (3 supplies -> 1 Duranium, Tritanium or Molybdenum). The last letter of the friendly code is the mineral to produce.
bdm |
("Beam down money") The ship will beam all its money down to the planet it is orbiting. You can also use the Beam Down Credits mission instead of this friendly code.
Precondition:
btf, btm, btt |
("Beam Transfer") The starship will transfer cargo to enemy (foreign) ships at the same location in space. If there are several ships, the cargo is split in equal portions.
You can also use the Transfer Torpedoes, Transfer Fighters and Transfer Fighters missions instead of these friendly codes.
These friendly codes will transfer stuff to all foreign ships, including cloaked ones.
Preconditions:
cln | Registered Players Only |
("Clone") Clones the ship. The ship must be in orbit around a planet with starbase. Cloning overrides a pending normal build order. Cloning costs the normal mineral amounts, but twice as much money (for details, see the ShipCloneCostRate config option).
Preconditions for cloning:
Normally, the Crystals and Privateers can not clone. PHost does not explicitly forbid it, but with the default configuration, cloning is far too expensive for them.
gsX |
("Give Ship") Gives a ship away to another race. That race must have ship or planet at the same location. The receiving race is encoded in the third letter of the friendly code:
Ship givings are simultaneous, that is you can exchange a ship with a friend by setting the appropriate gsX codes on both ships.
This command is perfectly identical to the give ship command. Unlike that command, it can't be disabled by the host, though.
HYP |
Engages the hyperdrive, on ships that have one. See there for details.
lfm | Robots, Rebels, Colonies only |
("Load Fighter Minerals") Automatically loads minerals for building fighters, and build these fighters. This code replaces the Build Fighters mission, which requires you to manually load the minerals. Unlike that mission, it also works for Rebels.
Actually, this action has two parts:
You can also use the Gather-build fighters mission instead of this friendly code.
Preconditions:
mdX | Registered Players Only |
("Mine Drop") These codes only work with the Lay Mines and Lay Web Mines missions; see there for more information. They specify how many torpedoes to convert into mines:
You can also use the Lay Minefield or Lay Web Minefield mission instead of this friendly code.
miX | Registered Players Only |
("Minefield Identity") These codes only work with the Lay Mines and Lay Web Mines missions. You may lay a mine field belonging to another player. The third letter of the friendly code is the race in whose identity to lay the mines (mi1=Federation, mi2=Lizards etc. to mia=Rebels, mib=Colonies (lower case!)).
Unless you have a mine-level alliance, the laying
ship is an enemy of the minefield afterwards.
When the MineIdNeedsPermission option is enabled, this friendly code only works when the target race has offered you a mine-level alliance.
You can also use the Lay Minefield resp. Lay Web Minefield mission instead of this friendly code.
Note that some front-ends have problems displaying non-crystal web mines and show them as normal mines. Look at the mine sweep messages in this case. Programs that read util.dat should show them correctly.
mkt | Registered Players Only |
("Make Torpedoes") Builds torpedoes. This codes builds as many torpedoes as possible, it requires the same amounts of money and minerals as on the starbase. However, using this code, your ships get independent from high-tech bases to resupply their arms.
You can also use the Gather-build Torpedoes or Build Torpedoes mission instead of this friendly code.
Preconditions:
msc | Registered Players Only |
("Mine Scoop") This modifies the Mine Sweep mission. When in sweep range of an own minefield, the mines are gathered back into cargo hold and turned into torpedoes again. It does not matter what torpedo type was originally used to lay the mine field. The ship needs torpedo launchers and beams for this.
You can also use the Scoop Torpedoes mission instead of this friendly code.
NAL |
("No Alchemy") When used on an alchemy, refinery or advanced refinery ship, tells it not to do alchemy. Thus the ship can be used as a normal freighter.
In HOST, this friendly code is reported not to work on advanced refinery ships.
nad, nat, nam | Registered Players Only |
When used on a Merlin Class Alchemy ship, tells it to produce only one mineral (6 supplies -> 2 Minerals). The last letter of the friendly code is the mineral not to produce.
nbr | Privateers, Crystals only |
When towing an enemy ship that has no fuel, Privateers and Crystals normally capture that ship (if AllowBoardingParties is enabled, that is). Using this friendly code on the towing ship prevents that. This way, Privateers and Crystals can tow friendly fuel-less ships without capturing them.
NTP |
Prevents use of torpedoes or fighters in battle. The ship will only use its beam weapons. This is useful when fighting a weak ship you wish to capture.
For the battle, the ship will appear to have the correct number of torpedo launchers/bays but no ammo in PHost. In HOST, NTP reports the correct amount and type of ammo, but no torpedo launchers/fighter bays.
pop | Glory-Device ships only |
Sets off the Glory Device at the end of the turn (after movement, before combat).
trg | Glory-Device ships only |
Triggers the Glory Device when a cloaked ship belonging to the primary enemy is found at the same location. With the Kill mission, any cloaked enemy ship triggers the device.
WRS |
The ship will scan for wormholes. You'll receive the scanner report sub space messages next turn.
WRT |
The ship will attempt to travel through the wormhole it is sitting before. Wormhole travel happens before movement (though the ship can not move normally this turn when it passes a wormhole). To move through the wormhole, the ship needs about as much fuel as it needs to travel 1/100 of the distance traveled (configurable, WrmTravelDistDivisor). If this fuel is not available, the ship will move unpredictably and get heavily damaged.
ATT |
("Attack") Directs the planet to attack ships (similar to the Kill mission on starships).
The Super Star Destroyer is immune against this friendly code, as are the Klingons and Rebels.
Relevant configuration items: AllowPlanetAttacks, PlanetsAttackKlingons, PlanetsAttackRebels.
bum |
("Beam Up Money") The planet will beam up all money to alien ships in orbit (including cloaked ones). If there are multiple ships, it will split the money into equal portions.
con |
("Configuration") Tells PHost to send you the pconfig.src file within your utilx.dat next turn. You can also use the send config command instead of this friendly code.
A number of add-ons will react on this friendly code (by sending configuration messages), too.
dmp | Registered Players Only |
("Dump") When the planet has a starbase, recycles all starship parts (hulls, beams, torpedo launchers, engines) in starbase storage. This returns the minerals used to build these parts, as per RecycleRate, but not the money.
Parts required by the current build order are not affected.
NUK |
("Nuke") Like ATT, but also attacks fuel-less ships. Fuel-less capital ships owned by the Bird Men can not be attacked, though.
PBX |
("Priority Build") Tell PHost which build orders you want to have executed first. X is a digit between 1 and 9. You can use each of these 9 friendly codes to designate up to 9 priority builds, PB1 being the most important (first). This friendly code is enabled with the AllowPriorityBuild config option. The exact interpretation depends on the build queue mode (BuildQueue).
Full details are on the Build Queue page.
The following HOST friendly codes are not implemented in PHost. In addition, HOST processes some friendly codes case-insensitive and some not; in PHost, all codes are case-sensitive.
ffX, eeX, FFX |
("Locking Alliance Friendly Codes") These friendly codes are not implemented in PHost. Alliances work completely different in PHost. PHost's alliance feature predates that of Host by about two years.
For details, see Alliances.
noc |
("No Config") In HOST, this friendly code tells HOST not to send the host configuration messages. PHost never sends its configuration file when not asked to. See con.
Add-on or external programs sometimes introduce new special friendly codes to implement new behavior. PHost's handling of special friendly codes with respect to matching (i.e., special friendly codes never match) is a simple and consistent rule for players to follow. PHost implements a mechanism that allows it to recognize an add-on's new friendly codes as being special for the purposes of matching.
The friendly codes are listed in a file xtrfcode.txt which must reside in the game or root directory. It contains a list of all the special codes. Since version 3.4, PHost automatically updates the file to include the PHost special codes (before, it would include them only in copies sent to players).
The file consists of a list of tokens with up to three characters, separated by whitespace and/or newlines. A three-character token defines just that friendly code special, shorter tokens declare special everything that starts with these characters. Matching is case-sensitive.
For example, if the xtrfcode.txt file contains
BJG AJG RJG J |
then friendly codes of BJG, AJG, RJG as well as any friendly code that begins with J are considered special and will never match another friendly code. The above example may be suitable for use with the "Jumpgate" add-on (although the J code is overly broad: only codes consisting of J followed by a number are considered special by "Jumpgate", but there's no shorter way to describe that exactly than listing them all).
Here is another example xtrfcode.txt file that may be used with the RacePlus add-on (a bit broader than needed, too):
HUD ! !! EGG BAC TCC STB MK GWG RDV BBT SFG |
Finally, another example xtrfcode.txt file that may be used with the FHost add-on:
FA FB FP FT FG TA TB BSG C BS ASG RSG J BCT RCT FCT BSB RSB FSB SSC KSP KPL AFC ATC GS EXC BUM MTN |
Last updated 02 March 2003.