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

[L4D2] How to check if a position is under a ceiling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kahdeg
Junior Member
Join Date: Oct 2021
Old 09-30-2022 , 09:06   [L4D2] How to check if a position is under a ceiling
Reply With Quote #1

As tittle says, i was trying to spawn a drop box on a random position near the current player.
But if said player is inside a cave/a building, then the box spawn logic will place it somewhere on top of the building (i want to simulate the box dropping so i +1000 unit to the height).

I want to check if the box spawn position or the current player position is under a ceiling so that i wont spawn the box at all.

After searching around a bit, i find this function, but i dont know what is the data that it return.
/**
* @brief Given a vector position, returns the relative NavArea.
* @remarks This is more reliable than L4D2Direct_GetTerrorNavArea.
*
* @param vecPos The vector array to use to retrieve the NavArea
*
* @return The NavArea value, or 0 on failure probably
*/
native any L4D_GetNearestNavArea(const float vecPos[3]);
kahdeg is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 09-30-2022 , 09:35   Re: [L4D2] How to check if a position is under a ceiling
Reply With Quote #2

Maybe you need functions TR_TraceHull*()?
https://sm.alliedmods.net/new-api/sd...e/TR_TraceHull
https://sm.alliedmods.net/new-api/sd...raceHullFilter
__________________
Grey83 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 19:52.


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