1 registered members (TipmyPip),
18,449
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Scanning entities
#320315
04/20/10 20:58
04/20/10 20:58
|
Joined: Sep 2009
Posts: 1,032 Budapest
Aku_Aku
OP
Serious User
|
OP
Serious User
Joined: Sep 2009
Posts: 1,032
Budapest
|
I use c_scan function. The manual writes this: SCAN_ENTS scans for the object's origin only. If you have a large object, make sure the origin still lies within the scan cone. Is there a workaround solution to catch the entity if its origin doesn't lie within the cone? The 3D GS version is 7.80.
|
|
|
Re: Scanning entities
[Re: Aku_Aku]
#320387
04/21/10 13:43
04/21/10 13:43
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
You could simply increase the scan range and decide depending on their size how to go on. Or you write your own c_scan function:
you = ent_next(NULL); while(you) { if(vec_dist(your.x,...) < 500+your.max_x) { just do it } you = ent_next(you); }
If you need a scan cone in your own scan function, calculate the angle from the scan position to the entity and compare it to the scan direction.
Last edited by Superku; 04/21/10 13:45.
"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
|
|
|
Re: Scanning entities
[Re: Superku]
#320435
04/21/10 18:59
04/21/10 18:59
|
Joined: Sep 2009
Posts: 1,032 Budapest
Aku_Aku
OP
Serious User
|
OP
Serious User
Joined: Sep 2009
Posts: 1,032
Budapest
|
Although i studied the manual, i am afraid i don't understand how works the c_scan. For example, what does do this: mydist=c_scan(camera.x,camera.pan,vector(12,12,200),IGNORE_ME|SCAN_ENTS); I think, based on the manual this will not detect an entity if the c_scan doesn't see the object's origin. And if i increase the range, the situation will be the same, if the origin is not in the cone. Fix me, if the range is not the difference between the camera and the entity. And yes, i need a cone.
|
|
|
Re: Scanning entities
[Re: Aku_Aku]
#320469
04/21/10 20:56
04/21/10 20:56
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
I've already answered your question: You could simply increase the scan range and decide depending on their size how to go on. For example your initial scan range is 500. You now increase this value by e.g. 500 quants. Either in the entity event function or next to the c_scan instruction you check the entity's size, for instance according to its max_x value if the entity is symmetrical. If the returned distance is 777 and 777 < 500+entity.max_x is true, the entity touches the scan cone. Alternatively you could write your own function with (!) scan cone as I've posted earlier.
"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
|
|
|
Re: Scanning entities
[Re: Aku_Aku]
#320490
04/21/10 22:16
04/21/10 22:16
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Then how big is your entity?
EDIT: I think I understood your problem. The problem is not the distance but the scan width, right?
Last edited by Superku; 04/21/10 22:19.
"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
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|