Gamestudio Links
Zorro Links
Newest Posts
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, exile), 1,636 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
path_scan, not working! #358425
02/11/11 09:17
02/11/11 09:17
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
hi,

can i ask why does path_scan is not working in my characters AI? I want him to follow a path and then starts to chase the player whenever he sees it or got close to him. I read it from the forum but it seems like that it doesn't work in my script. pls help me. here's the part of the script:
Code:
my.state = 0; // waiting for player
	while(players_health > 0 && players_life > 0)
	{
		if(my.state == 0)
		{
			result = path_scan(me, my.x, my.pan, vector(90, 80, 400)); 
			if (result) {movement_enabled = 1;}
			path_getnode (my, 1, pos_node, NULL);
			vec_to_angle (my.pan, vec_diff (temp_angle, pos_node, my.x));
			ent_animate(my,"frame",my.skill60,ANM_CYCLE);
			my.skill60 += 10 * time_step;//	my.skill60 += 20 * time_step;
			vec_set(zdist.x,nullvector);
		        vec_set(zabsdist.x,nullvector);
			
			while(1)
			{
				if ((c_scan(my.x, my.pan, vector(120, 90, 1000), IGNORE_ME) > 0) && (you == player))
				{	
				  my.state = 1; 
				  break;
				}
				dist_to_node = vec_dist(my.x, pos_node);
				if(dist_to_node < 10)
				{
					current_node = path_nextnode(my, current_node, 1);
					if (!current_node) {current_node = 1;} 
					path_getnode (my, current_node, pos_node, NULL);
				}
				wait(1);
			}

		}



Re: AI needs to check the vec_dist before going to another state [Re: carla_mariz] #358650
02/12/11 16:21
02/12/11 16:21
Joined: Feb 2011
Posts: 1
P
pica Offline
Guest
pica  Offline
Guest
P

Joined: Feb 2011
Posts: 1
how will i do that???do u have any script for AI, that checks first if the distance of the player is less than 200 quants??? before going to another state???


Moderated by  HeelX, Spirit 

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