Repository navigation
Adding Addon Weapons to LSR LSRP
The first step is actually creating the xml. It needs to be stackable, so it should have the name weapons+_.xml What I like to do from there is find a similar weapon from the default weapons.xml and copy it into your weapons+_blabla.xml and prepare it for formatting. You'll need to start by writing the model name (ex: weapon_israelirifle).
To add your new weapon to LSR/LSRP you need to get the hash of your new addon weapon. This can be done from openIV (press tools and hash generator, set to unsigned int as output). It's pretty simple to get the base weapon hash, as all you have to do is type WEAPON_ADDONWEAPONNAME (ex: WEAPON_ISRAELIRIFLE). Now you need to head back to your stackable weapons+_blabla.xml and pop in that hash to your weapon's entry.
All you need to do is open up the weaponcomponents.meta (yourdlcpack/dlc.rpf/common/data/ai) and check the name of the components. They will be organized by item. Then you just generate a hash from that name, just like the overall weapon. (ex: COMPONENT_ISRAELIRIFLE_CLIP_01)
For each component you have, you need to have an entry in (weapons+_blabla.xml). There's probably already some from the weapon you copied initially, so you can just edit those, whether that's deleting entries and editing or adding more. You'll have to generate a hash for each component and add it.
- Creating a custom ModItems+_blabla.xml follows fairly similar steps. You're going to want to copy a similar item (just use the same one you used for weapons+_blabla.xml) from the default ModItems.xml. You're going to edit the name of the weapon to how you want it to appear in game, the description, and you'lll have to put in the model name (ex: weapon_israelirifle) and the vanilla name (whatever your gun appears as in game- I haven't actually installed the israelirifle so I don't have an example for that one 😅 )
- ShopMenus+_blabla.xml is also pretty similar, just copy your smilar weapon and put in your name, price, etc. For adding the weaponcomponents to the shop you'll have to add and fill out the details. The names of the extras are what you set your weaponcomponents to be in weapons.xml
- I haven't really messed around with IssuableWeapons but again it's a similar process of just finding what category of spawns you want to have access to your weapon and then adding in the model name and setting spawn chance and whether it has components or not.
After that, you are done!