Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
4 registered members (AndrewAMD, Ayumi, kzhao, 7th_zorro), 735 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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