tModLoader

tModLoader

Ammo Tool
60 Comments
QuestionMark  [author] 16 May @ 5:27am 
Right click the item without holding ammo
Silvia 15 May @ 3:20pm 
Can you unassign ammo?
QuestionMark  [author] 26 Apr @ 3:00pm 
Glad to hear!
Rhoenicx 26 Apr @ 1:54pm 
With the latest version (v1.0.5) it works as intended, perfect!
QuestionMark  [author] 25 Apr @ 7:19am 
I probably wasn't aware of the hook at the time of writing. Thanks for pointing that out!
Rhoenicx 24 Apr @ 7:43pm 
Addition to my comment below: Looked through the code and I see you increase stack size by 1 inside the global RightClick hook. Is there a reason ConsumeItem hook was not used?
Rhoenicx 24 Apr @ 7:37pm 
Fellow mod creator here. When I right click my weapons with ammo the stack size of the item is increased by 1 (which shouldn't happen because maxStack is 1). I have ConsumeItem hook return false. I expect this mod does some kind of countermeasure to not have the item consumed? For example +1 on the stack?
QuestionMark  [author] 1 Apr @ 1:56pm 
The mod might fail if you have any other mods affecting inventory right-click behaviour or ammo consumption mechanics. If that's the case, there's not much I can do
Mr_N 1 Apr @ 4:37am 
Not to be rude but the mod is not fucking working. I tried shit with vanilla guns and ammo but no it doesn't work. I looked everywhere to make this work but I guess my ranger calamity loadout idea is fucked.
Love you, Ace 14 Dec, 2024 @ 7:42pm 
bro said fuck no in the nicest way possible : ( )
QuestionMark  [author] 9 Dec, 2024 @ 5:05pm 
I've considered it, but this feature goes a bit beyond my vision for the mod
jetmoonlord 6 Dec, 2024 @ 6:38pm 
do you think you can you add a way for the selected ammo types to work while in a piggy bank or void vault?
radioactivefoxsiddy 2 Nov, 2024 @ 2:35pm 
sure, give me a bit though, i know it was doing it on modded weapons, mainly arsenal
QuestionMark  [author] 2 Nov, 2024 @ 9:08am 
That's interesting, I'm not able to replicate that. Do you mind sharing your mod list?
radioactivefoxsiddy 2 Nov, 2024 @ 8:42am 
alright, thats unfortunate, it appears that whenever i remove ammo from the weapon it gets rid of my rerolls as well
QuestionMark  [author] 24 Oct, 2024 @ 3:00pm 
That would take quite a bit of reorganization to get working, unfortunately, so don't count on it
radioactivefoxsiddy 21 Oct, 2024 @ 2:44pm 
able to make it so the remove ammo from weapon button is able to be put on a different keybind?

my dumbass keeps hitting it by mistake lol
Empy 3 Jul, 2024 @ 8:33am 
This needs to be in the base game
Austinsm 29 Jun, 2024 @ 3:30am 
this does not work with calamity overhaul.. mainly the reloading mechanic
Vehicular Manburger Helper 18 May, 2024 @ 9:24am 
A mod so useful it's honestly surprising it isn't a feature in vanilla.
andro951 3 May, 2024 @ 1:32pm 
QuestionMark, thanks for your help. The Ammo Bag was still incompatible with your mod, but I added some janky detours to force them to play nice when Ammo Tool is enabled. (Vacuum Bags 1.2.4.8) If anyone finds anything else incompatible with our mods, please let me know.
andro951 3 May, 2024 @ 1:30pm 
Thanks, Spicy. We were able to get it working.
Spicy 2 May, 2024 @ 5:32pm 
@andro951 love your mods! and as for the issue it happens with any ammo, I tried with musket bullets and some modded Wulfrum bullets from Calamity Ranger Expansion.
andro951 1 May, 2024 @ 1:08pm 
Looks like I lied. I didn't fix the issue.
I'll leave a discussion post with the error.

I think this may be the culprit. I suggest using TryGetGlobalItem() instead of GetGlobalItem.
public static GlobalModItem MyModItem(this Item item)
{
return item.GetGlobalItem<GlobalModItem>();
}
andro951 1 May, 2024 @ 1:00pm 
Hello, I'm the creator of Weapon Enchantments and Vacuum Bags. I just fixed a bug that between Vacuum Bags and Ammo Tool that causes the ammo bag to disappear (because I was passing non-ammo items to ItemLoader.CanChooseAmmo())

Spicy, I haven't heard of this issue before. I can't think of anything specific from Weapon Enchantments that could cause the issue you're describing. What specific weapon and ammo were you using when it duplicated the weapon?
Spicy 16 Apr, 2024 @ 12:59pm 
The bug happens with the mod "Weapon Enchantments" when trying to unequip bullets from weapons, I only had Calamity and Thorium with their submods installed.
QuestionMark  [author] 15 Apr, 2024 @ 10:46am 
Do you have any other mods that affect right-click behaviour for items while in the inventory?
Spicy 15 Apr, 2024 @ 8:18am 
I am getting the same duped weapon when removing the ammo from a weapon.
Fudgepants 22 Mar, 2024 @ 2:33am 
Was just going to come and request that too. Looking forward to the update :)
QuestionMark  [author] 14 Mar, 2024 @ 2:32pm 
Thanks for the suggestion. You can expect this for a coming version
Cirnoバカ 11 Mar, 2024 @ 7:31am 
Can you do a save function?,Every time you exit the game.,You need to re-set it when you enter it again.。 thank :)
Adolf Charles 26 Feb, 2024 @ 11:34pm 
best mod ngl
QuestionMark  [author] 7 Nov, 2023 @ 11:59am 
Was the gun added by a mod, or do you have any other mods that might affect right-click behaviour in the inventory?
Welch's Grape Ghost 7 Nov, 2023 @ 11:39am 
Attached bullets to a gun, right clicked it in my inventory and then it duplicated the gun
redandblue101 22 Sep, 2023 @ 2:20pm 
oh shift right click w empty hand

figured it out. amazing mod btw
redandblue101 22 Sep, 2023 @ 2:20pm 
how do I disable the ammo chosen and reset it back to no ammo selected?
QuestionMark  [author] 11 Sep, 2023 @ 8:05pm 
The mod has already been ported, just keep an eye on the change notes if you're unsure
Nimbus 11 Sep, 2023 @ 6:35pm 
See below comment:
Chaos 12 Jul, 2023 @ 6:11pm 
May you port it to 1.4.4?
I would appreciate that :)
QuestionMark  [author] 17 Jun, 2023 @ 4:09pm 
Unfortunately how Calamity weapons treat ammo use is beyond my control
Sir Cweepysburgh 17 Jun, 2023 @ 1:16pm 
This mod seems to act strangely with the Calamity mod's "Bullet-filled Shotgun". The weapon still prioritises the ammo in the first slot even with ammo locked to it. Tested on the "Aquashard Shotgun" from Calamity and the vanilla "Flintlock Pistol" to confirm. Both work properly.
QuestionMark  [author] 13 Jun, 2023 @ 9:55am 
That's how the mod was designed to work, since ammo is still chosen by the weapon based on vanilla's default ammo consumption order, albeit restricted to the types inside of the attached ammo list. If the list weren't cycled with the other ammo types in the inventory, it would be unchanged.

I want to keep this mod as simple and widely compatible as possible, but I understand that I might be undermining it, so if this feature is added in the future it will likely be configurable
Muniategui 13 Jun, 2023 @ 6:09am 
I do have a doubt, you can attach multiple ammos to same weapon, once the first ammo is finished it will use the next one. However as i understood the cycle would swap those 2 selected ammos to use the other one i attached. However this is incorrect, it will change the attached ammo to the weapon which does not really make sense?

I mean i attached 2 ammos i would like to cycle between those 2 not the other ones i have in the inventory.

Did i get it correct? Am i missing something?
Adolf Charles 27 Apr, 2023 @ 9:51am 
something I needed so desperately
Matt0407 27 Apr, 2023 @ 2:07am 
can you make this client side?
QuestionMark  [author] 1 Jan, 2023 @ 10:31am 
I'll look into that, thanks
Haite 1 Jan, 2023 @ 12:01am 
Not sure what happened, I've tried with Thorium, "equipping" ammo and firing does work, but it doesn't cycle through the ammos. Other than that, amazing mod for a common issue! Thanks a ton
QuestionMark  [author] 9 Nov, 2022 @ 4:46pm 
I try my best to answer any questions about the mod as soon as possible! I'm happy to hear the update works for you
garn is high 9 Nov, 2022 @ 12:11am 
I didn't realize that you responded to my question about what hooks you're using (on the same day I posted it too)...

Anyways, thanks for removing the single ammunition limit. Your mod actually works *perfectly* in tandem with mine (AlternatingAmmo) now that you're able to choose multiple ammo types. This will make calamity runs so much fun being able to specify ammo types with your mod and alternate through them with mine.

Next time I post a mod update I'll be sure to mention your mod is a good mod to use with mine. This mod is awesome great work btw.
QuestionMark  [author] 27 Oct, 2022 @ 7:34am 
It does work for modded ammo!