Project Zomboid

Project Zomboid

Superb Survivors!
EREN JAGER 7 Jan, 2022 @ 10:36pm
1
A solution to the inability of the survivors to attack by another player called Septron
1.Turn off <subpar survivors> remember don't use it


2.This can be fixed by changing the following in "SuperSurvivor.lua" located in your "steamapps\workshop\content\<game id>\<mod id>\mods\Superb-Survivors\media\lua\client\2_Other" folder.

Go down to line 2316 it should look something like this:
if(self.player ~= nil) then
local distance = getDistanceBetween(self.player,victim)
local minrange = self:getMinWeaponRange() + 0.1
--print("distance was ".. tostring(distance))
if(distance < minrange) or (self.player:getPrimaryHandItem() == nil) then
--self:Speak("Shove!"..tostring(distance).."/"..tostring(minrange))
self.player:setForceShove(true);
self.player:setVariable("bShoveAiming", true);
self.player:setVariable("bDoShove", true);
self.player:setVariable("meleePressed", true);
self.player:pressedAttack();
self.player:NPCSetAttack(true);
self.player:NPCSetMelee(true);
self.player:AttemptAttack(10.0);
else
--self:Speak("Attack!"..tostring(distance).."/"..tostring(minrange))
self.player:NPCSetAttack(true);
self.player:NPCSetMelee(false);
end

end

Replace that entire block with the following:

if(self.player ~= nil) then
local distance = getDistanceBetween(self.player,victim)
local minrange = self:getMinWeaponRange() + 0.1
--print("distance was ".. tostring(distance))
local weapon = self.player:getPrimaryHandItem();

local damage = 0
if (weapon ~= nil) then
damage = weapon:getMaxDamage();
end
self.player:NPCSetAiming(true)
self.player:NPCSetAttack(true)

if(distance < minrange) or (self.player:getPrimaryHandItem() == nil) then
--self:Speak("Shove!"..tostring(distance).."/"..tostring(minrange))
victim:Hit(weapon, self.player, damage, true, 1.0, false)
else
--self:Speak("Attack!"..tostring(distance).."/"..tostring(minrange))
victim:Hit(weapon, self.player, damage, false, 1.0, false)
end

end

There is probably other issues that will occur due to the mod being outdated but this will fix most of the issues with not attacking from my experience.
< >
Showing 1-15 of 40 comments
EREN JAGER 7 Jan, 2022 @ 11:03pm 
this way can solve some problems like 'Survivors not dealing damage or attacking'
32Alpha 8 Jan, 2022 @ 5:58am 
I still have issues with hostile survivors (raiders, etc.) being invulnerable to me, though I can damage them. Is there a fix for that?
daftmau5 8 Jan, 2022 @ 6:58am 
I am gonna test this asap and if this actually works, then you're a ♥♥♥♥♥♥♥♥♥ legend

Edit: Alright, so it actually fixed the most glaring problem with the mod
For anyone wondering, the ID of PZ is 108600 and the mods ID is 1905148104
Well, at least I hope these ID's apply to everyone
Last edited by daftmau5; 8 Jan, 2022 @ 7:57am
Paladin Val 8 Jan, 2022 @ 9:03am 
How do you edit the LUA file without it getting all messed up?
32Alpha 8 Jan, 2022 @ 10:18am 
Originally posted by Val:
How do you edit the LUA file without it getting all messed up?

Text editor. Do a search for "if(self.player ~= nil) then" and then replace the section mentioned.

If you have gamebreaking results then simply unsubscribe from the mod and resubscribe and it will revert the lua files.
32Alpha 8 Jan, 2022 @ 10:19am 
Originally posted by daftmau5:
I am gonna test this asap and if this actually works, then you're a ♥♥♥♥♥♥♥♥♥ legend

Edit: Alright, so it actually fixed the most glaring problem with the mod
For anyone wondering, the ID of PZ is 108600 and the mods ID is 1905148104
Well, at least I hope these ID's apply to everyone

Have you encountered any hostile NPCs? They can finally damage me, but I still cannot damage them. I've seen others post about "invincible raiders".
Sir Shmoopy 8 Jan, 2022 @ 12:32pm 
Originally posted by 32Alpha:
Originally posted by daftmau5:
I am gonna test this asap and if this actually works, then you're a ♥♥♥♥♥♥♥♥♥ legend

Edit: Alright, so it actually fixed the most glaring problem with the mod
For anyone wondering, the ID of PZ is 108600 and the mods ID is 1905148104
Well, at least I hope these ID's apply to everyone

Have you encountered any hostile NPCs? They can finally damage me, but I still cannot damage them. I've seen others post about "invincible raiders".

Try using Subpar Survivors and replacing this same line of code "if it exists as roughly the same". That mod always fixed this issue in Superb for me.
Aura. 9 Jan, 2022 @ 2:06am 
Originally posted by WS305INCEBEAR:
this way can solve some problems like 'Survivors not dealing damage or attacking'
yea i noticed this issue as well, i hope this works for me
Originally posted by Sir Shmoopy:
Originally posted by 32Alpha:

Have you encountered any hostile NPCs? They can finally damage me, but I still cannot damage them. I've seen others post about "invincible raiders".

Try using Subpar Survivors and replacing this same line of code "if it exists as roughly the same". That mod always fixed this issue in Superb for me.
just looked into that and the line of code is on line 2657 in subpar survivors

edit: this didnt work
Last edited by senator tom cotton; 9 Jan, 2022 @ 8:13am
32Alpha 10 Jan, 2022 @ 10:52am 
Same. Unfortunately no fix for invincible raiders whether using Subpar or Superb Survivors mod.
Septron 11 Jan, 2022 @ 1:24pm 
Hello, I've fixed the issue where the cursor is disappearing and the format to make it easier.


This can be fixed by changing the following in "SuperSurvivor.lua" located in your "steamapps\workshop\content\108600\1905148104\mods\Superb-Survivors\media\lua\client\2_Other" folder.

Go down to line 2316 it should look something like this:
if(self.player ~= nil) then local distance = getDistanceBetween(self.player,victim) local minrange = self:getMinWeaponRange() + 0.1 --print("distance was ".. tostring(distance)) if(distance < minrange) or (self.player:getPrimaryHandItem() == nil) then --self:Speak("Shove!"..tostring(distance).."/"..tostring(minrange)) self.player:setForceShove(true); self.player:setVariable("bShoveAiming", true); self.player:setVariable("bDoShove", true); self.player:setVariable("meleePressed", true); self.player:pressedAttack(); self.player:NPCSetAttack(true); self.player:NPCSetMelee(true); self.player:AttemptAttack(10.0); else --self:Speak("Attack!"..tostring(distance).."/"..tostring(minrange)) self.player:NPCSetAttack(true); self.player:NPCSetMelee(false); end end

Replace that entire block with the following:

if(self.player ~= nil) then local distance = getDistanceBetween(self.player,victim) local minrange = self:getMinWeaponRange() + 0.1 --print("distance was ".. tostring(distance)) local weapon = self.player:getPrimaryHandItem(); local damage = 0 if (weapon ~= nil) then damage = weapon:getMaxDamage(); end self.player:setVariable("bAiming", true) self.player:NPCSetAttack(true) if(distance < minrange) or (self.player:getPrimaryHandItem() == nil) then --self:Speak("Shove!"..tostring(distance).."/"..tostring(minrange)) victim:Hit(weapon, self.player, damage, true, 1.0, false) else --self:Speak("Attack!"..tostring(distance).."/"..tostring(minrange)) victim:Hit(weapon, self.player, damage, false, 1.0, false) end end

As for the invincible raiders problem there is a possible solution posted here by "123~Kiss-Earnie-s-Ass":

https://steamhost.cn/steamcommunity_com/workshop/filedetails/discussion/1905148104/3057365873440652460/

Last edited by Septron; 11 Jan, 2022 @ 1:43pm
Brycecream 14 Jan, 2022 @ 7:46am 
Originally posted by Septron:
Hello, I've fixed the issue where the cursor is disappearing and the format to make it easier.


This can be fixed by changing the following in "SuperSurvivor.lua" located in your "steamapps\workshop\content\108600\1905148104\mods\Superb-Survivors\media\lua\client\2_Other" folder.

Go down to line 2316 it should look something like this:
if(self.player ~= nil) then local distance = getDistanceBetween(self.player,victim) local minrange = self:getMinWeaponRange() + 0.1 --print("distance was ".. tostring(distance)) if(distance < minrange) or (self.player:getPrimaryHandItem() == nil) then --self:Speak("Shove!"..tostring(distance).."/"..tostring(minrange)) self.player:setForceShove(true); self.player:setVariable("bShoveAiming", true); self.player:setVariable("bDoShove", true); self.player:setVariable("meleePressed", true); self.player:pressedAttack(); self.player:NPCSetAttack(true); self.player:NPCSetMelee(true); self.player:AttemptAttack(10.0); else --self:Speak("Attack!"..tostring(distance).."/"..tostring(minrange)) self.player:NPCSetAttack(true); self.player:NPCSetMelee(false); end end

Replace that entire block with the following:

if(self.player ~= nil) then local distance = getDistanceBetween(self.player,victim) local minrange = self:getMinWeaponRange() + 0.1 --print("distance was ".. tostring(distance)) local weapon = self.player:getPrimaryHandItem(); local damage = 0 if (weapon ~= nil) then damage = weapon:getMaxDamage(); end self.player:setVariable("bAiming", true) self.player:NPCSetAttack(true) if(distance < minrange) or (self.player:getPrimaryHandItem() == nil) then --self:Speak("Shove!"..tostring(distance).."/"..tostring(minrange)) victim:Hit(weapon, self.player, damage, true, 1.0, false) else --self:Speak("Attack!"..tostring(distance).."/"..tostring(minrange)) victim:Hit(weapon, self.player, damage, false, 1.0, false) end end

As for the invincible raiders problem there is a possible solution posted here by "123~Kiss-Earnie-s-Ass":

https://steamhost.cn/steamcommunity_com/workshop/filedetails/discussion/1905148104/3057365873440652460/

This fixed the cursor issue i had from the previous solution, but then NPC's went back to freezing in combat... I didn't want to mess with your code, but is there a typo in the line "self.player:setVariable("bAiming" , true)" ?
crisco0101 14 Jan, 2022 @ 10:30pm 
Is this fix working?
Does this do anything to fix npc not damaging zombies?
Last edited by crisco0101; 14 Jan, 2022 @ 10:32pm
Warbadger 16 Jan, 2022 @ 1:46pm 
Originally posted by crisco0101:
Is this fix working?
Does this do anything to fix npc not damaging zombies?
Only for melee, NPCs with firearms of any kind will still freeze up
MikeM93 17 Jan, 2022 @ 9:19am 
Someone got the NPC melee working for Subpar Survivors too. From that mod's discussion page:

Originally posted by Mister Nipples:
***This has fixed NPCs not attacking for me***
https://steamhost.cn/steamcommunity_com/workshop/filedetails/discussion/1905148104/3198118671855714410/

I made the edit in both the original Super Survivor mod as described in the link, and did the same in the Subpar Survivors mod's equivalent .lua file. I did not disable Subpar as described, I am still using both. I haven't fully tested it, but it seems to function for me as it did before the MP update.
< >
Showing 1-15 of 40 comments
Per page: 1530 50