Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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 | 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