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

Solved L4D Nav Mesh Attributes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
3ipKa
Member
Join Date: Jul 2013
Old 08-18-2022 , 14:47   L4D Nav Mesh Attributes
Reply With Quote #1

Hello! Maybe somebody knows or can give some advice of getting attributes.
Here is list of exising attributes. It'd be interesting how to get, for example, Spawn Attributes.

Last edited by 3ipKa; 09-22-2022 at 02:24. Reason: I made it :)
3ipKa is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 08-19-2022 , 02:37   Re: L4D Nav Mesh Attributes
Reply With Quote #3

PHP Code:
"Offsets"
{
    
/* CNavArea::InheritAttributes(CNavArea *__hidden this, CNavArea *, CNavArea *) */
    
"CNavArea::InheritAttributes::m_attributeFlags"
    
{
        
"linux"      "84"
        "windows"    "84"
    
}

    
/* TerrorNavArea::SetSpawnAttributes(TerrorNavArea *__hidden this, unsigned int) */
    
"TerrorNavArea::SetSpawnAttributes::m_spawnAttributes"
    
{
        
"linux"    "300"
        "windows"    "296"
    
}

sorallll is offline
3ipKa
Member
Join Date: Jul 2013
Old 08-23-2022 , 12:59   Re: L4D Nav Mesh Attributes
Reply With Quote #4

Yeah, I know about that ) I'm searching way to do this through Sourcemod.

Quote:
Originally Posted by sorallll View Post
PHP Code:
"Offsets"
{
    
/* CNavArea::InheritAttributes(CNavArea *__hidden this, CNavArea *, CNavArea *) */
    
"CNavArea::InheritAttributes::m_attributeFlags"
    
{
        
"linux"      "84"
        "windows"    "84"
    
}

    
/* TerrorNavArea::SetSpawnAttributes(TerrorNavArea *__hidden this, unsigned int) */
    
"TerrorNavArea::SetSpawnAttributes::m_spawnAttributes"
    
{
        
"linux"    "300"
        "windows"    "296"
    
}

Thank you, sorallll ) I took your End Safearea Teleport plugin as example.

I saw VScripts has some nav functions: GetNavArea, HasSpawnAttributes... Tried it use with L4D2_GetVScriptOutput, but haven't found a way yet. Is it possible do it with VScripts through SM?
3ipKa is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 08-23-2022 , 13:37   Re: L4D Nav Mesh Attributes
Reply With Quote #5

I heard that is possible to do that with left4dhooks vscripts functions, but I was never able to make it run.
One example from left4dhooks_test

PHP Code:
char buffer[128];
Format(buffersizeof(buffer), "GetCurrentFlowPercentForPlayer(%d)"client);
if( 
L4D2_GetVScriptOutput(bufferbuffersizeof(buffer)) )
    
PrintToServer("VScript: GetCurrentFlowPercentForPlayer(%d) = %s"clientbuffer); 
__________________

Last edited by Marttt; 08-23-2022 at 13:41.
Marttt is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-23-2022 , 14:03   Re: L4D Nav Mesh Attributes
Reply With Quote #6

Quote:
Originally Posted by Marttt View Post
I heard that is possible to do that with left4dhooks vscripts functions, but I was never able to make it run.
One example from left4dhooks_test

PHP Code:
char buffer[128];
Format(buffersizeof(buffer), "GetCurrentFlowPercentForPlayer(%d)"client);
if( 
L4D2_GetVScriptOutput(bufferbuffersizeof(buffer)) )
    
PrintToServer("VScript: GetCurrentFlowPercentForPlayer(%d) = %s"clientbuffer); 
This is a VScript function I used in my mutation to check if a given non human entity is in the starting safe room:

Code:
/**
 * Checks whether or not an entity is in the starting safe room
 * 
 * @param entity     Entity to check
 * @return           true if entity is in start safe room, false otherwise.
 * @notes			 This works for the safe area on the first chapter of a campaign.
 */
function IsEntityInStartSafeRoom(entity)
{
	local origin = entity.GetOrigin();
	
	local navArea = NavMesh.GetNearestNavArea(origin, 2048, true, true);

	if(navArea != null)
	{
		// Some stupid maps like Blood Harvest finale and The Passing finale have CHECKPOINT inside a FINALE marked area.
		if(navArea.HasSpawnAttributes(64))
		{
			return false;
		}
		// https://developer.valvesoftware.com/wiki/List_of_L4D_Series_Nav_Mesh_Attributes
		else if(navArea.HasSpawnAttributes(2048) && GetFlowPercentForPosition(origin, false) <= 50.0)
		{
			return true;
		}

	}

	return false;
}
Maybe you can ask Silvers to allow making a file in addition to your plugin to declare VScript functions and then allow yourself to call them.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 08-23-2022 at 14:04.
eyal282 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 08-23-2022 , 20:10   Re: L4D Nav Mesh Attributes
Reply With Quote #7

Quote:
Originally Posted by eyal282 View Post
Maybe you can ask Silvers to allow making a file in addition to your plugin to declare VScript functions and then allow yourself to call them.
Run the "script_execute" command from the vscript?


I've added Get/Set "m_attributeFlags" and "m_spawnAttributes" natives to Left4DHooks for next update.
__________________
Silvers is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 09-21-2022 , 14:15   Re: L4D Nav Mesh Attributes
Reply With Quote #8

I'm not sure flags and attributes are same.

Here is nav flags extractor, I did vizualizer for BHaType code long time ago.

L4D1 version attached. See "flag" variable.
For L4D2 version, you can extract from [L4D2] Navigation Loot Spawner
Attached Files
File Type: zip l4d1_nav_area_visualizer.zip (9.3 KB, 110 views)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 09-22-2022 at 09:25.
Dragokas is offline
3ipKa
Member
Join Date: Jul 2013
Old 09-22-2022 , 02:23   Re: L4D Nav Mesh Attributes
Reply With Quote #9

Thanks guys! I made it, thanks for your advice, your plugins, for your responsiveness
3ipKa 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 14:21.


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