Docs/ORB WeaponSkins/Adding Weapons

Adding Weapons

Ten weapons ship configured. Adding more is a one-line change, plus a short hunt for one value.

The config

Each weapon is a row in Config.Weapons inside config.lua:

lua
{ weapon = 'WEAPON_CARBINERIFLE', label = 'Carbine Rifle',
  txd = 'w_ar_carbinerifle', texture = 'w_ar_carbinerifle' },
FieldMeaning
weaponThe weapon hash name, used to detect what is in hand
labelWhat players see in the menu
txdThe weapon's texture dictionary
textureThe texture inside that dictionary

Finding the txd

The texture dictionary is the weapon's model name from weapons.rpf. For example the Carbine Rifle is w_ar_carbinerifle, and its MK2 is w_ar_carbineriflemk2.

Finding the texture name

This is the part that needs a moment. Most weapons name the texture the same as the dictionary, and those work immediately. Some do not, and no native can list what is inside a texture dictionary, so the name has to be found by trying.

Three admin commands do that for you, in game:

CommandWhat it tries
/wskinscan Dictionary variants, including the _hi high detail form
/wskinparts Part texture names inside a dictionary
/wskintex One exact pair, applied immediately

Hold the weapon, run a scan, and watch the gun. Each candidate is applied for a moment and then removed, so exactly one is live at a time and a hit is obvious. The F8 console prints which one is being tried.

Once a pair works, write it into Config.Weapons.

For a definitive answer instead of a search, open the weapon's .ytd in CodeWalker or OpenIV and read the texture name directly.

Components

Magazines, stocks, scopes, grips and suppressors are separate parts, and GTA packages them two different ways depending on the weapon: either in their own texture dictionary, or as a second texture inside the weapon's own dictionary. Both are covered automatically.

If one part of a weapon stays unskinned while the rest works, its name is outside the default list. /wskinparts finds it, and it can then be added to Config.MagazineSuffixes.