-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
NPC's no longer 'stick' on some doors #46505
Conversation
Removed "DOOR" flag from several open doors that prevented NPC's from moving through them on their own.
Can player enter doors still as well ( According to the .md, the DOOR flag is what makes them openable as far as I understand)? Also remove the [ ] around bugfixes, that's what's causing the PR validator fail. |
Yes the player can still pass through them. The DOOR flag was on several open variants and NPC's were unable to pass through them. I believe they check if the door flag is present then attempt to open it. As such they were stuck in a loop. It's only been removed from those open variants. NPC's and the player can still close them. |
Oh so It's only open doors that were already open and NPCs were getting confused with? |
Yeah, the oldest issue mentioned is almost a year old now and had to do with "t_screen_door_o". A later one was "t_gate_metal_o" and I found the issue with "t_door_metal_bulkhead_o". This whole issue seems to have started 15 months ago with the addition of the screen doors and other furniture with this pull #34734. Others came later and likely copied from there for some reason. |
Nevermind issue seems to be that npcs are trying to Open open doors and can't because there already open, causing the npc to get confused and not be able to enter the door. |
They could OPEN the closed door (t_screen_door_c changes to t_screen_door_o) but then they would continue to attempt opening the now opened door. They can open doors just fine, but any open (tile id ends in an o) door with the "DOOR" flag, they would treat as closed. The only way to move an NPC through them is to stand ON the tile, swap positions with them, then push from the tile they were just on. For some reason there isn't a check to see if an NPC can stand where you're currently standing when you swap with them. When you open a door, it's actually completely changing the tile to a different one. The opened one does not need a flag to declare it as a door Edit: nevermind you got it |
Is this a problem with any other open variants of doors or just these specific doors? |
Just these 3 doors. I went through both .json files and only found these 3 with the out of place "DOOR" flag. In the future, when adding doors, the open variants shouldn't have the "DOOR" flag since it's only needed for a NPC to know to open it. As far as I can tell, the player can still interact with doors without this flag. Heres the full quote for the flag in the MD "DOOR Can be opened (used for NPC path-finding)." Keyword is opened. These doors are already open and shouldn't have this flag. Also the fact it says "(used for NPC path-finding)" implys it isn't needed for a player to open. |
No clue what caused the travis fail like everytime I attempt a PR in a project. Any clue what caused it anyone? |
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.
This could possibly have some unintended effects - |
I looked at other doors and most opened variants do not have |
This is what lead me to test it. The documentation says it's used for NPC Pathing and that's it. In testing they were still able to close them as well if told to. JSON_FLAGS.md says this for the DOOR flag. It isn't needed on closed doors and just breaks them for NPCs.
|
Looks like JSON_FLAGS.md needs to explicitly say what the flag is used for and when NOT to use it. |
Summary
SUMMARY: Bugfixes "Fixes doors that NPC's could not pass without intervention."
Purpose of change
Resolves #46124.
Resolves #44294.
Resolves #37207.
Changes issues with #46472.
NPC's getting stuck on various doors and gates can be annoying, at best, suicidal for them at worst. In some cases like the Freshwater Research Station. They're completely unable to traverse it on their own and either need the doors to be removed, or for you to swap positions with one while standing on the door to get them through.
Describe the solution
Removed the "DOOR" flag from several doors/gates. NPCs seem to get stuck attempting to open already open doors that have this flag. Removing it fixes it.
Describe alternatives you've considered
Not fixing the bug.
Testing
Added the "DOOR" flag to several open doors and attempted to bring NPC's through. They got stuck. Removed it and they're able to pass through just fine. Did so with doors in question and they can now pass through without issue.
Additional context
During review, the "DOOR" flag should be removed from any open variants. It isn't needed for an NPC to recognize the terrain as a door that can be closed.