Project Zomboid

Project Zomboid

ShowAttackDistance
40 Comments
Cowk 1 Apr @ 8:27pm 
No problem bro, thanks for updating the mod, very useful
Tchernobill  [author] 1 Apr @ 8:01pm 
@Cowk Thank you for asking bro. I'd prefer not.
I just uploaded it there .
Still gg for doing it on your side.
Cowk 1 Apr @ 10:49am 
hey
Cowk 30 Mar @ 4:11pm 
To tell you the truth, I already updated it, but only for personal use, so I'm here to ask for permission.
Cowk 30 Mar @ 4:10pm 
Hey bro, can i update your mod to B42?
Goonter 23 Jan @ 9:05am 
@klaarturo I found that donating to them is a very good motivator. ;-)
Klaarturo 20 Dec, 2024 @ 5:27am 
Hopefully this mod will be updated for Build 42. Please, when possible, I would love you to update it :)
我有一个学妹 2 Nov, 2023 @ 11:48pm 
This is great news for me, a newbie.
Tchernobill  [author] 23 Aug, 2023 @ 4:12am 
@Romzes Thanx for report
Romzes 23 Aug, 2023 @ 2:17am 
Bug. The button in the context menu does not change the text when toggled.
Tchernobill  [author] 22 Aug, 2023 @ 7:44am 
version 1.4 aka Jaelee is out
shows only while aiming.
shows bare hand attack distance.
if TchernoLib is active, shows a thick circle.
Rex Renart 22 Aug, 2023 @ 5:58am 
it's become too easy, i didn't approve that.
jaelee1111 17 Jul, 2023 @ 10:41am 
@horseshoecrabdevourer14350345.4

Change the code in the file "ShowAttackDistance.lua" as follows (commented out part is the original...):

function ShowAttackDistance.useValidWeapon(playerObj)

local weaponType = WeaponType.getWeaponType(playerObj)

-- if weaponType == WeaponType.barehand or weaponType == WeaponType.handgun or weaponType == WeaponType.firearm -- this is one line

if weaponType == WeaponType.handgun or weaponType == WeaponType.firearm


function ShowAttackDistance:render()

if ShowAttackDistance.isShowAttackDistance(self.playerObj) and ShowAttackDistance.useValidWeapon(self.playerObj) then -- this is one line

local weaponItem = self.playerObj:getPrimaryHandItem();

-- Insert the following lines of code:
if not weaponItem or weaponType == WeaponType.barehand then
weaponItem = InventoryItemFactory.CreateItem("Base.BareHands")
end
jaelee1111 17 Jul, 2023 @ 10:26am 
It would be better if the circle is displayed only when the player is aiming.

It can be done simply by adding one function call in the file "ShowAttackDistance.lua":

In the function "function ShowAttackDistance:render()"

Change the first line

"if ShowAttackDistance.isShowAttackDistance(self.playerObj) and ShowAttackDistance.useValidWeapon(self.playerObj) then"...

as follows:

"if self.playerObj:isAiming() and ShowAttackDistance.isShowAttackDistance(self.playerObj) and ShowAttackDistance.useValidWeapon(self.playerObj) then"...

This is simple insertion of self.playerObj:isAiming() in the if-statement.
drunk driving compilation #42 11 Jun, 2023 @ 6:10pm 
is it possible to use this with fists/unarrmed?
Tchernobill  [author] 21 Apr, 2023 @ 11:25am 
version 1.3 is out
saves the visibility with player mod data.
adds Mod Manager icon.
Jamesrenar 31 Dec, 2022 @ 7:45am 
dosent work for me
Tchernobill  [author] 30 Dec, 2022 @ 6:47am 
@[TT]SrZunbeX thanx for report.
[TT] .xMCP 28 Dec, 2022 @ 1:33am 
i use it in steam multiplayer works fine for me and my frends @Cherri
Bunnies&Cherris 26 Dec, 2022 @ 3:07pm 
I second Seb, does this work in Multiplayer?
Captain ashbeard 2 Dec, 2022 @ 6:27pm 
distance circle has vanished mid game but displays it as visible when i right click at my feet
Enkipoumnel 1 Dec, 2022 @ 5:24am 
это мне не понадобится , но круто :GiveHug:
𝕚𝕩𝕕 𓂀 𝕓𝕩𝕚 26 Nov, 2022 @ 11:43am 
:D
Seb 9 Nov, 2022 @ 11:50am 
Does this work with Multiplayer or is it not advised?
Tchernobill  [author] 27 Oct, 2022 @ 2:12pm 
@RruinerR you can deactivate manually when changing weapon. For now that's all.
RruinerR 27 Oct, 2022 @ 2:07pm 
Is there a way (or could there be a way) to disable the melee range, but keep the range one?
Ghost 26 Oct, 2022 @ 9:02am 
Great Idea!
MonsterSauce 22 Oct, 2022 @ 1:46pm 
urm, well.. I just updated on my end, now can snipe without worries.. LOL~
MonsterSauce 22 Oct, 2022 @ 1:40pm 
well, it's a good idea, but we forget, zombies has thier own raidus too, and where it interects, it will agro, so. that sound 30, could actually be 50 or more, cause of interect.

not worth investing., unless... you pair it with: say, while aiming the sound radius shrinks, then you can see the circle shrinking, then that would be useful..

not that im hinting on anything.. :P
Tchernobill  [author] 22 Oct, 2022 @ 1:11pm 
@MonsterSauce Yeah, good idea. Maybe it could be drawn on the map & minimap.
MonsterSauce 22 Oct, 2022 @ 12:53pm 
yeah. nvm on my idea.. lol so useless. I've patch your mod to draw the sound distance of a gunshot. but at 30 tiles (.38 revolver).. it's like almost off the screen zoomed out completely. ...

[code]
local soundRay;
if weaponItem.isRanged and weaponItem:isRanged() then
soundRay = weaponItem:getSoundRadius()
local sR,sG,sB,sA = 0.8,0.4,0.4,1
self:renderIsoCircle(self.playerNum, posX, posY, posZ, soundRay, sR,sG,sB,sA)
end
[/code]
Tchernobill  [author] 22 Oct, 2022 @ 11:46am 
version 1.2 is out
Can be deactivated from right click at the feet of the character. (untick the contextual menu dedicated button to hide)
Tchernobill  [author] 22 Oct, 2022 @ 11:37am 
@Drconfused do you use the vanilla iso cursor ?
OPTIONS >> DISPLAY >> Cursor >> Aim outline (set AnyWeapon)
OPTIONS >> DISPLAY >> Cursor >> Iso cursor visibility (set it at 100% then decrease it as long at you can see it)
If you continue to loose it I do not know what can be done that would be better.
Drconfused 22 Oct, 2022 @ 11:20am 
is it possible to have the direction the character is facing to have a marker... I tend to loose where the pointer is at and it has got me killed more than anything.
Tchernobill  [author] 22 Oct, 2022 @ 9:56am 
@MonsterSauce What are you talking about mate ? What do you have in mind ?

@trashcanhands good idea
MonsterSauce 22 Oct, 2022 @ 9:28am 
please add sound of gun shot range too. i have it on my todo for the longest time.
trashcanhands 22 Oct, 2022 @ 5:59am 
Is it possible for players to turn this on/off independently?
Tchernobill  [author] 21 Oct, 2022 @ 9:17pm 
Thanx :)
Soldier :) 21 Oct, 2022 @ 12:42pm 
this is nice
Meganought 21 Oct, 2022 @ 5:25am 
well thats a really simple and useful mod, thanks