0 registered members (),
1,094
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Ledge Hanging
[Re: Superku]
#314849
03/11/10 15:18
03/11/10 15:18
|
Joined: Oct 2009
Posts: 60
Tman
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2009
Posts: 60
|
How do you make the player detect one particular wall. I have the player detecting the walls in front of it and I labled the wall as flag2 in the code but it detects everything, even those without a flag set to it, so how could I set it to detect just the wall that I want it to detect?
action shimmy_move()
{
set(my,FLAG2);
my.CREATOR = me;
}
function move_ledge()
{
VECTOR wall_ahead[3];
while(1)
{
c_scan(my.x,my.pan,vector(360,0,750),SCAN_ENTS | SCAN_FLAG2 | IGNORE_ME);
vec_set (wall_ahead.x, vector (70, 0, -20)); // play with 70 and -20
vec_rotate (wall_ahead.x, my.pan);
vec_add (wall_ahead.x, my.x);
if (c_trace(my.x,wall_ahead.x,IGNORE_PASSABLE | SCAN_FLAG2 | SCAN_ENTS |USE_POLYGON) > 0)
draw_point3d(hit.x,vector(50,50,255),100,3);
if(HIT_TARGET)
{
draw_text("Wall Hit...",10,10,vector(50,50,255));
}
wait(1);
}
}
Here is the code that I am using to detect the walls in front of me.
|
|
|
Re: Ledge Hanging
[Re: Tman]
#314850
03/11/10 15:22
03/11/10 15:22
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Why do you use c_scan? I don't know of "SCAN_FLAG2", I'm not sure if it even exists.
if (c_trace(my.x,wall_ahead.x,IGNORE_PASSABLE | SCAN_TEXTURE |USE_POLYGON) > 0) draw_point3d(hit.x,vector(50,50,255),100,3); if(HIT_TARGET && tex_flag2) { draw_text("Wall Hit...",10,10,vector(50,50,255)); }
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
|