Perfect Dark Source: Weapon Sets
Perfect Dark Source introduces weapon sets, also known as weapon profiles, item sets, etc. With these, the weapons that spawn on a map can vary to the admin's tastes.
For Server Admins
Adding or modifying weapon sets can be accomplished by using console commands to test in-game then loading notepad and editing the weapon set definitions.
Editing weaponsets.txt
This file is required by the mod, it resides at the root level, next to GameInfo.txt.
The file consists of a key named WeaponSets that contains a list of WeaponSet keys. Each weaponset has a Name and Slots keys. Name contains the name of the weaponset, this name will be used ingame. Slots contains a numbered list of weapons/items. The list doesn't have to be ordered neither does it have to be complete, a list may contain slots 1 through 5 except number 3. The list of item names to place on each slot definition is here.
"WeaponSets" { "WeaponSet" { "Name" "Standard" "Slots" { "1" "falcon2" // Weapon #1 "2" "ammo_heavy" "3" "ammo_g_round" "4" "rcp120" "5" "ammo_medium" "6" "ammo_medium" "7" "superdragon" "8" "ammo_heavy" "9" "ammo_g_round" ... "16" "grenade" "17" "ammo_grenade" "18" "ammo_grenade" } } "WeaponSet" { "Name" "Random" "Slots" { "1" "<random>" } } "WeaponSet" { "Name" "Unarmed" "Slots" { "1" "<none>" } } }
The file is loaded with the mod. The first level loaded uses the first weapon set on the list. The current set may be modified by using a console command.
The number of slots on a weapon set equals the maximum slot number contained by it, for example, a weapon set with only slot 1 and 12 defined has twelve slots not two, slots 2 to 11 contain the item <none>.
When a map requires the content of a slot number greater than the number of slots on a weapon set the value will wrap and start counting again. On the previous example when asked for slot 13 the game will get to slot number 12, rollback, and start counting again, it will use the contents of slot 1. Slot 24 would use the contents of slot 12, slot 21 the contents of slot 9 (<none>) and so on.
The recommended number of slots to define on a weapon set is only 1 slot to make all weapons of the same type, 18 for a regular weapon set, or a multiple of 18 (36, 54, etc). The reason is so the weapon sets work on any map by agreeing on an standard with level designers.
Item Names
Names on bold are usable on the current release.
<allweaps-old> <allweaps-new> <random> <none> ar34 callisto cmp150 knife crossbow cyclone dartgun devastator dragon dy357 dy357lx falcon2 falcon2-sil falcon2-sco farsight grenade k7avenger laptopgun laser magsec4 mauler mineremote minetimed mineproxy nbomb phoenix rcp120 reaper rpg shotgun slayer sniper superdragon unarmed ammo_standard ammo_medium ammo_heavy ammo_maian ammo_skedar ammo_g_round ammo_rpg ammo_sk_rpg ammo_knives ammo_dart ammo_bolt ammo_shell ammo_magnum ammo_sniper ammo_grenade ammo_nbomb ammo_minetimed ammo_mineremote ammo_mineproxy shield
Names on bold are usable on the current release.
Console Commands
- weaponset_load <setname>
- Reload Weapon Set <setname> information from weaponsets.txt, overwrites unsaved changes done to sets during the session. If param is <all> then load all weapon sets.
- weaponset_use <setname>
- Set <setname> as the current weapon set.
- weaponset_modslot <itemslot> <itemnick>
- Modifies existing slot of current set.
Settings.scr
Currently, Perfect Dark: Source does not edit settings_default.scr or settings.scr automatically to include user modifications to weaponsets.txt.
When creating a listen server, the list of weapon sets can be modified by editing settings.scr manually on a text editor. Keep in mind that the index number associated to the set name depends on the order the sets appear on weaponsets.txt. The first set is always index 0.
Indexes 0, 1, 2 and 3 will always try to find Standard, Random, Unarmed and Beta Weapons respectively, no matter where they are located on weaponsets.txt and no matter what the actual sets for those indexes are. Indexes 4, 5, 6 etc will point to their respective indexes, without attempting a name lookup.
So, it is recommended to keep Standard, Random, Unarmed and Beta Weapons at the start of weaponsets.txt and add new sets at the end of the file.
For Level Designers
To add a weapon spawn compatible with weapon sets the entity item_weaponset has to be placed on the map. Among the many options it includes, the spawning weapon has to be set as "Use Weapon Set" and the weapon set slot to any number. Numbers 1 through 18 under this template are recommended:
Slot 1: Strong Weapon Slot 2: Strong Weapon's Ammo 1 Slot 3: Strong Weapon's Ammo 2 Slot 4: Medium Weapon Slot 5: Medium Weapon's Ammo 1 Slot 6: Medium Weapon's Ammo 2 Slot 7: Weak Weapon Slot 8: Weak Weapon's Ammo 1 Slot 9: Weak Weapon's Ammo 2 (and repeat)
Greater numbers than 18 should be used for the slots when the map requires more than 18 weapon spawns, always keeping in mind the sets of 9 shown above. It is not a requirement that each item_weaponset entity has a different slot number for the mod to run correctly.