Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → How to get the flags of the surface you are standing on?
How to get the flags of the surface you are standing on?
2002-01-30, 6:31 AM #1
Okay, so this is for my winter war mod... *_Seifer_* told me it'd work this way, but it just randomly did what it had to...

Code:
close=9999;
for(i=0; i<GetSurfaceCount(); i=i+1)
{
 dist=VectorDist(GetSurfaceCenter(i), GetThingPos(player));
 if(dist < close)
 {
 close=dist;
 closesurf=i;
 }
}

surfflags=GetSurfaceFlags(closesurf);

if(GetThingAttachFlags(player) != 0 && act == 0 && IsThingMoving(player) != 0 && IsThingCrouching(player) != 1 && surfflags & 80000)


Right, so i wanted to know how to get the flags of the surface you're stanind on...

------------------
Life is like... skating... yeah, skating is a good example. You see someone skating and think "Hey, that looks like fun and easy!". You go and buy a skateboard and try, you get a few broken bones, asphalt-face and stuff... But hey, i'm not the one who gets hurt!
Last edited by mb; today at 10:55 AM.
2002-01-30, 11:06 AM #2
See 'where am I stepping' below

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2002-01-30, 2:58 PM #3
Dude the flags for the surface is right there .... surfflags=GetSurfaceFlags(closesurf);
2002-01-31, 7:49 AM #4
The problem with using GetSurfaceCenter() is that if you're standing next to a wall, you could be closer to the wall's center and not the floor's...
2002-01-31, 8:52 PM #5
Opps my bad .... i must of been half asleep when i wrote out that bit of code.... replace this line ....

if(dist < close && GetSurfaceFlags(i) & 0x1)

↑ Up to the top!