Adds a new "Ammunition crate" item to store your ammo and keep your inventory clean.
Based on the idea of DerChrom's Ammo Box, this addon adds a new item to the game : an ammunition crate. This item allows you to store your ammunition inside it, thus cleaning your inventory.
The original addon had a ton of issues, some of which were not that easy to fix. This new addon was remade from the ground up, and should be as bug free as it gets.
A note to other modders : when ammunition is put in the crate, the ID isn't kept (because the item is released and re-created later). Be careful if this is relevant for your scripts.
This addon requires the following :
• S.T.A.L.K.E.R. Anomaly 1.5.2
To install the addon :
1. Download this addon;
2. Merge the contents of the gamedata folder with your game's folder of the same name;
2.bis. Do that either with a mod manager (highly recommended) or manually (highly unrecommended).
To uninstall the addon :
1. Locate the folder ~\gamedata\scripts\;
2. Open the file ammo_crate_removal.script (with notepad);
3. Replace the line 12 with the following : local CONST_ADDON_REMOVAL = true
4. Start your game, load your save game;
5. Once the game finishes loading, save your game;
6. Close your game, and remove the files added by the addon;
7. You can now load your newly created save without the addon.
v1.2.0 - 04/03/2023 - Major Update
• Added full Mags Redux compatibility. You can now put magazines in the ammo crate;
• Updated addon removal so that it will give you back the magazines contained in the various crates.
v1.1.2 - 14/02/2023 - Hotfix
• Fixed an issue due to which the weight of the crate was incorrect after loading a save game;
• Updated addon removal so that it will give you back the ammo contained in the various crates.
v1.1.1 - 11/02/2023 - Hotfix
• Added a CTD when trader_autoinject.script is outdated;
• Added a separate icon for the crate, to avoid conflicts with icon addons (Thanks 191830221zhang);
• Fixed a CTD that sometimes occurred after closing the ammo crate (Thanks Matumba_4).
v1.1.0 - 02/02/2023 - Update
• Added the item for sale to all mechanics;
• Army soldiers can now spawn the item when killed.
v1.0.0 - 01/02/2023 - Initial Release
• Adds a new item to the game : an ammunition crate;
• You can (only) store ammunition inside it;
• The crate does not have a carrying capacity. The limit is your own carrying capacity;
• Ammunition inside the crate cannot be reloaded. You first have to pull it out of it.
• A pack of old meat might appear for a split second when using FDDA. This will probably never get fixed, as the "issue" lies on FDDA's side.
If you need help with anything, or if you have any suggestions of new items, you can :
• Leave a comment on moddb (not recommended);
• Message me on moddb (recommended);
• Message me on Discord : @nltp_ashes (recommended);
• Ask me on my Discord server.
Credits goes to these people for their work contained in this addon : • DerChrom - For the original idea; Special thanks to these people for their help in the making of this addon :
• RavenAscendant and xcvb - For implementation ideas and tips; • RavenAscendant - For providing help with mitigating a crash; • RavenAscendant - For providing help implementing Mags Redux support.
Average
9.931 votes submitted.
Great idea. Very nice work :)
Well the idea isn't mine :) All credits goes to DerChrom for that. It's just that his addon just wasn't working :/ And he never got back to it, and since I really liked the idea, I decided to remake it myself :)
Very gud :D
Very nice.
It is dangerous to store ammo in stashes, due to the possible loss of some ammo when moving from stash to inventory. This is a bug in the game engine with the incorrect combination of ammo packs. Despite the fact that the developers wrote in the changelog that they fixed it in 1.5.2, it still appears up from time to time. The most reliable storage of rounds in the magazines of the Mags Redux mod. I have already created an ammo box mod in the form of a 1000 rounds magazine with zero load / unload delay, which can be loaded with any rounds, but the magazine itself cannot be loaded into any weapon.
You are right indeed. This addon just adds a new item, but it does not fix the ammo aggregation script, which even after 1.5.2, is still broken.
I could try to look into it, to see if it can be fixed. But that'd come as a separate addon to this one.
Well, if you have experience in С++ then ...:)
I think ammo aggregation is script based, so it's coded in Lua. I'll give it a look in the upcoming weeks.
Though, if the Anomaly team said they fixed it, and turns out they didn't, the problem must be more complex than it seems, because these guys are good.
Oh, they also said they fixed the slow scrolling in the inventory, a bug that was very rare in 1.5.1, but now in version 1.5.2. it appears very often.
Theres a Mod for that. You'll need to scroll through the Discord server to find it... let me see if I can upload it.
How many days will it take to scroll? :)))
It seems that I tested that mod several years ago, it seems that it appeared for 1.5.0 and, as far as I remember, I abandoned it, because it did not fix anything. Otherwise, I would already have it.
it does for me quite alot in new version but you just gotta save and open your game again and its fixed
Well, give me a link to your mod
nice job :)
Thank :)
thanks friend now my inventory will not take 10 seconds to open
No but the crate will take 20 seconds to open :D
10/10, it would be cool to see something similar for backpack and even with fdda animation 🤩
There is such a mod on the site, though I don’t remember the name.
Yes if you read the mod description you might have a bit more context.
yes I know, Moddb.com, but it has a lot of bugs and was abandoned, sadly
Sadly I do not know how to make models/animations :/ So this will probably never see the light of day :(
don't worry, fdda already has backpack animations/models 😄
[deleted]
Maid's HD icons probably modified the vanilla icon sheet... Just ask the author if he can make a small patch for it I guess.
Your icon should be stored ideally in a new texture though with just your icon in it.
Make sure the texture is power of 2 size (128x128, 256x256 or 128x256, etc).
Yeah I'll probably do that. I just thought using a vanilla icon was fine since icon mods usually add their new icons.
when installing maid's icons did you by chance use the option called main icons or whatever? I did and I had a bunch of missing icons, you actually just choose ONE, main icons, icon override, or DLTX. choosing DLTX alone should fix the issue, choosing main effects the vanilla icon sheet which causes the issue as far as I know
Thanks for pointing that out, but as i can remember i installed maid's icons right (dltx version), and it works fine.
Actually i edited the ltxs and changed the missing icon to one of the ammo box icons in loot box mod so it looks very fine now. Still not sure which mod caused it though.
OK, cool. I had a different idea what this did but when I use it I can see it's mostly a good way to store the ammo you don't want to use that you collect, such as old ammo or rare ammo; then dump it in a stash somewhere when you get home.
For that it works great, keep your clean ammo present and put the old/rare stuff in the ammo crate for selling, converting or using in a pinch. 10/10
Well, here's how I use it personnaly. I play on a quite hard game difficulty, which makes it so I cannot afford buying ammo. So I have to keep the ammo I find on corpses, even though I don't need it right now, which in turn makes my inventory very messy. With this box, you can carry the ammo you currently use outside of the crate, and the ammo you keep to use later in the crate :)
If after using the crate immediately press any button from the MCM menu, it crashes:
FATAL ERROR
[error]Expression : <no expression>
[error]Function : CScriptEngine::lua_pcall_failed
[error]File : ..\xrServerEntities\script_engine.cpp
[error]Line : 204
[error]Description : fatal error
[error]Arguments : LUA error: ....5.2_default/bin/..\gamedata\scripts\ui_inventory.script:594: attempt to index local 'npc' (a nil value)
And I'm using оriginal ui_inventory.script.
damn i've been seeing this crash long before this mod. Hope someone can tell what was going on
I think I was able to identify the issue. I'm waiting for Matumba to let me know if my fixed helped mitigate the issue.
If you're getting this issue too, let me know, I can send you a test build that you can try out and see if it helps.
I have the same problem
I'm currently looking into this. It seems to be a conflict with Better Stats Bars.
Sorry for late reply
Your mod works fine for me and I really appreciate it. It doesn't trigger this crash on my end. I actually got this problem before your mod and it happens very rarely and randomly. It would be nice if it can be solved.
I have another question, is there a easy way to edit the files so i can put my scopes in the crates? There's a mod called toggle scope, which let you switch scopes with a hot key. if i can store unwanted scopes in crates and keep like only a acog and a kobra in inventory it would be very convenient.
I've been asked a similar question in DMs.
Yes it is *technically* doable, but I don't recommend it. When you put an item in the crate, the item is move out of your inventory.
When you close the crate, everything in it is destroyed - removed from the game, and stored in code.
Later, when you open the crate, the game reads the stored code, and re-creates the item in the crate.
This works very well, but this has one limitation : all objects in the game have an identifier, and this ID is lost when you close the crate (because like I said, the item is destroyed).
For ammo, this is fine, as no-one tracks the ID of ammo boxes. But for other game objects, this is a problem, as some quests may track the ID of a certain object, and changing the ID will break the quest. This is one example among others.
The point is, with how things are set up, it's dangerous to put other kind of items in the crate, because their ID will be lost. The ammo crate itself will keep working just fine, but it'll break other elements of the game.
Thank you for your detailed explanation :)
Could you add me on Discord, or join my server, and send me your entire log?
FATAL ERROR
[error]Expression : <no expression>
[error]Function : CScriptEngine::lua_pcall_failed
[error]File : ..\xrServerEntities\script_engine.cpp
[error]Line : 204
[error]Description : fatal error
[error]Arguments : LUA error: d:/games/anomaly\gamedata\scripts\ammo_crate_core.script:211: attempt to call field 'get_real_community' (a nil value)
One of your addons overwrote the trader_autoinject.script with an outdated version of the script.
My addon comes with an up-to-date version of the script. So either you make it so my addon is the last addon to overwrite trader_autoinject.script,or you update the file in the other addon.
I installed this mod with MO2, but I can not see the ammo box. I`m using vanilla icons. As I understand you have to buy it from a trader.
I put your mod at last place in MO2.
edit: It works now.
If you put the addon last, there's no reason it shouldn't be there.
Check technicians, I think they should all sell one.
Otherwise, you can check in debug mode, in the "Items (Tool)" category.
Hello NLTP_ASHES,
could you share some more basic info in regards to the mechanics´n such before I try this Addon out? What I would like to know is:
1) Is this Ammo-Crate wearing out from use?
2) Does the Ammo-Weight add up to the already existing Ammo-Crate?
I would like to suggest changing the Crate-Baseweight to something like at least 2,5 Kg or higher, so that aside from the prime reason of providing a clean inventory to oneself, it would come with a much more comprehensible sideeffect.
Hi :)
1. The crate does not wear out. The reason why it has a condition is so that you can click on it and see each items individually at the bottom of your screen.
2. Yes the weight adds up when you transfer ammo into it. I'm not 100% fan of the system I have in place, but so far it has always worked, and I wrote a fail safe in case for some reason it broke. So it should be good enough.
As for the weight of the crate itself, I feel 1kg is enough of a drawback. It really doesn't do anything else than keeping your inventory clean, so I don't see why it should have its weight increased to "balance" it. In my opinion, it's already pretty well balanced.
If anything, if you want the crate to be heavier, it's a simple edit to the ltx config file. The variable you need to edit is "inv_weight".
FATAL ERROR
[error]Expression : <no expression>
[error]Function : CScriptEngine::lua_pcall_failed
[error]File : ..\xrServerEntities\script_engine.cpp
[error]Line : 204
[error]Description : fatal error
[error]Arguments : LUA error: ...1.5.2/anomaly-1.5.2\gamedata\scripts\ui_inventory.script:619: attempt to index local 'npc' (a nil value)
stack trace:
it happens sometimes
Yes, as stated in "Known Issues", this is an issue with "Better Stats Bars" addon (and maybe "Looting Takes Time" too).
I cannot do anything about it, since my addon doesn't do anything wrong. It only makes the conditions for this crash to happen more frequent.
I'll skip a lot of the backend stuff of Ammo Crate, but the problem is, "Better Stats Bars" refreshes the inventory 0.01s (or more) after an item has been moved. Thing is, there is no guarantee that the inventory will still exist at that time, so this addon should make sure it does before refreshing the inventory, and the fact is : it does not.
To further prove this is on "Better Stats Bars" side, you can actually trigger this crash, without my addon. You simply create a stash with a backpack, put stuff inside of it, and select 'take all'.
I'm not 100% sure but "Looting Takes Time" could also suffer the same problem.
They fixed it in the newest version, did you told the author about it? good for you
Yep, I've looked into the issue with the original person that reported it to me, and found out it was on BSB's side.
So I reported it to its author, and he was able to find a solution :)
This doesn't work with EFPv4 because though it was fixed by Better Stats Bar, I think it is being reverted back by Simplified Vision UI used by EFP. Can you elaborate what file and code I need to fix and I'll try to patch Simplified Vision UI so it will work. I tried your mod while the Simplified Vision UI mod is disabled and it works with no crashes