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,631 guests, and 7 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
c_scan problem #440867
05/04/14 21:50
05/04/14 21:50
Joined: Feb 2010
Posts: 886
Random Offline OP
User
Random  Offline OP
User

Joined: Feb 2010
Posts: 886
The following code is in the AI action.
I the player sees the AI "seen" is set to 1, otherwise it is 0:
Code:
var seen;	c_scan(player.x,player.pan,vector(90,90,5000),SCAN_ENTS);//switch state is found player	
			if(you)
			{
				if(you.typ == 1)
				{
					if(you.typ_id == my.typ_id)
				{seen = 1;}else{seen = 0;}
				}
				else{seen = 0;}
			}
			else{seen = 0;}



If the player looks a diffrent direction, seen for some reason doesn`t change back to 0.



Re: c_scan problem [Re: Random] #440868
05/04/14 21:56
05/04/14 21:56
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You did put this in a loop, right?

Suggestion for better readability:
Code:
var seen;
seen = 0;
c_scan(player.x,player.pan,vector(90,90,5000),SCAN_ENTS);//switch state is found player
if(you)
	if(you.typ == 1 && you.typ_id == my.typ_id)
		seen = 1;



Always learn from history, to be sure you make the same mistakes again...
Re: c_scan problem [Re: Uhrwerk] #440869
05/04/14 22:10
05/04/14 22:10
Joined: Feb 2010
Posts: 886
Random Offline OP
User
Random  Offline OP
User

Joined: Feb 2010
Posts: 886
Alot better, but not properly..



Re: c_scan problem [Re: Random] #440870
05/04/14 22:16
05/04/14 22:16
Joined: Feb 2010
Posts: 886
Random Offline OP
User
Random  Offline OP
User

Joined: Feb 2010
Posts: 886
Never mind.
My Pathways in my level blocked c_scan grin




Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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