Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,014 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
C_SCAN help please #415560
01/20/13 13:48
01/20/13 13:48
Joined: Jan 2013
Posts: 30
R
Romin Offline OP
Newbie
Romin  Offline OP
Newbie
R

Joined: Jan 2013
Posts: 30
Hello,

I think i am stuck badly with c_scan, i need your help please.
I can't find a way to scan all the entities in a given range and turn their certain flags on if detected.
The problem with c_scan is that it always return when detected the first nearest entity and wouldn't continue scanning for others???

What is the solution for this problem please?

Re: C_SCAN help please [Re: Romin] #415561
01/20/13 13:51
01/20/13 13:51
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
you can use ent_next to go trough all entities
Code:
for(you = ent_next(NULL); you; you = ent_next(you))
{
if(vec_dist(my.x, you.x) > myDistance)
continue; // Skip unwanted entities
// DO stuff here :

set(you, FLAG1);

}



Visit my site: www.masterq32.de
Re: C_SCAN help please [Re: MasterQ32] #415565
01/20/13 14:08
01/20/13 14:08
Joined: Jan 2013
Posts: 30
R
Romin Offline OP
Newbie
Romin  Offline OP
Newbie
R

Joined: Jan 2013
Posts: 30
Originally Posted By: MasterQ32
you can use ent_next to go trough all entities
Code:
for(you = ent_next(NULL); you; you = ent_next(you))
{
if(vec_dist(my.x, you.x) > myDistance)
continue; // Skip unwanted entities
// DO stuff here :

set(you, FLAG1);

}



It is very costly if you have lots of entities in your level. specially in my case where all enemy entities would be using this function frequently.
I don't want to go through all the entities in my level to find who is in the range i am already using cpu power with c_scan.

Re: C_SCAN help please [Re: Romin] #415567
01/20/13 14:23
01/20/13 14:23
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
yeah, but c_scan uses much more code (and also loops through all entities...)


Visit my site: www.masterq32.de
Re: C_SCAN help please [Re: MasterQ32] #415576
01/20/13 15:53
01/20/13 15:53
Joined: Jan 2013
Posts: 30
R
Romin Offline OP
Newbie
Romin  Offline OP
Newbie
R

Joined: Jan 2013
Posts: 30
any other solutions please?

Re: C_SCAN help please [Re: Romin] #415578
01/20/13 16:36
01/20/13 16:36
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
c_scan probably skips most of the entities because it has access to the ABT, like c_move and c_trace do.

The solution is (like almost always) included in the manual below the instruction, you just have to use ENABLE/EVENT_SCAN and event.


"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: C_SCAN help please [Re: Superku] #415584
01/20/13 20:02
01/20/13 20:02
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
modify the function you found here.

http://www.opserver.de/ubb7/ubbthreads.p...true#Post405495

greets


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: C_SCAN help please [Re: rayp] #415653
01/21/13 21:11
01/21/13 21:11
Joined: Mar 2012
Posts: 44
A
Abarudra Offline
Newbie
Abarudra  Offline
Newbie
A

Joined: Mar 2012
Posts: 44
if you use c_scan inside an action, you can try event_detect in its event function. I think it should be the behavior you are looking for.

regards

Re: C_SCAN help please [Re: Romin] #415669
01/22/13 03:24
01/22/13 03:24
Joined: Jan 2013
Posts: 41
Redoine Offline
Newbie
Redoine  Offline
Newbie

Joined: Jan 2013
Posts: 41
sometimes my antivirus delete some compiled projects or dimos
(*.exe)files is it right !!
can we make viruses with lite c

Last edited by Redoine; 01/22/13 03:27.
Re: C_SCAN help please [Re: Redoine] #415672
01/22/13 05:25
01/22/13 05:25
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
wtf ? Who the hell writes a virus with lite-c ? How senseless

Last edited by rayp; 01/22/13 05:26.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1