English Weapon attack speed and range

5 replies
Goto Page
To the start Previous 1 Next To the start
14.01.19 04:21:39 pm
Up
Goo
User
Offline Off
Don't really know if this fits in general or scripts so feel free to move it or smth IDK.

Hi! I'm here to ask a simple question, is it possible to modify a weapon's attack speed and or range.

That's it.
14.01.19 07:08:24 pm
Up
panteon00
User
Offline Off
in your /sys folder is the file "weapons.cfg"

there you can set the firedelay
loading...
15.01.19 04:05:17 pm
Up
Goo
User
Offline Off
Thanks, I assume there is no way to change the range though huh...
15.01.19 05:21:16 pm
Up
Bowlinghead
User
Offline Off
What about a Lua that denies every damage after x pixel travel distance?

You could see the shot though.

Here is something to play around.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--untested

wpn_range = {
[1] = 32,
[2] = 64
}

currWpn = {}
currX = {}
curr Y = {}

addhook("attack","GetWeapon")
function GetWeapon(id)
     currWpn[id] = player(id,"weapontype")
     currX[id] = player(id,"x")
     currY[id] = player(id,"y")
end

addhook("hit","Hit")
function Hit(vic,src,wpn)
     local dX = player(vic,"x") 
     dX = dX*dX
     dX = dX + (currX[src] * currX[src])

     local dY = player(vic,"y")
     dY = dY*dY
     dY = dY + (currY[src] * currY[src])

     local dRange = math.sqrt(dx+dy)
     
     if (dRange > wpn_range[wpn]) then
          return 1
     end
end
Share time limited free games here
15.01.19 07:38:03 pm
Up
Masea
Super User
Offline Off
@user Bowlinghead: That's lacking, as you're aware. But more than that, it is not even gonna work for many scenarios.

Let's just take one of the most known low-range weapons: M3 has 50 range according to http://www.cs2d.com/weapons.php?slot=-1#item10

What if I insert a value like
[10]=51
into wpn_range table? It basically won't work because the bullets of that weapon don't even go on that far. It stops at 50th pixel through the way and your hit hook doesn't come into action when the enemy is actually on the 51st pixel.

Although, your logic would work if the weapon had an unlimited (or excessive) range as default.
edited 1×, last 16.01.19 06:57:57 am
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (26)
15.01.19 08:37:35 pm
Up
Goo
User
Offline Off
Yeah that is my problem, I wanted melee weapons to have a bit of a further range.
To the start Previous 1 Next To the start