Forum

> > CS2D > Scripts > How does the bomb explode hook work?
Forums overviewCS2D overview Scripts overviewLog in to reply

English How does the bomb explode hook work?

4 replies
To the start Previous 1 Next To the start

old How does the bomb explode hook work?

Mami Tomoe
User Off Offline

Quote
I couldn't find enough information about it, but how does the cs2d lua hook bombexplode hook work?

The player parameter to be precise, is what I'm asking.

What happens if the player that planted the bomb leaves the game?
Will it still send their ID, or will it not call it at all? Or perhaps, it will send
0
?

Thank you.

old Re: How does the bomb explode hook work?

DC
Admin On Online

Quote
That hook is always called. Even if the bomb planter left and even if the bomb item on the map is removed (in the latter case x and y will be 0).

It looks like the player ID will still contain the ID of the player who planted the bomb. Even if that player already left / a new player joined and received the same ID.

The same value is also used for the scoring system. Therefore this special edge case can probably even lead to a bug (wrong player getting extra score for bomb planting without planting it at all).

old Re: How does the bomb explode hook work?

Mami Tomoe
User Off Offline

Quote
I see, I think that should be documented on the website.

Also, will that ever change, or should I override the game action with a Lua script of my own?


EDIT:
It appears that you get the score for planting the bomb even if the bomb doesn't end up exploding (returned 1 on the cs2d lua hook bombexplode).
edited 4×, last 23.05.21 11:24:26 pm

old Re: How does the bomb explode hook work?

DC
Admin On Online

Quote
I guess it's a bug that the score is still affected when you return 1 in the hook. Can't tell you if this will be changed/fixed some day. Probably not.

Regarding range:
See cs2d entity info_bombspot - it's in int[0]. You can use cs2d lua cmd entity to get that value.

The explosion damage value is 500 when you're exactly in the center of the explosion. The default range (when a range of 0 is specified) is 400.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview