Jump to content

Firearm angle


Jether

Recommended Posts

So i am attempting to change how the aiming system works by the player. I was thinking you could change the angle to make the line narrow enough it would require the player to have to aim at each zombie they want. I also heard i can add -Debug to the bat file so it will display the angle each gun can shoot within but i cant seem to find which bat file that is and also am wondering if its as simple as changing the angle to get what i want.

Link to comment
Share on other sites

It's an interesting idea! I answered your .bat/debug flag question here.
 
The specific weapon property you'll be wanting to play with is MinAngle which (expressed as a decimal) appears to reflect the percentage of the character's rotation that the weapon cannot hit. For illustrative purposes, you can use the following equation to convert to the angle of the arc (in degrees) which the game will select targets within (note this is just something I came up with through observation - I haven't actually read through the game's actual implementation):

TargetAngle° = ( 1 - weapon.MinAngle ) * 360

So, for instance, the shotgun has a MinAngle of 0.75:

ShotgunTargetAngle° = ( 1 - 0.75 ) * 360 = 90

Therefore the shotgun can hit/will select targets in a 90° arc centered at the front of the character. So, to decrease the angle of the target arc, you increase the weapon's MinAngle. A MinAngle of .97 would reduce a weapon's target angle to 10.8°.

 

Two other seemingly relevant properties that may need modifying:

  • AimingPerkMinAngleModifier - this describes how MinAngle is decreased based on a character's aiming skill.
  • AngleFalloff - no clue, but sounds like it could be important given the small angles you'll be working with  :P

Ultimately, you may also need to adjust hit-chance and crit-chance properties to achieve a balanced effect.

 

Weapon properties are defined in the file ProjectZomboid/media/scripts/items.txt - though you could also adjust these properties on-the-fly with LUA. You might also want to adjust the weapon modifiers listed in ProjectZomboid/media/scripts/newitems.txt as they will likely produce some unintended results with the modified weapons.

Link to comment
Share on other sites

It's an interesting idea! I answered your .bat/debug flag question here.

 

The specific weapon property you'll be wanting to play with is MinAngle which (expressed as a decimal) appears to reflect the percentage of the character's rotation that the weapon cannot hit. For illustrative purposes, you can use the following equation to convert to the angle of the arc (in degrees) which the game will select targets within (note this is just something I came up with through observation - I haven't actually read through the game's actual implementation):

TargetAngle° = ( 1 - weapon.MinAngle ) * 360

So, for instance, the shotgun has a MinAngle of 0.75:

ShotgunTargetAngle° = ( 1 - 0.75 ) * 360 = 90

Therefore the shotgun can hit/will select targets in a 90° arc centered at the front of the character. So, to decrease the angle of the target arc, you increase the weapon's MinAngle. A MinAngle of .97 would reduce a weapon's target angle to 10.8°.

 

Two other seemingly relevant properties that may need modifying:

  • AimingPerkMinAngleModifier - this describes how MinAngle is decreased based on a character's aiming skill.
  • AngleFalloff - no clue, but sounds like it could be important given the small angles you'll be working with  :P

Ultimately, you may also need to adjust hit-chance and crit-chance properties to achieve a balanced effect.

 

Weapon properties are defined in the file ProjectZomboid/media/scripts/items.txt - though you could also adjust these properties on-the-fly with LUA. You might also want to adjust the weapon modifiers listed in ProjectZomboid/media/scripts/newitems.txt as they will likely produce some unintended results with the modified weapons.

Id be editing the guns from OrmntMans real guns mod to change the angle. And ya after you answered my other question its just a matter of fiddling with the settings when i get home. Lua so far has been pretty fun to screw with so much so i put fallout 4 on hold just to code. 

More fun then i ever had programming python at least but that wasnt for games so maybe thats it

^.^

Link to comment
Share on other sites

Ok I got the angle to what I want but since it doesn't correlate well with the mouse position it might be hard for some people to hit anything. Anyway I can keep the white lines enabled without the debug console open?

 

Edit: Seems its linedrawer Class but how can I have that enabled in my normal startup

Link to comment
Share on other sites

So everything that dictates the debug console is under project zomboid- zombie-debug and it seems the way they are scripted it needs all 4 files inside it to work and just using notepad plus doesnt let me read what the code is. Well the code is there just not translated. If anyone knows how to keep the linedrawer active id live to know. Because otherwise it isnt viable to use guns with low angles for pin point shooting outside of the debug console and you cant join servers with the debug running.

Edit Seems this is all in java not lua

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...