noxworld-dev / opennox

OpenNox main repository.
GNU General Public License v3.0
446 stars 24 forks source link

Hook onto PlayerDeath() #627

Open Ephreaym opened 11 months ago

Ephreaym commented 11 months ago

A function to hook onto a PlayerDeath would be most welcome.

dennwc commented 9 months ago

I recently refactored how we extend the game objects. Now we can put a lot more data into any object, including the new custom hooks.

The plan is to expose two new functions for this ticket:

// Global callback that cares only about players
ns4.OnPlayerDeath(func(p ns4.Player) {...})
// Per-object callback:
obj.OnDeath(func(){...})

Anything else that I need to consider here?

Ephreaym commented 9 months ago

Not that I can think of right now. Been busy with my work and end of year assignments, so haven’t been working on the bot project as much.

I can get back to it around December.

dennwc commented 9 months ago

No worries, same on my side regarding the lack of time. Now getting a bit more of it, so starting slowing picking up stuff again.