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
4 registered members (AndrewAMD, TipmyPip, NewbieZorro, Grant), 14,196 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
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 | 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