Jump to content

Sell command

From Galactic Empire wiki

The SELL command converts cargo aboard the ship into cash by selling it to Galactic Command at Zygor.

SELL amount item

Both classic Galactic Empire and ge-next require the ship to be in stationary orbit around Zygor, planet 1 in sector 0 0. SELL does not sell cargo to any other planets.

Where cargo can be sold

Zygor is the game's central purchaser. The ship must be orbiting Zygor itself; being elsewhere in sector 0 0 or orbiting Tahanian Station or the Enforcer Planet is not sufficient.

No planetary password, ownership, reserve, bank balance, or local trade setting is involved. Zygor pays the configured base price and charges a transfer tax. The sold items are removed from the ship; the actual Zygor planet record is not changed.

Price and transfer tax

The sysop-configured base price for the item determines the gross value:

gross = item base price * quantity sold
fee   = 1 + floor(gross / 1000)
net   = gross - fee

The fee is therefore approximately one-tenth of one percent, plus one credit. The extra credit also acts as the minimum fee. If the fee is equal to or greater than the gross value, the fee is limited to the gross and the seller receives nothing.

Using the default prices, some example transactions are:

Command Gross Fee Net cash
SELL 1000 MEN 2,000 3 1,997
SELL 3 ION 99 1 98
SELL 500 FOOD 1,000 2 998
SELL 1 TROOP 1 1 0

These examples use the standard configuration. A sysop can change every base price, so actual values may differ between games. The completion message states the quantity sold, transfer tax paid, and net cash received.

Classic Galactic Empire

Classic syntax requires a positive numeric quantity:

SELL 1000 MEN
SELL 3 ION
SELL 500 FOOD

The complete requested amount must be aboard. If the ship has fewer units than requested, nothing is sold. Zero and nonnumeric text are rejected as invalid syntax. Negative quantities are not a supported classic feature and do not produce an "all but" sale; the unsigned conversion instead makes the request appear far larger than the inventory, so it is refused.

Classic help lists every normal cargo category except spies, which were never added after spies were introduced in version 3.1b.

Classic performs the gross-value calculation and cash addition using its original fixed-width arithmetic. Extremely large transactions can overflow those calculations. Its final signed check attempts to reset a wrapped-negative cash balance to zero, but that is not a general overflow safeguard.

ge-next

ge-next retains exact numeric sales and adds ALL:

SELL 1000 MEN
SELL ALL GOLD

ALL sells the entire onboard quantity of the selected item. If none are aboard, ge-next reports that explicitly rather than treating the command as a numeric zero.

ge-next also accepts a negative amount as an "all but" request, consistent with its expanded cargo commands:

SELL -20 MISSILES

This sells every missile except 20. If the ship contains fewer than the amount to be retained, the sale is refused. If retaining that amount leaves zero to sell, no transaction occurs.

Large transactions

ge-next 0.1 added checks to prevent large sales from overflowing the gross-value calculation or the player's cash balance. At that point, a sale whose gross value exceeded the signed-long limit of 2,147,483,647 credits, or whose net proceeds would push cash above 4,294,967,295, was refused in full. These checks prevented the classic overflow, but did not split a sale into smaller transactions.

ge-next 0.3 changed this to partial sales. If the requested quantity would make the gross value exceed the unsigned-long limit of 4,294,967,295, the game reduces it to the largest quantity that fits and warns the player. If the resulting net proceeds would exceed the player's remaining cash capacity, it finds the largest quantity whose proceeds fit, warns that the financial limit has been reached, and sells only that amount. Only the quantity actually sold is removed from the ship. If no quantity can be sold within these limits, no cargo is removed; an item whose sale yields zero net cash can still be sold at the cash limit.

Galactic Command standing

Unlike classic GE, ge-next can temporarily deny Zygor business to a player whose Galactic Command faction standing is sufficiently hostile. The Enforcer Planet reports that the player has committed crimes against Galactic Command and states the remaining length of the trading ban. While banned, the player cannot use Zygor's normal buying, pricing, or selling services.

Sellable items

The command recognizes every standard ship-inventory item:

Keyword Item Keyword Item
MEN Men FIG Fighters
TRO Troops DEC Decoys
MIS Missiles MIN Mines
TOR Torpedoes JAM Jammers
ION Ion cannons ZIP Zippers
FLU Flux pods GOL Gold
FOO Food SPY Spies

Comparison

Feature Classic GE ge-next
Sale location Zygor only Zygor only
Positive numeric quantity Yes Yes
ALL No Yes
Negative "all but" quantity No Yes
Spies Supported by code but omitted from help Supported and documented
Price Configured Galactic Command base price Same
Transfer tax 1 + floor(gross / 1000) Same
Large-value protection Original arithmetic can overflow Quantity and cash proceeds are bounded safely
Faction restriction None in the SELL command Hostile Galactic Command standing can block Zygor trade

See also