Project Zomboid

Project Zomboid

Superb Survivors!
EREN JAGER 2022 年 1 月 7 日 下午 10:36
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.
< >
正在显示第 1 - 15 条,共 40 条留言
EREN JAGER 2022 年 1 月 7 日 下午 11:03 
this way can solve some problems like 'Survivors not dealing damage or attacking'
32Alpha 2022 年 1 月 8 日 上午 5:58 
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 2022 年 1 月 8 日 上午 6:58 
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
最后由 daftmau5 编辑于; 2022 年 1 月 8 日 上午 7:57
Templar Fry 2022 年 1 月 8 日 上午 9:03 
How do you edit the LUA file without it getting all messed up?
32Alpha 2022 年 1 月 8 日 上午 10:18 
引用自 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 2022 年 1 月 8 日 上午 10:19 
引用自 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 2022 年 1 月 8 日 下午 12:32 
引用自 32Alpha
引用自 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. 2022 年 1 月 9 日 上午 2:06 
引用自 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
MovieKnight 2022 年 1 月 9 日 上午 7:40 
引用自 Sir Shmoopy
引用自 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
最后由 MovieKnight 编辑于; 2022 年 1 月 9 日 上午 8:13
32Alpha 2022 年 1 月 10 日 上午 10:52 
Same. Unfortunately no fix for invincible raiders whether using Subpar or Superb Survivors mod.
Septron 2022 年 1 月 11 日 下午 1:24 
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://psteamcommunity.yuanyoumao.com/workshop/filedetails/discussion/1905148104/3057365873440652460/

最后由 Septron 编辑于; 2022 年 1 月 11 日 下午 1:43
Brycecream 2022 年 1 月 14 日 上午 7:46 
引用自 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://psteamcommunity.yuanyoumao.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 2022 年 1 月 14 日 下午 10:30 
Is this fix working?
Does this do anything to fix npc not damaging zombies?
最后由 crisco0101 编辑于; 2022 年 1 月 14 日 下午 10:32
Warbadger 2022 年 1 月 16 日 下午 1:46 
引用自 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 2022 年 1 月 17 日 上午 9:19 
Someone got the NPC melee working for Subpar Survivors too. From that mod's discussion page:

引用自 Mister Nipples
***This has fixed NPCs not attacking for me***
https://psteamcommunity.yuanyoumao.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.
< >
正在显示第 1 - 15 条,共 40 条留言
每页显示数: 1530 50