Raised This Month: $ Target: $400
 0% 

Solved Max Z Stock


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-28-2018 , 12:57   Re: Max Z Stock
Reply With Quote #1

Quote:
Originally Posted by CrazY. View Post
It traces a invisible line and set in TR_vecEndPos the first hit origin between start and end origin or the end origin if doesn't hit anything.
So if I got it right, that trace line will return the origin of anything it hits? That wouldn't work at all, because it might hit something else than the sky.
__________________

Last edited by edon1337; 07-28-2018 at 12:59.
edon1337 is offline
Old 07-28-2018, 14:18
HamletEagle
This message has been deleted by HamletEagle. Reason: nvm
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-28-2018 , 14:19   Re: Max Z Stock
Reply With Quote #3

You could use traceline for this purpose as well, something like this:
PHP Code:
public GetMaxHeightOriginFloat:fStartOrigin] , Float:fResultOrigin] )

    new 
tlTrace Float:fDestOrigin];
    
    
fDestOrigin] = fStartOrigin];
    
fDestOrigin] = fStartOrigin];
    
fDestOrigin] = 99999.0

    
engfuncEngFunc_TraceLine fStartOrigin fDestOrigin IGNORE_MONSTERS tlTrace )
    
    
get_tr2tlTrace TR_vecEndPos fResultOrigin );
    
    
fResultOrigin] -= 150.0;

__________________
Bugsy is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 07-28-2018 , 15:35   Re: Max Z Stock
Reply With Quote #4

Quote:
Originally Posted by edon1337 View Post
So if I got it right, that trace line will return the origin of anything it hits? That wouldn't work at all, because it might hit something else than the sky.
It will hit depending on what flags you use for the traceline.

you could just filter it.

Quote:
Originally Posted by Bugsy View Post
You could use traceline for this purpose as well, something like this:
PHP Code:
fResultOrigin] -= 150.0;

Would this not be inaccurate?
__________________
Contact: Steam
Videos: Youtube

Last edited by SkumTomteN; 07-28-2018 at 15:37.
SkumTomteN is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-28-2018 , 16:32   Re: Max Z Stock
Reply With Quote #5

Quote:
Originally Posted by SkumTomteN View Post
Would this not be inaccurate?
This will vary based on the entity being moved to the result origin so the value will need to be dynamic. May need to find the Z of the ceiling of the entity and use that to determine the minus offset.
__________________
Bugsy 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 17:27.


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