Items and props
Which prop an item gets
Section titled “Which prop an item gets”An item gets the first of these that matches:
data/items.lua, by exact item name.SLTrunk.WeaponProps(data/fallback.lua): GTA weapons by item name.SLTrunk.Keywords: a word in the item name (water,ammo,phone…). Money, documents and keys are not shown.SLTrunk.BySize: the weight of one unit, from your inventory’s item list.SLTrunk.DefaultProp(a cardboard box).
The server console tells you once which prop each unlisted item got, so you can list it if you want another one.
Giving an item its prop
Section titled “Giving an item its prop”In data/items.lua:
SLTrunk.Items = { my_item = 'prop_cs_cardbox_01', -- one prop per unit my_ammo = { prop = 'prop_ld_ammo_pack_01', per = 30 }, -- one prop per 30 units my_card = false, -- takes no space and is not shown}Any GTA prop works, or an addon prop your server streams.
New props are measured automatically
Section titled “New props are measured automatically”The 3D packer needs the size of each prop. You do not have to do anything: the first time an item with a new prop enters a trunk, a connected player’s game measures the model and the server keeps the size in data/footprints_auto.lua. Until then the item shows with its automatic prop.
- Delete a line of
data/footprints_auto.luato measure that prop again. - A prop that does not exist in the game is reported in the console, and the item keeps its automatic prop.
Lying flat
Section titled “Lying flat”Weapon models (w_*) always lie on their side. Add other long props to SLTrunk.LieFlat in data/fallback.lua:
SLTrunk.LieFlat = { prop_my_long_thing = true }