-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WAIT] Remove ammo_modifier #31813
[WAIT] Remove ammo_modifier #31813
Conversation
Er, I actually just used this today to create something, how is changing an item from one form of ammo to another supposed to be accomplished if not with ammo_modifier? |
Adding a |
Ahh.. I see. I was actually using that mod as a reference, but magazine_adaptor wasn't explained in the docs and I saw ammo_modifier there and used that instead because it was. |
Yeah it doesn't look like whoever added this magazine_adaptor stuff documented it. Not your fault. I had to go digging through git history to figure out what happened here. |
Well maybe I'm doing something wrong, but when I just have that in there it seems to be indicating that there are no "compatible ammo types", I'm trying to change from firing 9mm bullets to not firing bullets at all, it's not just a matter of magazines. |
Specifically, I was making a magazine adaptor to convert from firing bullets, 9mm in this case, to firing "mana" bolts, for the Magiclysm mod. I can of course just make a recipe for each and every gun that someone might come across to do that, and convert the whole gun over permanently, but a converting the ammo seemed a lot simpler in that I could just do one for each type or round at most. |
I'm not super on the up and up on how the magiclysm stuff specifically works but it looks like you want your gunmod to have accept "acceptable_ammo": [ "crystallized_mana" ] and have "magazine_adaptor": [ [ "crystallized_mana", [ "small_mana_crystal" ] ] ] @KorGgenT does this sound right? |
That's exactly what I did and got that error. This seems to just allow the use of specified magazines of the same ammo type, as the name implies, and that there is now no way of changing actual ammo types. |
In fact, if I take that "acceptable_ammo" filter out, it will install on the glock 17, so that error arises from acceptable_ammo not (or possibly and) magazine_adaptor, but the gun is still demanding 9mm ammo loaded from a magazine that can't hold 9mm ammo, when I include the ammo_modifier it worked just fine and fired mana. If there's some other way to accomplish this I don't know what it is. |
I'll play with it some more and see if I can figure out more clearly what's happening. Maintainers please wait on merging this for the moment. |
sorry, i'm not super familiar with guns, and in fact try to avoid json if i can help it. |
'mana' is basically no different than having 'battery' there, it has no real "ammo" characteristics in and of itself assigned by default as it's a power source, not a projectile, but still ammo as the game sees it. I faked the whole thing by using damage_modifier & range_modifier up to 9mm levels. |
There's some goofy stuff going on with magazine_adaptor and this series apparently broke some tests so this is going to take more work than I hoped. It still seems like I can safely remove ammo_modifier but I have no intention of breaking modability if this is actually enabling that somehow. It might help if you post a sample of one of your gunmods so I can use it just as a reference to see exactly what you're trying to do. |
Thankfully I only started on it this afternoon, and came up with this one mod after toying around with various settings. It worked as intended as long as ammo_modifier was in there, without it, the gun still expects 9mm ammo but no magazines can feed it that anymore. { |
It's not a huge deal to me if you go ahead and break this, I can do something else or just make up full conversion recipes for individual guns, or any other number of things, though I would obviously like that functionality documented and working at some point, the mod was intended as a more portable quick-fix to converting guns and I only tried it after noticing the lw adaptor. |
After some review it seems like we actually do need |
Summary
SUMMARY: Infrastructure "Remove ammo_modifier"
Purpose of change
#23078 basically made
ammo_modifier
obsolete but didn't actually remove the code using it.#31766 fixed UPS mods to not need ammo_modifier
#31800 removed the
ammo_modifier
from UPS mod because it causes segfault. After #23078 nothing should be using ammo_modifier anymore. The code is very apparently broken and not needed.Describe the solution
Remove code references to
ammo_modifier
and remove it from all json entries. Essentially all json entries with this are already obsolete (except one which is moved to obsolete with this patch), but this removes the field from the item definitions.There's a bunch of functions that had a
conversion
parameter just for checking forammo_modifier
. Removing that enables removing the parameter from all of those functions.This also moves the 'flare gun caliber mod' to obsolete since it appears it should have been included in #23078.