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

Fixes locker breakout do-after #34870

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Plykiya
Copy link

@Plykiya Plykiya commented Feb 4, 2025

About the PR

The do-after for breaking out of lockers now cancels early if the locker is unwelded or unlocked, and the door opens as early as available.

Why / Balance

The current do-after is a bit jank, it doesn't stop even when the door was wide open.

Technical details

  • The isResisting checks kind of did nothing besides try to prevent the do-after from getting cancelled. It prevented the do-after from getting cancelled because ContainerRelayMovementEntityEvent sends an event on movement keydown and keyup, and it tried to start a new do-after at each instance. The duplicate do-after would cancel the ongoing do-after. We can achieve this by setting the doafter arg CancelDuplicate to false, preventing additional do-after attempts from cancelling our ongoing do-after.
  • AttemptFrequency was set to every tick, this causes DoAfterAttemptEvent to get raised every tick. We check whether we can early cancel the do-after every tick in the new ResistDoafterEarlyCancel() function, which cancels the do-after if the locker no longer exists (deleted from damage), or if the locker is both unwelded and unlocked. When this happens, it also attempts to open the locker immediately.
  • Most of the code updated to use the Entity<T> entity code standard.

Media

It normally takes two minutes to break out of a locker. The time was edited to five seconds for the videos.

Before the changes:

2025-02-04.09-15-30.mp4

After the changes:
Locked:

2025-02-03.19-38-47.mp4

Welded:

2025-02-03.19-39-38.mp4

Welded and locked:

2025-02-03.19-40-04.mp4

Requirements

Breaking changes

ResistLockerComponent isResisting field has been removed.
ResistLockerSystem functions changed to use the Entity<T> entity format.

Changelog

🆑

  • fix: Breaking out of lockers is now more responsive.

@github-actions github-actions bot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/S Denotes a PR that changes 10-99 lines. labels Feb 4, 2025
@Plykiya
Copy link
Author

Plykiya commented Feb 4, 2025

I plan on making a follow-up PR to this addressing the balance of the breakout timer, doing things like making it take different amounts of time to break out a locked locker, a welded locker, and a locker that's both welded and locked. Potentially also increasing the time it takes to weld lockers in general.

I was originally just trying to add a jitter and banging noise when you were trying to break out.

@ArtisticRoomba ArtisticRoomba added T: Bugfix Type: Bugs and/or bugfixes P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. D3: Low Difficulty: Some codebase knowledge required. S: Needs Review Status: Requires additional reviews before being fully accepted A: General Interactions Area: General in-game interactions that don't relate to another area. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: General Interactions Area: General in-game interactions that don't relate to another area. D3: Low Difficulty: Some codebase knowledge required. P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. S: Needs Review Status: Requires additional reviews before being fully accepted size/S Denotes a PR that changes 10-99 lines. T: Bugfix Type: Bugs and/or bugfixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants