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

Make players maintain relative velocity when teleporting #291

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GooberRF
Copy link
Contributor

This PR adjusts the behaviour of the Teleport_Player event such that relative velocity is maintained when teleporting. This means that when you go into a teleporter, you come out of the teleporter going the same speed, regardless of the direction of the teleport destination relative to the teleport entrance.

Functionally this vastly improves the experience when teleporting - you no longer run into a teleporter and come out flying sideways or something.

Resolves #19

This PR also makes two other much more minor adjustments which I'll note just for the record:

  • Attempts to put the player on the ground when they teleport if they were on the ground before. The base game already did this but it was turned off for multiplayer clients before this PR. Should in theory make some teleports in multiplayer a bit smoother.
  • Makes the hackfix Volition implemented in L20S2.rfl (which teleports your vehicle instead of dumping you out of the vehicle like is normally the case) more specific - base game only checked the level filename when deciding whether to apply the hackfix, after this PR it also checks the event UID. This is very, very minor, but it is safer to do it this way just to avoid any potential unexpected behaviour in mods that modify this level.

@GooberRF GooberRF marked this pull request as draft November 23, 2024 19:07
@GooberRF
Copy link
Contributor Author

Withdrawing for now, this PR has a bug that I discovered, still not sure of the cause. Nevertheless, it's also not made properly. I plan to redo it using CodeInjection to only handle the relatively velocity, rather than rewriting the function entirely.

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.

Maintain directional velocity through teleporters
1 participant