PutraenusAlivius 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 4,713 
	Threads: 75 
	Joined: Dec 2012
	
 Reputation: 
119
		
	 | 
	
		
			
RE: Help with grunt maze pathfinding? 
			 
			
				 (04-07-2013, 08:39 PM)zergling50 Wrote:   (04-07-2013, 06:42 AM)JustAnotherPlayer Wrote:  Here. This was a script made by Kyle S. 
void OnStart()  
{ 
	AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);  
	AddEntityCollideCallback("servant_grunt_1", "PNScriptArea", "MonsterFunction2", false, 1); 
} 
void MonsterFunction2() 
{ 
	for (int i = 1; i <6; i++) 
	{ 
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+i, 0, ""); 
	} 
} 
void MonsterFunction(string &in asParent, string &in asChild, int alState) 
{  
	SetEntityActive("servant_grunt_1",true); 
	for (int i = 1; i <11; i++) 
	{ 
int x;  
switch( i ) 
{ 
case 0: 
x = 2; 
break; 
case 10: 
x = 4; 
break;  
default 
x = 0;	 
} 
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+i, x, ""); 
	} 
} 
 
Please note that the monster will NOT stop unless you deactivate it.  
This seems really cool, is there anything I need to set up for it to work or just add it to my code and run it? Just try to add it to your code and run it.
			  
			
			
 
"Veni, vidi, vici." 
"I came, I saw, I conquered." 
			
		 |  
	 
 | 
	| 04-08-2013, 02:05 AM  | 
	
		
	 |