Item codes

From The Urban Dead Wiki
(Redirected from Inventory string)
Jump to navigationJump to search
Item Codes - Attack Codes - Target Codes

It is widely believed (among Firefox UD extension developers) that the inventory of each player is stored as a single string in a field of the user's line in the users table of the UD database. Only Kevan knows for sure, but so far nothing seems to invalidate this hypothesis.

Each item is stored in the inventory string as a letter, eventually followed by a number if the item needs extra info to be defined. This is so far the case for only three items: the shotgun, the pistol, and the radio.

The length of the string is used as “weight”. If a search is successful, the message You cannot carry any more. will appear if the string length is equal to or greater than 81 (was 51 pre-Encumbrance).

Actions that change the inventory

Searching

When a search is successful, the length of the inventory string is used as “weight” to check if the player can add an item to his inventory.

The message "You cannot carry any more" will appear if the string length is equal or greater to 51. Since shotguns and pistols require 2 characters, they count as two items. Since radios require 5 characters, they count as five items.

If the string length is 50 or less, the item code is appended at the end of the inventory string, possibly making it longer than 51 characters in the process.

Knowing this can be useful when finding unwanted items: The one you just found is at the very end of the Drop List.

Using an item

Some items disappear from your inventory when used. (Beer, Wine, Newspaper, Spray Can (if unlucky), etc.) Only the code of the item is sent to the server, not the actual position of the item you clicked. The item removed from your inventory string is the first encountered in the string that matches the sent code.

Dropping an item

Same as using it, only the item's code is sent. The first match in your inventory string will be removed. This can sometimes be confusing, when you drop the unwanted item you just found, clicking on the last value of the drop-down box (a second fire axe for example) and see first disappear instead. The associated number described above is sent too; so when you choose to drop an empty shotgun, you'll drop the first empty shotgun in your inventory.

Reloading

Reloading doesn't send any extra information to the server. The game will find the weapon of that type with the lowest ammunition count and reload it. If there is more than one weapon with the same ammo count, the first will be reloaded. The ammunition itself will disappear in accordance with the usual rules given above.

Firing

When you fire at a target, only the type of weapon is sent to the server; you cannot specify the which of your pistols/shotguns you'd like to use. The weapon used is the first in the list that is of the correct type and has at least 1 shot left. This is not optimal in terms of inventory space. The ideal scenario would have been to fire the gun with the least shots left, providing it is not empty. Knowing this, you can plan your reloading more efficiently. For example, assuming your first pistol is empty and second has one shot left, it would be advisable to wait for next shot before reloading both guns. If you reloaded immediately, you would have to empty the entire pistol before being able to reload the second efficiently.

List of item codes

Code Item Name Category
a GPS Unit Useful Items
bX (X=shots,
i.e. b6 = fully loaded pistol.)
Pistol Firearms
c Flare Gun Useful Items
d Crowbar Melee Weapons
e Baseball Bat Melee Weapons
f Flak Jacket Useful Items
g Kitchen Knife Melee Weapons
h First Aid Kit Useful Items
i Fuel Can Useful Items
j Mobile Phone Useful Items
k Pistol Clip Firearms
l Book Assorted/Misc Items
m Crucifix Assorted/Misc Items
n Newspaper Assorted/Misc Items
o Fire Axe Melee Weapons
p Length of Pipe Melee Weapons
q Pair of Wirecutters Assorted/Misc Items
r Shotgun Shell Firearms
sX (X=shots,
i.e. s2 = fully loaded shotgun.)
Shotgun Firearms
t Beer Assorted/Misc Items
u Wine Assorted/Misc Items
w DNA Extractor Useful Items
x Spray Can Assorted/Misc Items
y Poetry Book Assorted/Misc Items
z NecroTech Revivification Syringe Useful Items
A Portable Generator Useful Items
BXXXX (XXXX = frequency,
i.e. B2710 = radio @ 27.10 MHz.)
Radio Useful Items
C Radio Transmitter Useful Items
D1 Pool Cue Melee Weapons
D2 Cricket Bat Melee Weapons
D3 Fencing Foil Melee Weapons
D4 Ski Pole Melee Weapons
D5 Tennis Racket Melee Weapons
D6 Hockey Stick Melee Weapons
D7 Golf Club Melee Weapons
F Binoculars Useful Items
G1 plastic Christmas tree Decorative Items
G2 red Christmas lights Decorative Items
G3 green Christmas lights Decorative Items
G4 white Christmas lights Decorative Items
G5 dead fir tree Decorative Items
G6 Stale Candy Assorted/Misc Items
I Museum Piece (in general) Decorative Items
IXX, XX is a number Certain Museum Piece, (for example, I24 is a European Painting) Decorative Items
I81 pumpkin Decorative Items
J1 toolbox Useful Items
J2 video camera Monroeville only item

The missing items

Note that the letter v is missing. Some think it's the letter for the Mark One revivification syringe. Others think there is a super-secret item, undocumented on the wiki. Should you own an item identified by v, please add the missing info here.

Letters E and H are now also missing.