Forum

> > CS2D > General > Cs2d - weapons range in pixels for lua?
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Cs2d - weapons range in pixels for lua?

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Cs2d - weapons range in pixels for lua?

Mora
User Off Offline

Zitieren
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?

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

Mora
User Off Offline

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

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

DC
Admin Off Offline

Zitieren
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.
2× editiert, zuletzt 15.01.17 10:34:32

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

Mora
User Off Offline

Zitieren
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?
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht