Forum

> > CS2D > Scripts > rawdamage in hit hook returns nil.
Forums overviewCS2D overview Scripts overviewLog in to reply

English rawdamage in hit hook returns nil.

3 replies
To the start Previous 1 Next To the start

old rawdamage in hit hook returns nil.

Trotskygrad
User Off Offline

Quote
So I have this problem with the hit hook.

Rawdamage returns nil whenever the mp_wpndmg of a weapon is set above 99.

1
2
3
4
addhook("hit","ops.main.hit")
function ops.main.hit(id,source,weapon,hpdmg,apdmg,rawdmg)
	msg2(source,"©255000000RAW DAMAGE:"..rawdmg.."@C")
end

this works with any mp_wpndmg up to 99, but upon setting it to 100, a LUA ERROR results "attempt to concatenate local 'rawdmg' (a nil value)"

old Re: rawdamage in hit hook returns nil.

DC
Admin Off Offline

Quote
Reason found. Will be fixed with the next release.
The actual problem is that the rawdmg parameter is simply not passed to the Lua call whenever a hit is lethal.

old Re: rawdamage in hit hook returns nil.

Trotskygrad
User Off Offline

Quote
user DC has written
Reason found. Will be fixed with the next release.
The actual problem is that the rawdmg parameter is simply not passed to the Lua call whenever a hit is lethal.


ah thanks, I was using rawdamage in an attempt to scale explosive damage properly in my script.

I had mp_wpndmg set to 1000 so I had the maximum granularity over the scale. Thanks for letting me know!
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview