JoeBradleyUK 
 
 
		
			Member 
			
			
			
 
			
	Posts: 115 
	Threads: 20 
	Joined: Jul 2011
	
 Reputation: 
0
		
	 | 
	
		
			
Script Problem! 
			 
			
				My Script won't work, what's wrong with it?   
//////////////////////////// 
// Run when starting map 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "Storage_Scare", "Storage_Scare", true, 0); 
} 
 
 
void Storage_Scare(string &in asParent, string &in asChild, int alState)  
{ 
SetEntityActive("Storage_Enemy, true); 
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_1", "0.1", ""; 
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_2", "0.1", ""; 
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_3", "0.1", ""; 
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", ""; 
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_5", "0.1", ""; 
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_6", "0.1", ""; 
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_7", "0.1", ""; 
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_8", "0.1", ""; 
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_9", "0.1", ""; 
} 
 
void FirstDiary(string &in item, int index)  
{ 
ReturnOpenJournal(true); 
}  
 
//////////////////////////// 
// Run when entering map 
void OnEnter() 
{ 
PlayMusic("04_amb.ogg", true, 0.7, 0.1, 0, true); 
} 
  
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
StopMusic(0.4, 0); 
}
  
			 
			
			
 
:Work In Progress: 
Insanity  
			
				
(This post was last modified: 07-18-2011, 10:16 PM by JoeBradleyUK.)
 
				
			 
		 |  
	 
 | 
 
	| 07-18-2011, 08:56 PM  | 
	
		
	 | 
 
 
	
		
		Tanshaydar 
 
 
		
			From Beyond 
			
			
			
 
			
	Posts: 3,085 
	Threads: 17 
	Joined: Mar 2009
	
 Reputation: 
67
		
	 | 
	
		
			
RE: Script Problem! 
			 
			
				("Storage_Enemy, true); 
-> 
("Storage_Enemy", true);
			 
			
			
 
			
		 |  
	 
 | 
 
	| 07-18-2011, 08:58 PM  | 
	
		
	 | 
 
 
	
		
		JoeBradleyUK 
 
 
		
			Member 
			
			
			
 
			
	Posts: 115 
	Threads: 20 
	Joined: Jul 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Script Problem! 
			 
			
				Ok, now that is working it seems that the path nodes (I think) are not working as I got a lot more errors than before! 
			 
			
			
 
:Work In Progress: 
Insanity  
			
				
(This post was last modified: 07-18-2011, 09:22 PM by JoeBradleyUK.)
 
				
			 
		 |  
	 
 | 
 
	| 07-18-2011, 09:07 PM  | 
	
		
	 | 
 
 
	
		
		JenniferOrange 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 424 
	Threads: 43 
	Joined: Jun 2011
	
 Reputation: 
33
		
	 | 
	
		
			
RE: Script Problem! 
			 
			
				AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", ""; should be changed to AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", ""); 
*you have to remember to add the ending parenthesis! Fix that on all of your patrol nodes and it should work!* 
 
			 
			
			
 
Ba-da bing, ba-da boom. 
 
			
		 |  
	 
 | 
 
	| 07-18-2011, 09:39 PM  | 
	
		
	 | 
 
 
	
		
		JoeBradleyUK 
 
 
		
			Member 
			
			
			
 
			
	Posts: 115 
	Threads: 20 
	Joined: Jul 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Script Problem! 
			 
			
				 (07-18-2011, 09:39 PM)JenniferOrange Wrote:  AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", ""; should be changed to AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", ""); 
*you have to remember to add the ending parenthesis! Fix that on all of your patrol nodes and it should work!* 
Oh thanks, aha that, was just a silly mistake which I didn't see some reason!   
 (07-18-2011, 10:14 PM)JoeBradleyUK Wrote:   (07-18-2011, 09:39 PM)JenniferOrange Wrote:  AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", ""; should be changed to AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", ""); 
*you have to remember to add the ending parenthesis! Fix that on all of your patrol nodes and it should work!*  
Oh thanks, aha that, was just a silly mistake which I didn't see some reason!  
Another thing, do monsters disappear on their own? If not how would I make them disappear at a certain pathnode?
			  
			
			
 
:Work In Progress: 
Insanity  
			
				
(This post was last modified: 07-18-2011, 10:17 PM by JoeBradleyUK.)
 
				
			 
		 |  
	 
 | 
 
	| 07-18-2011, 10:14 PM  | 
	
		
	 | 
 
 
	
		
		MrCookieh 
 
 
		
			Member 
			
			
			
 
			
	Posts: 157 
	Threads: 8 
	Joined: Jul 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Script Problem! 
			 
			
				Monsters disappear, if they are hallucinations (coming near to you), or if they are standing around and have nothing to do. 
If you want them to disappear at a certain pathnode:
 void OnStart(){ 
AddEntityCollideCallback("grunt", "pathnode", "function", true, 1); 
} 
 
void function(string &in asParent, string &in asChild, int alState){ 
FadeEnemyToSmoke("grunt", false); 
}
  
			 
			
			
			
		 |  
	 
 | 
 
	| 07-18-2011, 10:25 PM  | 
	
		
	 | 
 
 
	
		
		JoeBradleyUK 
 
 
		
			Member 
			
			
			
 
			
	Posts: 115 
	Threads: 20 
	Joined: Jul 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Script Problem! 
			 
			
				 (07-18-2011, 10:25 PM)MrCookieh Wrote:  Monsters disappear, if they are hallucinations (coming near to you), or if they are standing around and have nothing to do. 
 
If you want them to disappear at a certain pathnode: 
 
void OnStart(){ 
AddEntityCollideCallback("grunt", "pathnode", "function", true, 1); 
} 
 
void function(string &in asParent, string &in asChild, int alState){ 
FadeEnemyToSmoke("grunt", false); 
}
  
Thanks! You guys on the forum are really helpful   
			 
			
			
 
:Work In Progress: 
Insanity  
			
		 |  
	 
 | 
 
	| 07-18-2011, 10:34 PM  | 
	
		
	 | 
 
 
	 
 |