Black Mesa

Black Mesa

44 ratings
[SOURCEMOD] Ammo Pickup ConVar/Crossbow Pickup Fix
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
14.689 KB
11 Apr, 2021 @ 8:31pm
1 Change Note ( view )

Subscribe to download
[SOURCEMOD] Ammo Pickup ConVar/Crossbow Pickup Fix

Description
NOTE: THIS ADDON REQUIRES SOURCEMOD AND MANUAL INSTALLATION TO RUN. READ THIS DESCRIPTION IN FULL FOR INSTRUCTIONS.

If you've ever tried to alter the amount of ammo you get from ammo pickups in Black Mesa - whether that be to match them to Half-Life, or to fix the fact that crossbow magazines, which clearly only hold five bolts, inexplicably provide you with ten bolts instead (literally the ammo cap for the crossbow by default!) - then chances are you're aware that the console variables for this are badly formatted, making them impossible to edit. Even though this has been brought up multiple times, it's still never been fixed.

Hence this plugin's creation. This plugin adds a new set of console variables for ammo pickups that can actually be modified, allowing you to change the amount of ammo any pickup of a given type will provide you with. By default, it also halves the amount of ammo given by crossbow pickups, which also helps address the overabundance of crossbow ammo in later chapters of the game.

This plugin also has a feature wherein a mapper can add in extra spawnpoints for extra crossbow ammo, if they should so desire. This makes it possible to balance a single map for both the standard 10-bolt pickup as well as the fixed 5-bolt pickup. See below for details.

Note that this plugin is ONLY DESIGNED FOR USE IN SINGLE-PLAYER MODE. If you can get it to load on a multiplayer server, there is no guarantee it'll work properly. I do not recommend attempting this.

This plugin adds console variables for each ammo type, as well as one enabling console output and one for enabling increased crossbow ammo spawns. All of these variables are saved to a config file, which can be found at Black Mesa/bms/cfg/sourcemod/bm_ammopickupfix.cfg. If you want to change any of these values to keep them consistent between launches of the game, you can do so here.

CROSSBOW AMMO SPAWNING

When a map is loaded with this plugin installed, if bm_ammopickup_2x_crossbow_ammo is set to 1, then this plugin will start by scanning the map for extra crossbow ammo spawnpoints. These are accomplished via an info_target entity, with the name bmpuf_crossbow_ammo. If any info_target's with this name are found in a map, then this plugin will remove them and spawn a crossbow magazine in their place, inheriting their position and rotation.

What this means for mappers is that if you want to add extra crossbow ammo spawns for use with this plugin, all you have to do is add an info_target entity with the targetname bmpuf_crossbow_ammo. This is a simple way to allow for easily balancing a map for both the default 10-bolt ammo pickups and the 5-bolt ammo pickups that this mod has by default. Of course, players can also use this convar to increase the total number of ammo spawns even with the default 10-bolt pickups, but still.

SOURCEMOD INSTALLATION

  1. Download the latest developer branch builds of SourceMod[www.sourcemod.net] and MetaMod:Source[www.sourcemm.net]. If you're not sure where exactly to find them, you can find a pre-packaged download of working builds HERE.[drive.google.com]
  2. Install both of them to your Black Mesa installation - this should be somewhere like Program Files (x86)/Steam/steamapps/common/Black Mesa/bms, though its exact location may differ based on your setup. If you downloaded them separately, drop the addons folder from MM:Source in the bms directory, followed by the addons and cfg folders from SourceMod - if you downloaded the package, extract the bms folder from it and merge it with the directory in the Black Mesa folder.
  3. In your Steam library, find Black Mesa, right-click it, and select Properties. At the bottom of the window is an option labelled Launch options. Add this to it:
    -insecure
    Do note that starting Black Mesa with this launch option enabled WILL PREVENT YOU FROM CONNECTING TO VAC-SECURED MULTIPLAYER SERVERS.
    If you should want to play multiplayer, remove the -insecure entry from the launch options.
  4. Launch the game and bring up the developer console. In it, type the following commands and press enter.
    meta sm
    If MetaMod:Source and SourceMod are installed correctly, you'll get output something like this in response:
    ] meta Metamod:Source Menu usage: meta <command> [arguments] alias - List or set an alias clear - Unload all plugins forcefully cmds - Show plugin commands cvars - Show plugin cvars credits - About Metamod:Source force_unload - Forcefully unload a plugin game - Information about GameDLL info - Information about a plugin list - List plugins load - Load a plugin pause - Pause a running plugin refresh - Reparse plugin files retry - Attempt to reload a plugin unload - Unload a loaded plugin unpause - Unpause a paused plugin version - Version information ] sm SourceMod Menu: Usage: sm <command> [arguments] cmds - List console commands config - Set core configuration options credits - Display credits listing cvars - View convars created by a plugin exts - Manage extensions plugins - Manage Plugins prof - Profiling version - Display version information
    If you get a message stating Unknown command, then something isn't installed properly. Double-check and make sure you've got both a metamod and sourcemod directory in your /bms/addons folder, as well as a pair of files called metamod.vdf and metamod_x64.vdf. If all four of those are present, check and make sure that you added -insecure to the launch parameters via Steam before starting the game.
  5. Subscribe to this addon and let it download (this shouldn't take very long, since it's a relatively small file). When it's done, you can find it in your workshop downloads folder for Black Mesa - this'll be somewhere like Program Files (x86)/Steam/steamapps/workshop/content/362890/2454684652. Inside, you should find a folder named BM Ammo Pickup Fix.
  6. Copy the contents of this folder into your Black Mesa directory, merging the bms folders. This will install the compiled plugin, as well as place a copy of its source code in addons/sourcemod/scripting.
  7. Either restart Black Mesa, or run this command in the console:
    sm plugins refresh
    Once that's done, run this command as well:
    sm plugins list
    If installed correctly, you should see a line like this somewhere in the output:
    11 "[Black Mesa] Ammo Pickup Fix" (1.0) by KyuuGryphon

If you've followed these instructions correctly, the plugin should be working as intended! You can now actually modify how much ammo any given pickup type provides you with to suit your liking.

If you encounter any bugs, please feel free to let me know, and I'll do what I can to fix them - though make sure you've followed these instructions correctly before reporting bugs about the plugin or SourceMod just "not working". Reading comprehension is on you, not me.
34 Comments
Neo2266 2 Jul @ 2:55pm 
Black Mesa past 2018 really was 3 steps forwards 2 steps backwards. I despise how Revolver pickups now give 12 ammo instead of 6. Even with the increased capacity, you're always full. I swear the shotgun used to give less also.

This paired with the choice to give the player the revolver all the way at Power up, not only disallows the player to have a ranged option at We've Got Hostiles, but takes away the opportunity to train with the revolver, and completely fucks over the idea that revolver ammo is precious!

The place where you find it now, has enough ammo for 3 full inventories, and the worst thing is that, if the player remembers this and tries to go back for it, the door is now closed cuz... can't have the player venture off the straight line we made for them. It's so fucking pathetic.
(not to mention that you now recieve the revolver alongside Tripmines, so a new player will be overwhelmed)

Anyway, thank you, this at least partly fixes this issue.
pyromine_niac 7 Feb @ 8:25am 
there seems to be a problem with the "bm_ammopickup_mp5" convar, when I set it to 10 it still gives me 30 rounds
2.5 Bobux 30 Dec, 2024 @ 8:58pm 
Thank you so much for making this! This has been bugging me for who knows how long, I really can't thank you enough haha. Just tested it on my end and it seems to work as intended, at least for now.
Nevermore2790 17 Nov, 2024 @ 8:10am 
Apparently, the latest Black Mesa update must have broke Sourcemod plugin. Having that will have a guaranteed crash when starting up the game. Any mods that rely on this plugin will be useless.
khánh 7 Nov, 2024 @ 6:24pm 
tysm
White and Birdy™  [author] 7 Nov, 2024 @ 5:13pm 
No, but the ammo commands in the mod release of BM aren't malformed, so there's no need.
khánh 28 Oct, 2024 @ 8:59pm 
ik its late but do this also work with the free version aka 2013 version?
gimblegorg 3 Sep, 2024 @ 6:26pm 
turns out the meta and sm commands are unknown but the mod still works. cool
gimblegorg 30 Aug, 2024 @ 6:45pm 
it didnt work :<
gimblegorg 30 Aug, 2024 @ 6:43pm 
heey so i might jsut be blind but i checked every step at least 3 times and the meta and sm commands dont work. im still gonna try sm plugins list tho, so yeag