AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Wall ents (https://forums.alliedmods.net/showthread.php?t=13387)

v3x 05-15-2005 00:11

Wall ents
 
How do I tell if what I'm looking at is a wall?

sambro 05-15-2005 02:53

Well I don't think map walls are entities. I have a little plugin that tells you what entity you're looking at (ID, classname, etc), and it tells me i'm not pointing at an entity when I point at a wall.

HOWEVER, walls created by that plugin (I forget the name) are entities and use the classname "func_wall" I think. So you could check what the user is pointing at, and if the entity classname is "func_wall", they're looking at a man-made wall.

Also, trace_line may be what you're looking for. You specify a start and end position, and qutoing the manual:
Quote:

Returns the point hit and an entity index if an entity was hit.
. I'm interpreting this as "returns a brush/entity hit, and an entity index if an entity was, in fact, hit".

All theoratical, I'd try myself but I'm too lazy :oops:

f1del1ty.oXi 05-15-2005 02:56

I would have to say this. ---Be warned, spam---

You go up to it and ask it if it's a wall.

;)

---end spam--- (I had to do it. :P <3 v3x. )

n0obie4life 05-15-2005 03:32

Quote:

Originally Posted by f1del1ty.oXi
I would have to say this. ---Be warned, spam---

You go up to it and ask it if it's a wall.

;)

---end spam--- (I had to do it. :P <3 v3x. )

lol :D

sambro 05-15-2005 05:20

Why didn't I think of that? :shock:

xeroblood 05-15-2005 10:39

Just a guess (since I have never tried doing what you want), but maybe this function will help ya?

From engine.inc
Code:
/* Will return the contents of a point (inside map? in sky? outside map? etc.). */ native point_contents(Float:fCheckAt[3]);

Then, with the return value compare it to one of the following contents:

From engine_const.inc
Code:
#define CONTENTS_EMPTY      -1 #define CONTENTS_SOLID      -2 #define CONTENTS_WATER      -3 #define CONTENTS_SLIME      -4 #define CONTENTS_LAVA       -5 #define CONTENTS_SKY        -6 #define CONTENTS_ORIGIN     -7      /* removed at csg time */ #define CONTENTS_CLIP       -8      /* changed to contents_solid */ #define CONTENTS_CURRENT_0  -9 #define CONTENTS_CURRENT_90 -10 #define CONTENTS_CURRENT_180    -11 #define CONTENTS_CURRENT_270    -12 #define CONTENTS_CURRENT_UP -13 #define CONTENTS_CURRENT_DOWN   -14 #define CONTENTS_TRANSLUCENT    -15 #define CONTENTS_LADDER     -16

I would assume that solid walls (Brush Based walls, not "func_wall" entities) would return CONTENTS_SOLID, but I could be wrong..

Anyway, I hope that helps..

v3x 05-15-2005 14:00

Actually, now that I think about it.. I could probably just use that CONTENTS_SOLID thinger. I'll try and figure this out, lot's more questions to come now that I'm learning more about the Engine module. :)

Cheap_Suit 05-16-2005 21:11

what about touching the wall?

v3x 05-20-2005 21:49

Huh?


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

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