Forum

> > CS2D > General > Cs2d - weapons range in pixels for lua?
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Cs2d - weapons range in pixels for lua?

8 replies
To the start Previous 1 Next To the start

old Cs2d - weapons range in pixels for lua?

Mora
User Off Offline

Quote
Hello.
Maybe this question is more to user DC.
In documentation of weapons written distance(range) for each id.
For example for TMP/MAC10 it says:
Range: Short (100)
But i made screenshots with visisble bullets with 2 cs2ds.
Why did i?
• As you may understand range 100 in pixels in the game is just 3 tiles + 4 pixels... but y'all know that it's range is not really 3 tiles..
• i specially on screenshot made a line which says 75-76(that's the outside from border. So this value is not outside parametr(or whatever i can call it)
there is also xm and m3,
Since it's old:

for example m3's:
Range: Short (50)
50.. not even two tiles..

So how can i use these numbers with numbers in real game?

old Re: Cs2d - weapons range in pixels for lua?

Mora
User Off Offline

Quote
I asked how can i use numbers(which is written in the documentation) with numbers which i should write in lua. Bcs they not right, if we talking about pixels. And out of borders pixels.
If you read my post correctly - you'll understand the whole problem.
300 pixels for m4 is not really far.. ~9 tiles, but m4's range is really much far than that in the game. And the documentation says 300 -.-
So that's why idk how can i use these numbers for lua.

old Re: Cs2d - weapons range in pixels for lua?

DC
Admin Off Offline

Quote
What user Baloon said is very close but not 100% correct.

Imagine X is a distance value from http://www.cs2d.com/weapons.php

To get the distance in pixels you have to use this simple formula:
distanceInPixels = X * 3


Or to get the distance in tiles:
distanceInTiles = (X * 3) / 32

or
distanceInTiles = X / 10.66666


In case you need super precise values you have to note that this does NOT take the muzzle offset into account which adds a few pixels to the distance depending on the length of the weapon.
Raw Weapon Values >

offset is the muzzle offset from the center of the player in pixels which adds to the overall distance.
edited 2×, last 15.01.17 10:34:32 am

old Re: Cs2d - weapons range in pixels for lua?

Mora
User Off Offline

Quote
Thank u user DC.
I seen that's why when i hold machete - i can hit some1 or wall when there is more distance than needs to player collide the machete.
IMG:https://i.imgur.com/ThyHROP.png

/btw why do you need to use that? It's possible to write it's distance in pixels instead of do x*3?
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview