Weapon Store - WithLithum/CityCompanion GitHub Wiki
A weapon store definitions file indicates what weapon will be selled, what are their prices, and how many ammo can be selled at once, and whether you can buy more ammos after you purchased the weapon itself. It is located at scripts\CityCompanion\weaponshop_entries.json
in your game directory.
You will need a weapon defintions file to get it working. You can find a working example of weapon definitions file here, which contains all weapons for v2189. You can declare new weapons there or you can try find a new version of the defintions which uses the same format.
Then, you will need to declare weapon shop entries. Pay attention to WEAPON_UNARMED
- don't sell it (it is your Fist).
Weapon defintions file contains an object called Weapons
which is a dictionary, with the hash of the weapon as a key and an object describing the information needed to sell the weapon.
Here is an example of an object which describes the weapon selling:
"453432689": {
"Price": 100,
"Ammo": 50,
"AllowExisting": true
}
Here is a working copy of weaponshop_entries.json
used for development:
{
"Weapons": {
"2578778090": {
"Price": 15,
"Ammo": 1,
"AllowExisting": false
},
"1737195953": {
"Price": 50,
"Ammo": 1,
"AllowExisting": false
},
"1317494643": {
"Price": 35,
"Ammo": 1,
"AllowExisting": false
},
"453432689": {
"Price": 100,
"Ammo": 50,
"AllowExisting": true
},
"1593441988": {
"Price": 150,
"Ammo": 50,
"AllowExisting": true
}
}
}