Create an account

Remove dropping weapons from damage for 1.5.1 Final  

Upload: 20 May 2022, 18:33
Created by: Great_Day [X]
Uploaded by: Aqxaro
Remove dropping weapons from damage for 1.5.1 Final

Updated 10.04.2021 You won't drop your weapon when you take damage or punches. Neutral stalkers won't try to steal your weapon when you talk to them.


Don't let your weapon get away! With this mod, you won't let your weapon slip from your fingers and fall to the ground, even if you get shot, electrocuted, punched, or suffer any other sort of damage.

Tosser made a patch to make this mod work with Talk to Anyone: Remove Dropping Weapons + Talk To Anyone Patch

Made after the example of TimMiner's older mod, but this one works with 1.5.1 Final (the older one makes my game crash after loading). actor_effects.script was modified in a different way, which should work better (see Feel_Fried's comment below).

I have tested it, but please report any bugs or problems.

2021.04.10: Added xr_meet.script Neutral stalkers won't try to steal your weapon when you talk to them.

How to install

Manually: drop the folder in gamedata in the main Anomaly folder. However, I advise learning how to use JSGME to manage your mods.

If you want, there also is a version for use Beef's Shader Based NVGs v0.9 for 1.5.1 First install Beef's mod, then this one's version for it. There will be some overwriting, but everything works fine. (04.03.2021)

How you make this mod

This is some instruction for mod-makers, in case something in Anomaly changes and I can't make a different version, or if you want to integrate these changes in a different mod that modifies the same files, or tell me how to do it better.

In xrs_facer.script:

vanilla: local enable_drop_item = true

modded: local enable_drop_item = false . This removes dropping weapons from punches.

In actor_effects.script:

commented lines 1072-1077

--[[if (math.random() < (prev_health - actor.health)/2.5) then
local active_item = actor:active_item()
if active_item and (not opt.health.no_drop_wnp[active_item:section()]) then
actor:drop_item(active_item)
end
end--]]

by adding --[[ and --]] (thanks Feel_Fried!)

This removes dropping weapons from damage.

In xr_meet.script

vanilla:

-- Проверяем включать ли обижание на заюзывание

local abuse = xr_logic.pick_section_from_condlist(db.actor, self.npc, self.a.abuse)
if self.abuse_mode ~= abuse then
if abuse == "true" then
xr_abuse.enable_abuse(self.npc)
else
xr_abuse.disable_abuse(self.npc)
end
self.abuse_mode = abuse
end

modded:

-- Проверяем включать ли обижание на заюзывание

local abuse = xr_logic.pick_section_from_condlist(db.actor, self.npc, self.a.abuse)
if self.abuse_mode ~= abuse then
if abuse == "true" then
xr_abuse.disable_abuse(self.npc)
else
xr_abuse.disable_abuse(self.npc)
end
self.abuse_mode = abuse
end

This way, friendly and neutral stalkers won't try to punch your weapon away when you try to talk to them.

Keep in mind that new versions of the game might shift these lines around and put them into different files (the old mod for example edited txr_actor_effects.script instead of actor_effects.script).

Comments
The minimum comment length is 10 characters.