-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add export to allow external scripts to get killer data #97
Conversation
Sorry for the messy commits, I had some old code I was playing around with that was fixed by someone else's changes and I forgot to remove that old code prior to opening this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be better as an event instead?
What is the usecase for this as well? |
This is helpful for developers to be able to retrieve the killer's data for other scripts (i.e. a deathscreen that displays killer name and how they killed you). Without this export, external scripts must listen to the native CEventNetworkEntityDamage and parse it on their own, which is very inefficient since Qbox is doing this already. I think this is better as an export, rather than an event, but am definitely open to discussion if you think an event would be better. What is the benefit of using an event over an export for this? |
How would this be used? The event makes sense to me so that other scripts can listen for an onDeath event if they care to take action when the player dies. Otherwise, they will have to call the export in a loop to continuously check. |
I see where you're coming from. My scripts listen for changes to the client state bag instead of an event, so I only call the export when the state changes. I think this is good practice, but let me know if you disagree. |
Wouldn't it be more streamlined to have a named event with additional data (such as the killer data) rather than state bag listener + export? |
It would be more streamlined. I will update this tonight |
Sorry for the delay, this has been added simply as an event trigger. I do think this (and other events/exports) should be added to documentation somewhere but did not want to modify the README without approval. |
I passed the data as props to both OnDeath and StartLastStand and from there into the associated client & server events. It's all optional but is definitely very helpful. Hope that looks okay and this wasn't too much of a headache for you! |
Description
Add export to allow external scripts to get killer data
Checklist