Quote:
Originally Posted by edon1337
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
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[ 3 ]; fPoint[ 2 ] = GetLowestPoint( );
fPoint[ 2 ] += 10.0; while( ( engfunc( EngFunc_PointContents, fPoint ) == CONTENTS_SOLID ) || ( engfunc( EngFunc_PointContents, fPoint ) == CONTENTS_WATER ) ) { fPoint[ 2 ] += 1.0; } new pcCurrent = engfunc( EngFunc_PointContents , fPoint ); if( pcCurrent == CONTENTS_EMPTY ) return fPoint[ 2 ]; return 0.0; }
public Float:GetLowestPoint( ) { new pcCurrent; new Float:fStartingOffset[ 3 ]; while( ( engfunc( EngFunc_PointContents, fStartingOffset ) == CONTENTS_SOLID ) || ( engfunc( EngFunc_PointContents, fStartingOffset ) == CONTENTS_WATER ) || ( engfunc( EngFunc_PointContents, fStartingOffset ) == CONTENTS_EMPTY ) ) { fStartingOffset[ 2 ] -= 5.0; } pcCurrent = engfunc( EngFunc_PointContents , fStartingOffset );
if( pcCurrent == CONTENTS_SKY ) return fStartingOffset[ 2 ]; 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.
__________________