The stand-alone mod S.T.A.L.K.E.R. Anomaly aims to be the most stable and customizable experience for fans of the S.T.A.L.K.E.R. games. It's powered by the Monolith 64-bit engine, a custom fork of the X-Ray engine.
This plugin hides the default ammo counter on the bottom right and instead lets you check the ammo in the magazine by pressing B.
good idea mate, is there any animation coming along with this?
Currently only putting the wepaon away and taking it back out, so nothign handcrafted. On most of the weapons it seemed to fit, a few aren't that good, but I dunno how create a new animation. This was just a quick project on saturday. :)
awesome, thx for your work!
Is this compatible with the *other* magazines mod, 2.5 I think it's called
Only the one linked in the requirements
amazing, i gotta try
But... It works with 3.6.1 and EXTENDED too))) Wonderful fix, man! I will recomend it to everyone
Could be, I only tested it with the latest version, but I guess Wuut won't change the functions I am using, so yeah, as long as you got any version it should work.
Nice. Really cool plagin
This is definitely a nice addon for the magazines mod, thank you!
This is GREAT! One request: Is it somehow possible to make the check ammo button just be holding the reload key?
I tried that but it seems like the engine does not support holding the button like it would be needed here.
@ Dalabak
you may use the 'autohotkey' for this; it works fine as portable so you don't even need to install it. there's a script:
Pastebin.com
that intercepts* a middle/wheel mouse button and, if it's pressed for more than 0.5 s, sends a 'b' keystroke.
save it as 'autohotkey.ahk' and place together with 'AutoHotkeyU64.exe' renamed to 'autohotkey.exe'. start the 'autohotkey.exe' with the same rigths as the game.
* unfortunately, the game does register the key being pressed but here's a workaround:
- in the game, bind the reload action to an unused key;
- in the script, edit the value of 'user_key' (line #12) replacing it with your usual reload key;
- change the value of 'game_key' (line #13) to the key assigned to reload in the first step; use lowercase if it's a letter.
This comment is currently awaiting admin approval, join now to view.
Thanks a lot, Zukuu! As a believer of magazines addon as an immersion plus, your is a very nice welcome as well!
I'm using version 1.5, with hotfix 8 and the 1.4 update, with Generic Mod Enabler, version 2.6.0.157. Your addon worked fine.
can you make this for default anomaly?? that would be an awesome alternative to the counter, magazine mod or not
Well, since it relies on the magazine data from Anomaly magazines, I cannot do it like it is now. I could however do an alternative that either gives an exact amount (like it currently is for shotguns) or something like "Around 20", "More than 5" etc., something that does not require the max ammo in a mag to calculate the percentage (no "full" / "About half")...
@ _STYX_
there you are:
Pastebin.com
copy, save as 'ammo_check.script' and replace the original.
@ author
i hope you don't mind publishing my work on your addon; if you do, delete this post please.
edit: updated to v1.1
Awesome dude, was trying all day to get that working, had a lot of crashes haha, but I think you replied to the wrong person? :)
@ Zukuu
my post was an answer to the _STYX_'s question and i replied to him.
@ _STYX_
you're welcome.
awesome man, thanks a lot
Thanks bruv!
nice work man even without animations!
very nice thanks!
Any idea on how to get it working with cyrillic letters? I tried making a Russian version for my own use, but just replacing the messages with russian ones does not work, it's all gibberish in game, like the script does not recognize anything but latin letters.
Hi, you need to change the file encoding to Windows-1251 first. You can do that in Notepad++ under Encoding - Character sets - Cyrillic. After you did that you can simply change the strings.
It worked, thanks!
Hi, why when weapon is jammed, I can see that mag "Empty" on my screen?
The new version is live now.
Hi when I press B it's crashes to desktop instantly
You got Mod from the requirements installed?
This comment is currently awaiting admin approval, join now to view.
It would be good to have this work with different magazine sizes.
Instead of
```
local defaultMagSection = wuut_mags.WeaponGetDefaulMagSection(weapon)
```
You should grab the current mag inside the weapon. That way this mod would work with mods that add extended magazines or magazines of different sizes
I got this to work by adding this function to the original wuut_mags script. I am completely unfamiliar with scripting for STALKER so you might be able to find a solution that fits in your script.
```
function GetMagSizeInWeapon(weapon)
local magData = WeaponGetMagData(weapon)
local magSection = magData[iWEP_MSEC]
-- make sure we have a valid mag string here
if(magSection ~= nil and system_ini():section_exist(magSection)) then
print_f("GetMagInWeapon " .. magSection )
local maxAmmo = system_ini():r_u32(magSection, "max_mag_size")
return maxAmmo
end
return 0
end
```
Where exactly did you add the function? You didn't modify an existing one, but looks like you took the function "function MagazineInWeaponIsValid(weapon)" as a template.
this has to be added to the original wuut_mags.script and called with wuut.GetMagSizeInWeapon(). there is some lua **** that causes state to be contained in one script so I don't know how to change it to work inside the script added by this mod
So your function adds basically the same feature, like this mod, but added to the original instead? I'd like to add it to Mags Extended then.
And your function can be defined in the wuut_mags.script without having to place it at a certain location, I suppose? Just declare it there, and call it from the main script? Or the main function loop?
I'm totally unfamiliar with Stalker scripting too. Can you send me yours so I can learn from it? Thx
Edit: Oh, and how do you use the added function ingame? There's no keypress defined, so is it working automatically?
Don't think you need to forward declare anything in lua so you can put it anywhere you want. its just a function you can call from the base script. the function by itself doesn't do anything. you have to add the logic to the script added by this mod as well.
I'm pretty sure that you just have to call the function in this mod from the main function loop at the beginning of the script - or just replace the ammo check part.
Not sure what you mean by this. My ammo_check.script looks like this:
```
local magSection = magData[wuut_mags.iWEP_MSEC]
local boxSize = wuut_mags.GetMagSizeInWeapon(weapon)
if(currentState == 0) then
if(defaultMagSectionExists) then
local currentAmmo = weapon:get_ammo_in_magazine()
--local maxAmmo = system_ini():r_u32(magSection, "max_mag_size")
local maxAmmo = boxSize
```
Hello, I am trying this out and will add it to Muh Mags Pack for trials and distribute it to Ohotnik, wuut and Zukuu respectively. Your GetMagSizeInWeapon function I will send to Ohotnik at least to make it forward compatible, and Zukuu will receive the modified ammo_check.script. Credit will go to you, thanks for that.
Wow, this is aewsome
Just wondering... is it possible to make a keybind which allows me to pull out the magazine into my inventory? would be pretty nice when i gotta reload my mag in the middle of a fight
I consider this a must have. Great if you think the ammo counter is unrealistic but don't want to run around blind.
@Zukuu, I would like to add Ammo Check to Muh Magazines as an integrated addon in a curated pack, aiming to be compatible with Muh Immersion but also workable as standalone.
I would give proper credit of course. My messages are limited as a new member, and I can't send you one today, so I write you in the comments.
Sure, go ahead! :)
Thank you!
@Zukuu: Do you consider changing the mod, that it grabs the actual magazine inside the weapon, similar to the function that machinegod420 added to original mags? It would also support different sizes of mags then, and look better.
Not planning on editing currently, no.
is it possible to port it to dead air version?
Never tried Dead air, dunno