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

[L4D] Buggers in saferoom


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 08-11-2019 , 08:17   [L4D] Buggers in saferoom
Reply With Quote #1

Hi!

How to identify what player stands in incorrect position in the saferoom preventing round from finishing?

Sometimes it's happen when e.g. player stands on the box, so map doesn't recognize him after closing the door.

Thanks.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 08-12-2019 , 05:51   Re: [L4D] Buggers in saferoom
Reply With Quote #2

Quote:
Originally Posted by Dragokas View Post
Hi!

How to identify what player stands in incorrect position in the saferoom preventing round from finishing?

Sometimes it's happen when e.g. player stands on the box, so map doesn't recognize him after closing the door.

Thanks.
Try to change bounds of "info_changelevel"
__________________
cry
BHaType is offline
Send a message via AIM to BHaType
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-17-2020 , 10:15   Re: [L4D] Buggers in saferoom
Reply With Quote #3

Thank you.
However, it doesn't helped. Any idea why?

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

public void OnPluginStart()
{
    
RegAdminCmd("sm_b"CmdBADMFLAG_ROOT"");
}

public 
Action CmdB(int clientint args)
{
    
PrintToChat(client"is inside? %b"IsInSafeRoom(client));
    return 
Plugin_Handled;
}

public 
void OnMapStart()
{
    
ExpandSaferoom();
}

void ExpandSaferoom()
{
    
int chl;
    
chl FindEntityByClassname(-1"info_changelevel");
    if (
chl == -1)
    {
        
chl FindEntityByClassname(-1"trigger_changelevel");
        if (
chl == -1)
            return;
    }

    
float min[3], max[3];

    
GetEntPropVector(chlProp_Send"m_vecMins"min);
    
GetEntPropVector(chlProp_Send"m_vecMaxs"max);
    
    
// zone expanding by Y-axis
    
max[0] += 200.0;
    
max[1] += 200.0;
    
max[2] += 200.0;
    
    
min[0] -= 100.0;
    
min[1] -= 100.0;
    
min[2] -= 100.0;
    
    
SetEntPropVector(chlProp_Send"m_vecMins"min);
    
SetEntPropVector(chlProp_Send"m_vecMaxs"max);
    
ChangeEdictState(chl0);
}

bool IsInSafeRoom(int client)
{
    
float pos[3], min[3], max[3], me[3];
    
int chl;
    
    
chl FindEntityByClassname(-1"info_changelevel");
    if (
chl == -1)
    {
        
chl FindEntityByClassname(-1"trigger_changelevel");
        if (
chl == -1)
            return 
false;
    }
    
    
GetEntPropVector(chlProp_Send"m_vecOrigin"pos);
    
GetEntPropVector(chlProp_Send"m_vecMins"min);
    
GetEntPropVector(chlProp_Send"m_vecMaxs"max);
    
    
AddVectors(minposmin);
    
AddVectors(maxposmax);
    
    
GetEntPropVector(clientProp_Send"m_vecOrigin"me);
    
    
PrintToChat(client"me: %f %f %f"me[0], me[1], me[2]);
    
PrintToChat(client"zone min: %f %f %f"min[0], min[1], min[2]);
    
PrintToChat(client"zone max: %f %f %f"max[0], max[1], max[2]);
    
    
//TeleportEntity(client, min, NULL_VECTOR, NULL_VECTOR);
    
    
return IsDotInside(meminmax);
}

bool IsDotInside(float dot[3], float min[3], float max[3])
{
    if(    
min[0] < dot[0] < max[0] &&
        
min[1] < dot[1] < max[1] &&
        
min[2] < dot[2] < max[2]) {
        return 
true;
    }
    return 
false;

Quote:
> on the toilet:
me: -2432.692138 2.869050 178.092575
zone min: -2745.000000 -137.000000 163.000000
zone max: -2399.000000 173.000000 401.000000
is inside? 1
Quote:
> on the floor:
me: -2436.478759 2.897515 160.031250
zone min: -2745.000000 -137.000000 163.000000
zone max: -2399.000000 173.000000 401.000000
is inside? 0
Yes, these numbers looks very strange, e.g.:
"on the floor" y-axis player coord = 160, and this value is out of the "min" zone range, however trigger is correctly react on it.

And vice versa, "on the toilet" all coords looks like inside the zone, but map end trigger is not react.

And yes, I checked math calculation by teleporting players to that pos. They looks correct.

And, IsInSafeRoom() function show correct data for ALL other maps.
It's only "l4d_smalltown03_ranchhouse" map show such strange result on Y-axis.

I very like idea to expand zone to allow people finish round by standing on such places.
Hope, we can find solution.
Appreciate for help.

P.S. One walkaround to manually force end round, but it is too large hack, IMHO.
Attached Images
File Type: jpg zone - копия.jpg (80.7 KB, 152 views)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-17-2020 , 12:12   Re: [L4D] Buggers in saferoom
Reply With Quote #4

Well you can try to add an env_player_blocker entity at this places in this map as a workaround to block survivors getting into these places (not the best solution, but should work)
__________________
Marttt is offline
Reply


Thread Tools
Display Modes

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 02:23.


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