Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,619 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Again C_Scan #365388
03/26/11 10:25
03/26/11 10:25
Joined: Dec 2010
Posts: 87
R
romin2011 Offline OP
Junior Member
romin2011  Offline OP
Junior Member
R

Joined: Dec 2010
Posts: 87
Hello, I never could understand c_scan very well, Again i came across it. Please help me.
In my situation there are 3 enemies standing side by side with this action.

Code:
if(vec_dist(my.x,player.x)<500)
{
	if(c_scan(my.x, my.pan, vector(360, 60, 500), IGNORE_ME )>0)
	{
		if(you == player)
		{
			you.z+=1;
		}
		else
		{
			you.z+=3;
		}
	}
}



the 2 other enemies increases there z but It doesn't detect the player unless i go closer then the 2 enemies standing besides?
Now the problem i think is that s_scan scans the closest object which in my case is another enemy with enable scan set.
so it sets the you to enemy and returns rather then continueing the scan to find the player.
And am i right that s_scan as soon as finds closest object terminates scanning and returns the result? I don't get this s_scan at all frown

Re: Again C_Scan [Re: romin2011] #365390
03/26/11 10:31
03/26/11 10:31
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Try to use "SCAN_LIMIT" and set "ENABLE_SCAN" on player...
Sso c_scan should only scan for entites with "ENABLE_SCAN" flag set on..


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Again C_Scan [Re: 3run] #365396
03/26/11 11:06
03/26/11 11:06
Joined: Dec 2010
Posts: 87
R
romin2011 Offline OP
Junior Member
romin2011  Offline OP
Junior Member
R

Joined: Dec 2010
Posts: 87
I forgot to mention enable_scan is set to both enemies and player and i have set scan_limit flag of c_scan. Still not working

Re: Again C_Scan [Re: romin2011] #365397
03/26/11 11:10
03/26/11 11:10
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Do not set "ENABLE_SCAN" on enemies, if not necessary...
That way it will work flawlessly... But if you need "ENABLE_SCAN" on enemies:
Set FLAG2 on enemies and use "IGNORE_FLAG2" so enemies will IGNORE themselves..


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Again C_Scan [Re: 3run] #365431
03/26/11 17:12
03/26/11 17:12
Joined: Dec 2010
Posts: 87
R
romin2011 Offline OP
Junior Member
romin2011  Offline OP
Junior Member
R

Joined: Dec 2010
Posts: 87
Unfortunately certan times i need enemies to scan each other too.
Someone please?

Re: Again C_Scan [Re: romin2011] #365446
03/26/11 19:21
03/26/11 19:21
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
The only way I see, is that you'll use two c_scans, one for detecting enemies and second for player with IGNORE_FLAG2


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Again C_Scan [Re: 3run] #365464
03/26/11 23:28
03/26/11 23:28
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
maybe one c_scan with SCAN_FLAG2 and other with IGNORE_FLAG2


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB

Gamestudio download | 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