-
Notifications
You must be signed in to change notification settings - Fork 85
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
Better Ammo Boxes #1773
base: master
Are you sure you want to change the base?
Better Ammo Boxes #1773
Conversation
Should I add a convar to enable the box scaling? This feels like a minor change with no real downsides to me. I also wanted to get your opinions on a further part of this change I want to add: Removing Weapon Ammo Storage |
i assume this just removes the weird behaviour ttt does where it "rounds down" ammo?
while i think the way ammo gets stored in dropped guns is silly as well, i think it's going to be very difficult to change it in a way that keeps ttt2 compatible with most of existing weapon addons: everything from custom t weps, custom floor weps, to completely different weapon bases, idk how you're supposed to really handle that at most i think it would really only make sense for the ttt weapon base and only ones that use smg, shotgun, rifle, deagle, and pistol ammo |
yep exactly. This weird <25% rounding that has been an inconsistent mess ever since you can drop from reserve instead of only from clip.
My plan was toverify that the ammo type exists and then drop them as boxes, that would also allow for this to work for third party ammo types. Also for custom weapon bases, unless they inherit from and override tttbase without calling the baseclass as well, they should be fine. |
not sure how you'd make easy to use without adding a sort of ammo inventory ui for players maybe i guess have a radial menu that pops up when you hold the current ammo drop bind? it could easily display all your reserve ammo and you mouseover and release the key to drop some amount from it (and of course an option at the top or bottom of the radial menu to drop your current gun's clip) it could internally work as just calling a concommand with the ammo type as the arg so it'd work with potential custom ammo types also how do you handle picking up ammo for guns you don't own? i assume you'd be able to manually pick up ammo? ammo boxes also would need to drop on death as well |
Its actually super easy, you just check if the weps ammoEnt is valid, and if so create a box. If not, leave it at the current stored ammo system. Thats also how ammo dropping currently works, since many weps already don't have ammo entitites.
You cant currently have ammo from multiple different types in reserve unless you have a wep with that ammo type and I don't plan to support that (as it causes generell issues with ammo availability, weapon swape tradeoffs, etc). I was however thinking about other changes to ammo management in #1751 , but those are beyond the scope of this PR. |
oh that's much simpler than i imagined you were gonna implement it imo it'll feel a little odd to drop a bunch of ammo boxes when trying to drop a weapon, maybe keep it to 1 ammo box at most even if it'll have a ton of ammo inside you'd also need to delay their drop or offset their initial pos so they dont immediately collide with each other in the air |
yea for now its just a small little change. Bigger changes to all ammo management are on my todo in the future.
given the current rules you would at most drop 2 boxes since that's the max reserve which should be ok i think? Tons of boxes would be super weird, I agree.
true! Probably calling the default ammo drop function with a small delay. |
Ammo boxes no longer despawn after the ammo has been picked from them, and they have less than 25% capacity left. It was always possible to create boxes with less than 25% capacity since boxes check your clip size when dropping ammo but check their max size for despawning. Aka, if an SMG with a 10-round clip drops 3 ammo, that's valid, even though that's less than 25% of the 30-round SMG ammo box capacity. This should be more consistent now as there is no lower limit.
Ammo boxes are now visually scaled with ammo stored from 50-100% model scale.