Weapon attack speed and range

5 replies
Goto Page
1
14.01.19 04:21:39 pm
Goo
User
Offline
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
panteon00
User
Offline
in your /sys folder is the file "weapons.cfg"

there you can set the firedelay
15.01.19 04:05:17 pm
Goo
User
Offline
Thanks, I assume there is no way to change the range though huh...
15.01.19 05:21:16 pm
User
Offline
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 = {}

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

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
Masea
Super User
Offline
@ 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: GUI Framework (12) | Go deep of the darkness and try your intrepidity: Outlast 2 Modification (26)
15.01.19 08:37:35 pm
Goo
User
Offline
Yeah that is my problem, I wanted melee weapons to have a bit of a further range.
1
﻿