AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   ROG - A better random origin generator[NO HIDDEN ZONES UPDATE] (https://forums.alliedmods.net/showthread.php?t=309495)

EFFx 07-29-2018 09:39

Re: ROG - A better random origin generator
 
Quote:

Originally Posted by edon1337 (Post 2606807)
Is there any method on making an entity slide down if the place is steepy?

I'm using movetype_toss and pev_gravity 1.0 here, and it does slide on steepy places.

Quote:

Originally Posted by edon1337 (Post 2606802)
We're already aware of the outside areas and the hill sides. I made a stock that can be used in maps where the outside area is underground (such as de_mon). As for the 'mountains' I still don't have a solution.

PHP Code:

public Float:GetValidPoint( )  
{  
    new 
Float:fPoint];  
    
fPoint] = GetLowestPoint( );  

    
fPoint] += 10.0;  
    while( ( 
engfuncEngFunc_PointContentsfPoint ) == CONTENTS_SOLID ) || ( engfuncEngFunc_PointContentsfPoint ) == CONTENTS_WATER ) )  
    {  
        
fPoint] += 1.0;  
    }  
          
    new 
pcCurrent engfuncEngFunc_PointContents fPoint );  
          
    if( 
pcCurrent == CONTENTS_EMPTY )  
    return 
fPoint];  
          
    return 
0.0;  
}  

public 
Float:GetLowestPoint( )  
{  
    new 
pcCurrent;  
    new 
Float:fStartingOffset];  
      
    while( ( 
engfuncEngFunc_PointContentsfStartingOffset ) == CONTENTS_SOLID ) || ( engfuncEngFunc_PointContentsfStartingOffset ) == CONTENTS_WATER ) || ( engfuncEngFunc_PointContentsfStartingOffset ) == CONTENTS_EMPTY ) )  
    {  
        
fStartingOffset] -= 5.0;   
    }  
      
    
pcCurrent engfuncEngFunc_PointContents fStartingOffset );   

    if( 
pcCurrent == CONTENTS_SKY )  
    return 
fStartingOffset];  
      
    return 
0.0;  


Usage
PHP Code:

new Float:fLowestPoint GetValidPoint( ); 

FYI, -350.0 is a non stuck-free origin in de_mon. ~ -420.0 is the minimum.

My check worked here, but I gotcha.

And Hamlet, I tried some checks here, but I failed too. I get back to my oldest and newbie spawn points. But i'll try to help everyone with this include, 'cos it worths.

edon1337 07-29-2018 09:42

Re: ROG - A better random origin generator
 
Quote:

Originally Posted by EFFx (Post 2606816)
I'm using movetype_toss and pev_gravity 1.0 here, and it does slide on steepy places.

Try using that on entities that you're creating and see if it slides down the hills

EFFx 07-29-2018 09:51

Re: ROG - A better random origin generator
 
It slides here, but not on the montains, it slides on literally steepy places, here as example: http://prntscr.com/kcegra
Another one: http://prntscr.com/kcegwe

edon1337 07-29-2018 10:00

Re: ROG - A better random origin generator
 
Quote:

Originally Posted by EFFx (Post 2606821)
It slides here, but not on the montains, it slides on literally steepy places, here as example: http://prntscr.com/kcegra
Another one: http://prntscr.com/kcegwe

Aren't the hills as steepy as the first picture?

EFFx 07-29-2018 10:02

Re: ROG - A better random origin generator
 
Not that much.

HamletEagle 07-29-2018 12:28

Re: ROG - A better random origin generator[UPDATED]
 
Updated: now you can add your own conditions without editing the include to filter origins. Check the main post.

zmd94 08-20-2018 05:06

Re: ROG - A better random origin generator[UPDATED]
 
Nice, HamletEagle.

JocAnis 08-20-2018 09:45

Re: ROG - A better random origin generator[UPDATED]
 
if we use it, is there a chance the origin will be generated on the box, where player cant get there? for example: https://i.imgur.com/9kFIO95.jpg

edon1337 08-20-2018 09:54

Re: ROG - A better random origin generator[UPDATED]
 
Quote:

Originally Posted by JocAnis (Post 2611302)
if we use it, is there a chance the origin will be generated on the box, where player cant get there? for example: https://i.imgur.com/9kFIO95.jpg

Unfortunately, yes.

HamletEagle 08-20-2018 10:52

Re: ROG - A better random origin generator[UPDATED]
 
Quote:

Originally Posted by JocAnis (Post 2611302)
if we use it, is there a chance the origin will be generated on the box, where player cant get there? for example: https://i.imgur.com/9kFIO95.jpg

This type of boxes are easy to filter.


All times are GMT -4. The time now is 11:11.

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