Raised This Month: $51 Target: $400
 12% 

[L4D2] Fix Saferoom door +USE bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author
glhf3000
Member
Join Date: Aug 2010
Location: middle-universe
Plugin ID:
8639
Plugin Version:
1.3
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 02-17-2024 , 13:34   [L4D2] Fix Saferoom door +USE bug
    Reply With Quote #1

    Info
    Sometimes, if there are several players standing in front of a safe room door, or if weapons/medkits are scattered around, pressing "E" might not work or might interact with items instead, even if you are right in front of it, which can be incredibly frustrating. This plugin fixes the issue, making doors work as intended. It should theoretically be compatible with most door-related plugins. There is a native for unscramblers or lockers if you need to allow operation only after a certain event.
    CVARS
    l4d2_fix_safedoor_use_distance_to_open [100] - You will be able to OPEN doors from this distance
    l4d2_fix_safedoor_use_distance_to_close [115] - You will be able to CLOSE doors from this distance
    l4d2_fix_safedoor_use_wait_permission_from_ot her_plugin [0] - In case you use unscrambler or door locker, wait for it (to use native)
    Natives
    native void FixSafedoorUseEnable(true/false=enable/disable);
    Short video
    Tech
    The plugin places and saves three points on each door: left, center, and right. It monitors their coordinates when the door's position changes. If the player presses "E" near these points, it uses trace ray to ensure the player is looking at the door. In case of player_use triggered by the engine, some decisions are taken in the next frame to avoid conflicts with other plugins. Then, AcceptInput is used for opening/closing and sends a player_use event for other plugins. If the door has DOOR_FLAG_IGNORE_USE enabled, or if last door has DOOR_FLAG_STARTS_LOCKED like c10m3 church, it also won't work.
    Changelog
    Code:
    1.1/1.2 - fixed wrong door entity errors and added l4d2_fix_safedoor_use_debug cvar
    1.3 - fixed c10m3 church door; added native param "value" true/false to enable/disable for last door gameplay ideas, which is true by default if not specified
    Attached Files
    File Type: inc fix_safedoor_use.inc (550 Bytes, 12 views)
    File Type: sp Get Plugin or Get Source (l4d2_fix_safedoor_use.sp - 14 views - 13.8 KB)

    Last edited by glhf3000; 03-18-2024 at 10:44.
    glhf3000 is offline
    glhf3000
    Member
    Join Date: Aug 2010
    Location: middle-universe
    Old 02-18-2024 , 03:31   Re: [L4D2] Fix Saferoom door +USE bug
    Reply With Quote #2

    1.1:

    - fixed
    Code:
    L 02/18/2024 - 10:44:57: [SM] Exception reported: Property "m_eDoorState" not found (entity 0/worldspawn)
    L 02/18/2024 - 10:44:57: [SM] Blaming: l4d2_fix_safedoor_use.smx
    L 02/18/2024 - 10:44:57: [SM] Call stack trace:
    L 02/18/2024 - 10:44:57: [SM]   [0] GetEntProp
    L 02/18/2024 - 10:44:57: [SM]   [1] Line 216, D:\SourceMod\scripting\l4d2_fix_safedoor_use.sp::OnButtonPress
    L 02/18/2024 - 10:44:57: [SM]   [2] Line 460, D:\SourceMod\scripting\l4d2_fix_safedoor_use.sp::OnPlayerRunCmdPost
    Code:
    L 02/18/2024 - 10:40:40: [SM] Exception reported: Property "m_eDoorState" not found (entity 715/prop_physics)
    L 02/18/2024 - 10:40:40: [SM] Blaming: l4d2_fix_safedoor_use.smx
    L 02/18/2024 - 10:40:40: [SM] Call stack trace:
    L 02/18/2024 - 10:40:40: [SM]   [0] GetEntProp
    L 02/18/2024 - 10:40:40: [SM]   [1] Line 216, D:\SourceMod\scripting\l4d2_fix_safedoor_use.sp::OnButtonPress
    L 02/18/2024 - 10:40:40: [SM]   [2] Line 459, D:\SourceMod\scripting\l4d2_fix_safedoor_use.sp::OnPlayerRunCmdPost
    ...


    - added l4d2_fix_safedoor_use_debug 0/1 for future errors
    glhf3000 is offline
    glhf3000
    Member
    Join Date: Aug 2010
    Location: middle-universe
    Old 02-18-2024 , 06:16   Re: [L4D2] Fix Saferoom door +USE bug
    Reply With Quote #3

    1.2:
    - fixed more of the same errors coming from different place in the code
    glhf3000 is offline
    Gold Fish
    Senior Member
    Join Date: Mar 2020
    Old 02-18-2024 , 08:46   Re: [L4D2] Fix Saferoom door +USE bug
    Reply With Quote #4

    can't you fix the door jamming at the same time when several players are standing in front of the door and the opening is blocked? on the server, you can track the event when the door is stuck
    __________________
    -

    PHP Code:
    public OnClientConnect(int Client) {
        
    KickClient(Client"sorry");


    Last edited by Gold Fish; 02-18-2024 at 08:47.
    Gold Fish is offline
    glhf3000
    Member
    Join Date: Aug 2010
    Location: middle-universe
    Old 02-18-2024 , 10:45   Re: [L4D2] Fix Saferoom door +USE bug
    Reply With Quote #5

    Quote:
    Originally Posted by Gold Fish View Post
    can't you fix the door jamming at the same time when several players are standing in front of the door and the opening is blocked? on the server, you can track the event when the door is stuck
    like this?
    Attached Thumbnails
    Click image for larger version

Name:	Снимок экрана 2024-02-18.png
Views:	23
Size:	14.1 KB
ID:	203274  
    glhf3000 is offline
    Gold Fish
    Senior Member
    Join Date: Mar 2020
    Old 02-21-2024 , 05:04   Re: [L4D2] Fix Saferoom door +USE bug
    Reply With Quote #6

    Quote:
    Originally Posted by glhf3000 View Post
    like this?
    yes, the door remains half open and does not open for a while, this usually happens when two players (or an infected one) are between the door
    __________________
    -

    PHP Code:
    public OnClientConnect(int Client) {
        
    KickClient(Client"sorry");

    Gold Fish is offline
    glhf3000
    Member
    Join Date: Aug 2010
    Location: middle-universe
    Old 02-21-2024 , 05:31   Re: [L4D2] Fix Saferoom door +USE bug
    Reply With Quote #7

    Quote:
    Originally Posted by Gold Fish View Post
    yes, the door remains half open and does not open for a while, this usually happens when two players (or an infected one) are between the door
    The screenshot was more about what to do directly with those who are at the door. There are two options: either to push away at the moment of contact as shown in the screenshot perpendicularly, some outside, some inside, or simply to pull everyone who is in the way inside.
    glhf3000 is offline
    Gold Fish
    Senior Member
    Join Date: Mar 2020
    Old 02-21-2024 , 11:51   Re: [L4D2] Fix Saferoom door +USE bug
    Reply With Quote #8

    Quote:
    Originally Posted by glhf3000 View Post
    The screenshot was more about what to do directly with those who are at the door. There are two options: either to push away at the moment of contact as shown in the screenshot perpendicularly, some outside, some inside, or simply to pull everyone who is in the way inside.
    when people interact with the door, they most likely want to enter or exit the shelter, so in all cases I would forcibly open the door and if the door is still stuck, then after a couple of seconds make it close (while completely disabling player interaction with it so that they do not interfere with the fix of clamping the door) and so on next, until the door has a "stuck" event
    That's how I imagine it.

    I apologize for my English
    __________________
    -

    PHP Code:
    public OnClientConnect(int Client) {
        
    KickClient(Client"sorry");

    Gold Fish is offline
    glhf3000
    Member
    Join Date: Aug 2010
    Location: middle-universe
    Old 03-18-2024 , 08:03   Re: [L4D2] Fix Saferoom door +USE bug
    Reply With Quote #9

    1.3
    A) fixed c10m3 church door
    B) added native param "value" true/false to enable/disable for last door gameplay ideas, which is true by default if not specified (no need to recompile other plugins if not needed)
    C) debug cvar -> #define debug 0|1

    Last edited by glhf3000; 03-18-2024 at 08:05.
    glhf3000 is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 07:40.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode