Jump to content

Brass Catcher for A21


Hells_Janitor

Recommended Posts

A weapon attachment for 9mm, 7,62mm, and .44 caliber firearms, that returns approximately 50% of bullet casings, but makes weapons reload 15% slower.

This weapon attachment is lootable, craftable, and available in trader stock.

Unlocks with its schematic, and is crafted in a workbench.

Recipe cost is:

10 forged steel
10 mechanical parts
10 scrap polymer
5 glue

About the mod:

This mod is XML only, and uses no custom assets. As such, it should be perfectly fine as a server-side only mod.

Installation:

If you do not have a Mods folder in your \steamapps\common\7 Days To Die folder, create one. Make sure it's capitalized properly.
Download the .zip, and extract its contents to your Mods folder. (usually \steamapps\common\7 Days To Die\Mods)

Alternatively, you can extract the .zip to %AppData%\Roaming\7DaysToDie\Mods. Again, if the Mods folder doesn't exist at this location, create it.

 

Download: https://github.com/HellsJanitor/A21-Brass-Catcher

Screenshot 2024-01-28 152230.png

Screenshot 2024-01-28 152316.png

Screenshot 2024-01-28 152402.png

Edited by Hells_Janitor (see edit history)
Link to comment
Share on other sites

  • 1 month later...

I have this working on my local computer and its great. When i add the mod to the server i have running in my office, the mod does not work. I can call the buff directly and it will give me a brass like its supposed to (buff buffreclaimbrass) and i can use the debug menu (dm then press f3 and enable one of the bubbles that lets you see the character current buffs) and it shows that the buff is applying to my character when i shoot, but i never get any brass from shooting. I have run though a lot of ammo testing it so its not an RNG thing. Ive tried creating a new game new world etc. nothing seems to work.

it works on my local computer but not on my server and nothing im (randomly) changing is making it work. please help

Link to comment
Share on other sites

Just now, jermo47 said:

I have this working on my local computer and its great. When i add the mod to the server i have running in my office, the mod does not work. I can call the buff directly and it will give me a brass like its supposed to (buff buffreclaimbrass) and i can use the debug menu (dm then press f3 and enable one of the bubbles that lets you see the character current buffs) and it shows that the buff is applying to my character when i shoot, but i never get any brass from shooting. I have run though a lot of ammo testing it so its not an RNG thing. Ive tried creating a new game new world etc. nothing seems to work.

it works on my local computer but not on my server and nothing im (randomly) changing is making it work. please help

 

We had the same issue when running it on our server too. I have no idea why it works exactly like you said and is fine in single-player, but borks when in a multiplayer environment.

 

It's on my radar to look into - sorry I didn't have any better news.

Link to comment
Share on other sites

19 minutes ago, Hells_Janitor said:

 

We had the same issue when running it on our server too. I have no idea why it works exactly like you said and is fine in single-player, but borks when in a multiplayer environment.

 

It's on my radar to look into - sorry I didn't have any better news.

Understood. Im going to keep playing with it and will let you know if I figure something out. Thanks!

 

Link to comment
Share on other sites

On 3/18/2024 at 5:30 PM, Hells_Janitor said:

 

We had the same issue when running it on our server too. I have no idea why it works exactly like you said and is fine in single-player, but borks when in a multiplayer environment.

 

It's on my radar to look into - sorry I didn't have any better news.

 

Hey Hells_Janitor, this is a nice mod, thanks.

 

The way its described and a quick look at the code and am wondering if the multiplayer code might not be shutting the buff down for some reason (eg. interpreting the duration of '0.01' as '0' and leaving the buff running. 

From the docs (buffs.xml line 11492 - not sure how up to date it is), replace resets the timer it doesnt replace the entire buff. So <stack_type value="replace"/> might not be doing what its intended to do.  The GameEvent is called at onSelfBuffStart so it will only run once even if the timer is reset.

Wonder if something like following would change the way it behaves:

 

<stack_type value="ignore"/>
<duration value="0"/>
<effect_group>
    <triggered_effect trigger="onSelfBuffStart" action="CallGameEvent" event="modBrassCatcher"/>
</effect_group> 
<effect_group>
    <triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffReclaimBrass"/>
</effect_group> 

 

Edit: Just to add that from the above, some calls to the buffReclaimBrass will be ignored, eg with a machine gun - can cater for this by upping the percent chance for brass.

cheers

Edited by JoeSloeMoe (see edit history)
Link to comment
Share on other sites

10 hours ago, JoeSloeMoe said:

 

Hey Hells_Janitor, this is a nice mod, thanks.

 

The way its described and a quick look at the code and am wondering if the multiplayer code might not be shutting the buff down for some reason (eg. interpreting the duration of '0.01' as '0' and leaving the buff running. 

From the docs (buffs.xml line 11492 - not sure how up to date it is), replace resets the timer it doesnt replace the entire buff. So <stack_type value="replace"/> might not be doing what its intended to do.  The GameEvent is called at onSelfBuffStart so it will only run once even if the timer is reset.

Wonder if something like following would change the way it behaves:

 

<stack_type value="ignore"/>
<duration value="0"/>
<effect_group>
    <triggered_effect trigger="onSelfBuffStart" action="CallGameEvent" event="modBrassCatcher"/>
</effect_group> 
<effect_group>
    <triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffReclaimBrass"/>
</effect_group> 

 

Edit: Just to add that from the above, some calls to the buffReclaimBrass will be ignored, eg with a machine gun - can cater for this by upping the percent chance for brass.

cheers

 

I honestly don't think that's the issue - when I first discovered the bug, I extended the duration of the buff to try and get it to fire, but it didn't make any difference.

 

I have a hunch the issue is with the gameevent itself, as they seem to act oddly in MP, but I will give this a try and see if it makes a difference.

 

Appreciate the help/advice :) 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...