Bonehead 
 
 
		
			Member 
			
			
			
 
			
	Posts: 50 
	Threads: 12 
	Joined: Apr 2013
	
 Reputation: 
1
		
	 | 
	
		
			
Spawning a monster with a script area... 
			 
			
				A friend and I (Kiandra) Cannot seem to get this working. We've both been poking at it for a while and just can't get it to work. Here is the script.. 
 
void OnStart() 
{ 
	AddEntityCollideCallback("Player", "ScriptArea_brute", "brutepatrol", true, 1); 
} 
 
void OnEnter() 
{ 
	 
} 
 
void OnLeave() 
{ 
	 
} 
 
void brutepatrol(string &in asParent, string &in asChild) 
{ 
		SetEntityActive("servant_brute_1", true); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_22", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_18", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_19", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_25", 0, ""); 
} 
 
 
It causes no errors whatsoever. Just nothing happens in game.. Anyone know why?
			 
			
			
			
		 |  
	 
 | 
 
	| 06-17-2013, 12:50 AM  | 
	
		
	 | 
 
 
	
		
		ExpectedIdentifier 
 
 
		
			Member 
			
			
			
 
			
	Posts: 234 
	Threads: 10 
	Joined: Sep 2012
	
 Reputation: 
11
		
	 | 
	
		
			
RE: Spawning a monster with a script area... 
			 
			
				 (06-17-2013, 12:50 AM)Bonehead Wrote:  A friend and I (Kiandra) Cannot seem to get this working. We've both been poking at it for a while and just can't get it to work. Here is the script.. 
 
void OnStart() 
{ 
	AddEntityCollideCallback("Player", "ScriptArea_brute", "brutepatrol", true, 1); 
} 
 
void OnEnter() 
{ 
	 
} 
 
void OnLeave() 
{ 
	 
} 
 
void brutepatrol(string &in asParent, string &in asChild) 
{ 
		SetEntityActive("servant_brute_1", true); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_22", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_18", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_19", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_25", 0, ""); 
} 
 
 
It causes no errors whatsoever. Just nothing happens in game.. Anyone know why? 
You're missing int alState.
			  
			
			
			
		 |  
	 
 | 
 
	| 06-17-2013, 01:12 AM  | 
	
		
	 | 
 
 
	
		
		Bonehead 
 
 
		
			Member 
			
			
			
 
			
	Posts: 50 
	Threads: 12 
	Joined: Apr 2013
	
 Reputation: 
1
		
	 | 
	
		
			
RE: Spawning a monster with a script area... 
			 
			
				 (06-17-2013, 01:12 AM)sonataarctica Wrote:   (06-17-2013, 12:50 AM)Bonehead Wrote:  A friend and I (Kiandra) Cannot seem to get this working. We've both been poking at it for a while and just can't get it to work. Here is the script.. 
 
void OnStart() 
{ 
	AddEntityCollideCallback("Player", "ScriptArea_brute", "brutepatrol", true, 1); 
} 
 
void OnEnter() 
{ 
	 
} 
 
void OnLeave() 
{ 
	 
} 
 
void brutepatrol(string &in asParent, string &in asChild) 
{ 
		SetEntityActive("servant_brute_1", true); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_22", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_18", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_19", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_25", 0, ""); 
} 
 
 
It causes no errors whatsoever. Just nothing happens in game.. Anyone know why?  
 
 
You're missing int alState. 
Added that in. Friend of mine sent me her version of the script. Our scripts are EXACTLY the same. Yet hers works and mine does not. I don't get it...
			  
			
			
			
		 |  
	 
 | 
 
	| 06-17-2013, 01:39 AM  | 
	
		
	 | 
 
 
	
		
		PutraenusAlivius 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 4,713 
	Threads: 75 
	Joined: Dec 2012
	
 Reputation: 
119
		
	 | 
	
		
			
RE: Spawning a monster with a script area... 
			 
			
				 (06-17-2013, 01:39 AM)Bonehead Wrote:   (06-17-2013, 01:12 AM)sonataarctica Wrote:   (06-17-2013, 12:50 AM)Bonehead Wrote:  A friend and I (Kiandra) Cannot seem to get this working. We've both been poking at it for a while and just can't get it to work. Here is the script.. 
 
void OnStart() 
{ 
	AddEntityCollideCallback("Player", "ScriptArea_brute", "brutepatrol", true, 1); 
} 
 
void OnEnter() 
{ 
	 
} 
 
void OnLeave() 
{ 
	 
} 
 
void brutepatrol(string &in asParent, string &in asChild) 
{ 
		SetEntityActive("servant_brute_1", true); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_22", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_18", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_19", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_25", 0, ""); 
} 
 
 
It causes no errors whatsoever. Just nothing happens in game.. Anyone know why?  
 
 
You're missing int alState.  
 
Added that in. Friend of mine sent me her version of the script. Our scripts are EXACTLY the same. Yet hers works and mine does not. I don't get it... 
Well, that's odd.
			  
			
			
 
"Veni, vidi, vici." 
"I came, I saw, I conquered." 
			
		 |  
	 
 | 
 
	| 06-17-2013, 01:54 AM  | 
	
		
	 | 
 
 
	
		
		ExpectedIdentifier 
 
 
		
			Member 
			
			
			
 
			
	Posts: 234 
	Threads: 10 
	Joined: Sep 2012
	
 Reputation: 
11
		
	 | 
	
		
			
RE: Spawning a monster with a script area... 
			 
			
				 (06-17-2013, 01:39 AM)Bonehead Wrote:   (06-17-2013, 01:12 AM)sonataarctica Wrote:   (06-17-2013, 12:50 AM)Bonehead Wrote:  A friend and I (Kiandra) Cannot seem to get this working. We've both been poking at it for a while and just can't get it to work. Here is the script.. 
 
void OnStart() 
{ 
	AddEntityCollideCallback("Player", "ScriptArea_brute", "brutepatrol", true, 1); 
} 
 
void OnEnter() 
{ 
	 
} 
 
void OnLeave() 
{ 
	 
} 
 
void brutepatrol(string &in asParent, string &in asChild) 
{ 
		SetEntityActive("servant_brute_1", true); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_22", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_18", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_19", 0, ""); 
		AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_25", 0, ""); 
} 
 
 
It causes no errors whatsoever. Just nothing happens in game.. Anyone know why?  
 
 
You're missing int alState.  
 
Added that in. Friend of mine sent me her version of the script. Our scripts are EXACTLY the same. Yet hers works and mine does not. I don't get it... 
Check that the script area is called exactly the same thing in the level editor as it is in the .hps file.
			  
			
			
			
		 |  
	 
 | 
 
	| 06-17-2013, 03:07 AM  | 
	
		
	 | 
 
 
	
		
		FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Spawning a monster with a script area... 
			 
			
				You do have a monster in your map right? You need to place a monster in your map, make it inactive, to be able to "spawn" it. It's not spawning from thin air.
			 
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 06-17-2013, 10:36 AM  | 
	
		
	 | 
 
 
	 
 |