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

[L4D2] check entity start or end saferoom


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProjectSky
AlliedModders Donor
Join Date: Aug 2020
Old 01-24-2022 , 09:58   [L4D2] check entity start or end saferoom
Reply With Quote #1

any better way to detect if an entity is inside the start or end saferoom?
i am use l4d2_saferoom_detect plugins, but it need extra data and poor support for addon map.
ProjectSky is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-24-2022 , 16:42   Re: [L4D2] check entity start or end saferoom
Reply With Quote #2

You may try hooking touch on info_changelevel entities, I don't know if it will work on all maps.
Maybe someone else has another method or know how to get it through detouring.
__________________
Marttt is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 01-25-2022 , 05:51   Re: [L4D2] check entity start or end saferoom
Reply With Quote #3

I know 2 ways but they have their disadvantages

Method 1

Method 2
__________________
cry

Last edited by BHaType; 01-25-2022 at 06:04.
BHaType is offline
Send a message via AIM to BHaType
sorallll
Senior Member
Join Date: Oct 2018
Old 01-25-2022 , 06:01   Re: [L4D2] check entity start or end saferoom
Reply With Quote #4

PHP Code:
TerrorNavMesh::GetInitialCheckpoint()
TerrorNavMesh::GetLastCheckpoint()
Checkpoint::ContainsArea(TerrorNavArea *)
if(
SDKCall(g_hSDKCheckpointContainsAreaSDKCall(g_hSDKGetLastCheckpointL4D_GetPointer(POINTER_NAVMESH), area)) 

Last edited by sorallll; 01-25-2022 at 06:13.
sorallll is offline
ProjectSky
AlliedModders Donor
Join Date: Aug 2020
Old 01-25-2022 , 11:48   Re: [L4D2] check entity start or end saferoom
Reply With Quote #5

I'm trying nav area thing, thx everyone help.
ProjectSky is offline
ProjectSky
AlliedModders Donor
Join Date: Aug 2020
Old 02-02-2022 , 22:19   Re: [L4D2] check entity start or end saferoom
Reply With Quote #6

why get ThisPtr address cannot be null?

PHP Code:
void IsInSaferoomArea(int entity)
{
    
float vOrigin[3];
    
GetEntPropVector(entityProp_Send"m_vecOrigin"vOrigin);
    
Address area view_as<Address>(L4D_GetNearestNavArea(vOrigin));

    
Address pLastCheckpointpInitialCheckpoint;
    
    if (
area == Address_Null) return;

    
pLastCheckpoint SDKCall(g_hGetLastCheckpointL4D_GetPointer(POINTER_NAVMESH));
    
pInitialCheckpoint SDKCall(g_hGetInitialCheckpointL4D_GetPointer(POINTER_NAVMESH));

    if (
SDKCall(g_hCheckpointContainsAreapInitialCheckpointarea))
        
PrintToChatAll("Start SafeRoom");
    else if (
SDKCall(g_hCheckpointContainsAreapLastCheckpointarea))
        
PrintToChatAll("End SafeRoom");

ProjectSky is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 02-02-2022 , 22:32   Re: [L4D2] check entity start or end saferoom
Reply With Quote #7

Quote:
Originally Posted by ProjectSky View Post
why get ThisPtr address cannot be null?

PHP Code:
void IsInSaferoomArea(int entity)
{
    
float vOrigin[3];
    
GetEntPropVector(entityProp_Send"m_vecOrigin"vOrigin);
    
Address area view_as<Address>(L4D_GetNearestNavArea(vOrigin));

    
Address pLastCheckpointpInitialCheckpoint;
    
    if (
area == Address_Null) return;

    
pLastCheckpoint SDKCall(g_hGetLastCheckpointL4D_GetPointer(POINTER_NAVMESH));
    
pInitialCheckpoint SDKCall(g_hGetInitialCheckpointL4D_GetPointer(POINTER_NAVMESH));

    if (
SDKCall(g_hCheckpointContainsAreapInitialCheckpointarea))
        
PrintToChatAll("Start SafeRoom");
    else if (
SDKCall(g_hCheckpointContainsAreapLastCheckpointarea))
        
PrintToChatAll("End SafeRoom");

pInitialCheckpoint is null in the first map, pLastCheckpoint is null in the finale map

Last edited by sorallll; 02-02-2022 at 22:33.
sorallll is offline
ProjectSky
AlliedModders Donor
Join Date: Aug 2020
Old 02-03-2022 , 05:54   Re: [L4D2] check entity start or end saferoom
Reply With Quote #8

Quote:
Originally Posted by sorallll View Post
pInitialCheckpoint is null in the first map, pLastCheckpoint is null in the finale map
cool, that explains a lot.
seem check SpawnAttributes property is a better way, other method seem less reliable, if any a better way please let me know
ProjectSky is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 02-03-2022 , 21:13   Re: [L4D2] check entity start or end saferoom
Reply With Quote #9

Quote:
Originally Posted by ProjectSky View Post
cool, that explains a lot.
seem check SpawnAttributes property is a better way, other method seem less reliable, if any a better way please let me know
check SpawnAttributes may not be as accurate as Checkpoint::ContainsArea(TerrorNavArea *) on some maps such as c6m2 and some custom maps
sorallll is offline
ReCreator
Member
Join Date: Nov 2017
Location: Ukraine,Kyiv
Old 10-10-2023 , 17:24   Re: [L4D2] check entity start or end saferoom
Reply With Quote #10

Is there any way to detect same thing in L4D1?
Tried such thing with Left 4 Dhooks stuff, but it didn't work, returns 0.
Code:
int spawnattributes = L4D_GetNavArea_AttributeFlags(L4D_GetNearestNavArea(vOrigin, 100.0, false, false, false, 2));
__________________
Sorry for my pure English...
ReCreator 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 01:14.


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