Hi, i am using c_scan to search in a con for player but i encountered 2 problems. 1st c_scan goes through walls and i can't use c_trace coz c_trace can't search in a con so how to stop c_scan searching through walls? 2nd c_scan stops searching when found closest entity in it's way so how to find all entities in it's range? Thank you
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...
you don't want to use 2 slow functions at one time.... they aren't that slow also, the c_trace is only executed when an entity is found, and you can have hunderds of c_traces in a ms. also, you only use it for the player, not for many entities.
you could also run thourgh all entities manually, and compare their distance to the player. I don't know if that is faster.... I think you should go for the c_scan+c_trace combination. it can't be that bad!
and what about the second issue? I have 2 enemies standing near each other and search nearest cover position 1st enemy go to nearest cover and i set cover's flag1 on to let others it is occupied but since the 2nd enemy is using c_scan which returns the already occupied cover though i told it not to look for flag1 ents. But it dont work.