Skip to content
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

Update Death Counter Due To Fall Damage #158

Closed
wants to merge 2 commits into from
Closed

Update Death Counter Due To Fall Damage #158

wants to merge 2 commits into from

Conversation

ahv15
Copy link
Member

@ahv15 ahv15 commented Sep 1, 2020

Contains

"Fixes #145"
Updates the death counter every time the player dies due to fall damage.

How to test

In game give fall damage to the player until the player dies.

Outstanding before merging

  • Update the death counter due to fall damage
  • Teleport back to the base on death

Copy link
Member

@Cervator Cervator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial style fix needed, and as noted in the description the functionality isn't quite complete yet but I can confirm a "death" was counted :-)

However, I wonder if this is the right approach 🤔 Is this not merely adding a count for the deaths when the player would have died, but doesn't, as opposed to making the player actually die properly to fall damage, which would automatically involve the respawn on the flag base just as if killed by another player? And maybe even increase the death counter through that logic too.

@ahv15
Copy link
Member Author

ahv15 commented Sep 4, 2020

All I did was make sure that if the player died and was not killed by anyone there would be no null pointer exception, which before blocked the flow, but now allows for the code to continue as can be seen by restoration of health. But the problem lies in teleportation back to the base. Maybe I didnt really understand what you meant?

@Cervator
Copy link
Member

Cervator commented Sep 4, 2020

Hmm, on looking at the code more closely, you're right - I thought the death would have been handled elsewhere, and this just handled the counter. But that method seems to approximate player death without actually dying - as you say it includes the teleport step and everything, that just doesn't work for some reason.

That helps - sorry for my misunderstanding, I haven't dug deep in this part of the code lately :-)

As for why the teleport doesn't work - hmm. The flow probably still differs - usually when a player kills another player it is handled somewhere with an instigator entity to quiz for the killer's details and the damage type that finished off the victim. I don't see that on this event handler, so maybe there's another place involved when it is a player kill, which could prepare some variables that lets the teleport work? 🤔

That's me just thinking out loud more than anything, would need to look around some more, but it is nearing in on midnight here, I should probably get some sleep ... 😅

@ahv15
Copy link
Member Author

ahv15 commented Sep 4, 2020

ok sure , Just wanted to mention that when I had a look at it I noticed that a few components which had been added such as the location component , rigid body component etc ,was removed for some reason which probably should not be happening , but right when I thought I found the error the behavior started changing completely so hopefully I will be able to observe something more consistent, wont disturb your sleep anymore 😀.

@ahv15 ahv15 closed this Oct 1, 2020
@ahv15 ahv15 deleted the update-kill-counter branch October 1, 2020 19:09
@stefaniamak
Copy link
Contributor

Why was that closed? 🤔 @ahv15

@jdrueckert
Copy link
Member

I believe because of

However, I wonder if this is the right approach 🤔 Is this not merely adding a count for the deaths when the player would have died, but doesn't, as opposed to making the player actually die properly to fall damage, which would automatically involve the respawn on the flag base just as if killed by another player? And maybe even increase the death counter through that logic too.

@ahv15
Copy link
Member Author

ahv15 commented Oct 7, 2020

@stefaniamak The PR I made only updated the statistics but for some reason death due to fall damage did not trigger teleport back to the base. As I did not take a further look at it I decided to close it and open it back later if I try to fix this later on.

@ahv15
Copy link
Member Author

ahv15 commented Oct 7, 2020

I guess something is going on in some other class which prevents the teleport

@stefaniamak
Copy link
Contributor

I see, so the flag didn't teleport too. I was to suggest merging just the counter and having the issue only being at teleporting the player, but that could be really confusing to the player when seeing their score. Alright, got it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable for a player to die if not killed by another player
4 participants