|
|
Re: C_scan problems
[Re: romin2011]
#355090
01/24/11 15:43
01/24/11 15:43
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
1st: trace back from the detected entity to the scanning entity to determine if there´s a wall.
2nd: Use EVENT_DETECT
no science involved
|
|
|
Re: C_scan problems
[Re: fogman]
#355094
01/24/11 15:49
01/24/11 15:49
|
Joined: Dec 2010
Posts: 87
romin2011
OP
Junior Member
|
OP
Junior Member
Joined: Dec 2010
Posts: 87
|
1st: trace back from the detected entity to the scanning entity to determine if there´s a wall.
i will be very thanksfull if u provide an example thank you.
|
|
|
Re: C_scan problems
[Re: romin2011]
#355095
01/24/11 15:58
01/24/11 15:58
|
Joined: May 2009
Posts: 5,377 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,377
Caucasus
|
I guess something like this: if(c_scan(my.x,my.pan,vector(120,0,200),IGNORE_ME|SCAN_ENTS) != 0) { if(you!=NULL) { c_trace(you.x,my.x,IGNORE_ME|USE_BOX); if(trace_hit){see_player = 0;}else{see_player = 1;} } } Not sure that this will work (I can't think properly with my sick head  ), but you can catch an idea...
|
|
|
Re: C_scan problems
[Re: romin2011]
#355098
01/24/11 16:22
01/24/11 16:22
|
Joined: May 2009
Posts: 5,377 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,377
Caucasus
|
This one works for sure! Even if it looks a bit weird (there is a better way to detect objects with C_SCAN).
result = c_scan(my.x,my.pan,vector(120,80,200),IGNORE_ME|SCAN_ENTS);
if(result > 0)
{
if(you == player)
{
vec_set(aim_target.x,you.x);
if(c_trace(my.x,aim_target.x,IGNORE_MODELS) == 0){got_target = 1;}else{got_target = 0;}
}
}
You can download an example when I tried to make auto-aiming thing for FPS. Here: Download link
|
|
|
Re: C_scan problems
[Re: romin2011]
#355103
01/24/11 16:52
01/24/11 16:52
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
Short answer - no. First use a scan, than do a trace to be on the safe side. The example of 3run should get you started.
no science involved
|
|
|
|