Jump to content

Calculating weapon accuracy correctly


Csimbi

Recommended Posts

Howdy,

I tried to google for setting the accuracy for a new weapon (for Aftershock).

I ended up at this post.

Unfortunately, the information in that message is incorrect.

Looking at some other values randomly I came up with a solution.

The "accuracy" means more like "effective range" - the actual accuracy is calculated by the game in run-time.

The game seems to calculate the actual accuracy this way:

in-game accuracy = accuracy / range * 100

Note that the game seems to round up the result (well, at least on the UI).

I am not a member on the forum I referenced above and I would not want to sign up to post just this message - so if there is anyone here willing to drop a PM to TrashMan regarding this, you are welcome to do so.

And, this is of course the way to calculate the accuracy You need to put in the equipment.txt file:

accuracy = in-game accuracy / 100 *range

 

Example:

...
  name STR "Laser sniper rifle"
...
	range FLT 180
	accuracy FLT 145
...

145/180*100=80.555555; this shows up in the game as 81%.

 

Edit: Added example.

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...