Restores bugged "overheat" feature - smoke coming from barrel will appear after some gunshots
Description
Did you know that vanilla Anomaly has overheat feature which should make gun barrel smoking after about 20 shots? Neither did I, until I spot a lot of errors in console, like this:
The reason was a bug in overheat script which calculated muzzle bone position without proper parameter. This addon fixes needed parameter so that gunsmoke feature is restored. Also changed method which stops gunsmoking to make it smoother (gunsmoke doesn't disappear instantly after barrel is cooled down)
How to install
Vanilla game (no mods)
Use Vanilla addon version. This will replace your item_weapon.script, meaning this version is not compatible with any other addon which also replaces this file
Modded game / assemblies
Use Modded Exes version. As its name states, it requires Modded Exes installed. This version is compatibility-friendly, since it doesn't change original item_weapon.script.
Updates
1/23/2024: update 2
Thanks to Tosox, the addon is now featuring better code and second version which doesn't change item_weapon.script file, meaning it should be compatible with practically anything! Though it would require Modded Exes installed
1/21/2024: update 1
Slight rework of original overheat script. Now, smoke won't stuck and gun will continue cooling down after being dropped or holstered
Also fixed gunsmoke position calculation, you can notice this change on some weapons like AK-74. Not an ideal approach, but works fine (if you are brave enough to improve it by making an engine patch which exports matrix rotation and bone direction getter functions to scripts, I left comments in the script)
Awesome.
Nice work dude 10/10!
AMAZING. Does it work with BAS and last GAMMA update?
If there is no conflict with changed file, everything should be ok
Wow! Super! Works!
This addon is excellent! Thank you very much!
Future modding legend
Superb! This was a much missed feature in CoC. So glad to see it in Anomaly👍
Does the overheat feature affect gameplay beyond the smoke - as in stopping you from firing, making the gun less accurate for a while, wearing out the barrel faster etc?
None of these, just a particle effect
This is clearly possible to make overheat affect gunplay, but in this specific addon I only wanted to fix bug of original game
Good Mod! But this seems to cause the shovel in "MORE MELEE FEATURES" to smoke (machine translation)
Checked this addon, the bug looks funny :)
To fix this, find line 872 of the script (you can find it by searching "axe") and replace it by this line:
if (string.match(tostring(wpn:section()),"knife") or string.match(tostring(wpn:section()),"axe") or string.match(tostring(wpn:section()),"mmf_shovel_mili")) then return end
conflict with WPO, is it possible to make merge patch?
Hello friend, this is a great edition, I'm really not good at understanding scripts and I always wondered what that red message in the console meant, thank you very much for fixing and improving it!
Now I have a problem, I have a mod that uses the same file, and makes when you loot a body, and you pick up old ammunition, it converts it into new ammunition when it enters the inventory. Could you tell me which lines were edited so I can patch it? and keep both editions?
Yes, me too. That is also a mod included in GAMMA, so a patch for GAMMA would be very appreciated.
Let's hope in a (positive) author reply.
Yep, it's likely this mod: Moddb.com, except it has an outdated 1.5.1 version of the script.
I would love to see a proper merge of its features into this mod while also made compatible with 1.5.2.
Thanks!
The addon is now featuring compatibility-friendly version by Tosox, check it out!
Awesome. Works with almost all my modded weapons, great job.
Thank you, it works great.
Is it possible to make change the script to make the smoke last longer or bigger?
Not sure about "bigger", but you can adjust overheat_threshold constant (less = easier to overheat gun) and decrease_quant variable (less = slower cooldown)
Thanks
Which line is the overheat_threshold constant, I am looking at the updated version 3
Just open the file and search for first occurence, you fill find where the constant is set to 100
I was wondering this too, as I made those same modifications when the addon was first posted.
Neither '\Modded Exes version\gamedata\configs\unlocalizers\unlocalizer_overheat_gunsmoke.ltx' nor '\Modded Exes version\gamedata\scripts\z_overheat_gunsmoke.script' contain a value definition for overheat_threshold (only a valueless constant in the unlocalizer and then the references in the script).
The only place overheat_threshold appears to be defined with a value is '\Vanilla version\gamedata\scripts\item_weapon.script'
As I understand how unlocalizer works, you should search for the variable value in item_weapon.script file that is in your game folder
Oh, then maybe I'm being dumb? Is it the case that I should just use the Vanilla version if I don't already have a mod that uses item_weapon.script?
If I only install the Modded Exes version then there is no item_weapon.script
If your modded game doesn't have item_weapon.script, you can install Vanilla version of the addon instead
Thank you,
I found it in the vanilla.
Since I am running GAMMA I found that
item_weapon.time_quant = rpm/100
change it to item_weapon.time_quant = rpm/10
also makes the gun easier to overheat (smoke affects).
Amazing,it's work with efp 4.2 or/and lewd guns