Hartmann 
 
 
		
			Member 
			
			
			
 
			
	Posts: 52 
	Threads: 18 
	Joined: Jun 2012
	
 Reputation: 
0
		
	 | 
	
		
			
a function with same name and function alrdy exist? 
			 
			
				Im getting an error saying that a function with the same name and functions alrd exist. cna you help. here is my script  
 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); 
AddUseItemCallback("", "key_4", "castle_no_grav_1", "KeyOnDoor", true); 
AddUseItemCallback("", "bone_saw_1", "wooden_boards_block_1", "DestroyParticleSystem", true); 
AddTimer("StopLook", 4, "LookAtSaw"); 
} 
 
void DestroyParticleSystem(string& asName) 
{ 
PlaySoundAtEntity("", "saw", "wooden_boards_block_1", 0.0f, true); 
RemoveItem("bone_saw_1"); 
} 
 
 
void MonsterFunction(string &in asParent, string &in asChild, int alState) 
{ 
SetEntityActive("servant_grunt_1", true); 
} 
 
void KeyOnDoor(string &in asItem, string &in asEntity) 
{ 
SetSwingDoorLocked("castle_no_grav_1", false, true); 
PlaySoundAtEntity("", "unlock_door", "castle_no_grav_1", 0.0f, true); 
RemoveItem("key_4"); 
} 
 
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
 
} 
 
void LookAtSaw(string &in asTimer) 
{ 
StopPlayerLookAt(); 
}
			 
			
			
			
		 |  
	 
 | 
 
	| 06-23-2012, 04:11 PM  | 
	
		
	 | 
 
 
	
		
		Your Computer 
 
 
		
			SCAN ME! 
			
			
			
 
			
	Posts: 3,456 
	Threads: 32 
	Joined: Jul 2011
	
 Reputation: 
235
		
	 | 
	
		
			
RE: a function with same name and function alrdy exist? 
			 
			
				void DestroyParticleSystem(string& asName) is a predefined function of Amnesia. You have the wrong syntax callback for it; it's supposed to take in two strings.
			 
			
			
 
			
		 |  
	 
 | 
 
	| 06-23-2012, 04:22 PM  | 
	
		
	 | 
 
 
	
		
		Hartmann 
 
 
		
			Member 
			
			
			
 
			
	Posts: 52 
	Threads: 18 
	Joined: Jun 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: a function with same name and function alrdy exist? 
			 
			
				 (06-23-2012, 04:22 PM)Your Computer Wrote:  void DestroyParticleSystem(string& asName) is a predefined function of Amnesia. You have the wrong syntax callback for it; it's supposed to take in two strings. Its supposed to destroy some wooden planks. you know what syntax calldback i shall use instead?
			  
			
			
			
		 |  
	 
 | 
 
	| 06-23-2012, 04:40 PM  | 
	
		
	 | 
 
 
	
		
		SilentStriker 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 950 
	Threads: 26 
	Joined: Jul 2011
	
 Reputation: 
43
		
	 | 
	
		
			
RE: a function with same name and function alrdy exist? 
			 
			
				if it's AddUseItemCallback it's (string &in asItem, string &in asEntity)
			 
			
			
 
			
				
(This post was last modified: 06-23-2012, 04:42 PM by SilentStriker.)
 
				
			 
		 |  
	 
 | 
 
	| 06-23-2012, 04:41 PM  | 
	
		
	 | 
 
 
	
		
		Hartmann 
 
 
		
			Member 
			
			
			
 
			
	Posts: 52 
	Threads: 18 
	Joined: Jun 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: a function with same name and function alrdy exist? 
			 
			
				 (06-23-2012, 04:41 PM)SilentStriker Wrote:  if it's AddUseItemCallback it's (string &in asItem, string &in asEntity) i am sorry i dotn quite get yor answer it is supposed to destroy some wooden planks. i currenlt have void DestroyParticleSystem(string& asName); What shall i use instead of that
			  
			
			
			
		 |  
	 
 | 
 
	| 06-23-2012, 04:46 PM  | 
	
		
	 | 
 
 
	
		
		SilentStriker 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 950 
	Threads: 26 
	Joined: Jul 2011
	
 Reputation: 
43
		
	 | 
	
		
			
RE: a function with same name and function alrdy exist? 
			 
			
				DestroyParticleSystem(string &in asItem, string &in asEntity)
			 
			
			
 
			
		 |  
	 
 | 
 
	| 06-23-2012, 05:13 PM  | 
	
		
	 | 
 
 
	
		
		Cruzore 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 301 
	Threads: 2 
	Joined: Jun 2012
	
 Reputation: 
37
		
	 | 
	
		
			
RE: a function with same name and function alrdy exist? 
			 
			
				Change the name of the function too. DestroyParticleSystem is, like Your Computer said, a predefined one, you can't use it. 
  
Edit: Or maybe it works with a other syntax, I don't know.
			
			
			
			
				
(This post was last modified: 06-23-2012, 05:17 PM by Cruzore.)
 
				
			 
		 |  
	 
 | 
 
	| 06-23-2012, 05:17 PM  | 
	
		
	 | 
 
 
	
		
		Hartmann 
 
 
		
			Member 
			
			
			
 
			
	Posts: 52 
	Threads: 18 
	Joined: Jun 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: a function with same name and function alrdy exist? 
			 
			
				 (06-23-2012, 05:17 PM)FastHunteR Wrote:  Change the name of the function too. DestroyParticleSystem is, like Your Computer said, a predefined one, you can't use it. 
 
Edit: Or maybe it works with a other syntax, I don't know. i dont know what syntax to use that is supposed to destry the wooden planks
			  
			
			
			
		 |  
	 
 | 
 
	| 06-23-2012, 05:20 PM  | 
	
		
	 | 
 
 
	
		
		Cruzore 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 301 
	Threads: 2 
	Joined: Jun 2012
	
 Reputation: 
37
		
	 | 
	
		
			
RE: a function with same name and function alrdy exist? 
			 
			
				..Just change the name and you're good. But since you probably have no idea what even a function is: 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); 
AddUseItemCallback("", "key_4", "castle_no_grav_1", "KeyOnDoor", true); 
AddUseItemCallback("", "bone_saw_1", "wooden_boards_block_1", "DestroyPlank", true); 
StartPlayerLookAt("bone_saw_1", 2, 2, "");
 
AddTimer("StopLook", 4, "LookAtSaw"); 
}
 
void DestroyPlank(string &in asItem, string &in asEntity)  
{ 
PlaySoundAtEntity("", "26_saw.snt", "wooden_boards_block_1", 0.0f, true); 
RemoveItem("bone_saw_1"); 
AddTimer("", 4, "DestroyPlank2"); 
} 
void DestroyPlank2(string &in asTimer)  
{ 
SetEntityActive("wooden_boards_block_1", false); 
}
 
void MonsterFunction(string &in asParent, string &in asChild, int alState) 
{ 
SetEntityActive("servant_grunt_1", true); 
}
 
void KeyOnDoor(string &in asItem, string &in asEntity) 
{ 
SetSwingDoorLocked("castle_no_grav_1", false, true); 
PlaySoundAtEntity("", "unlock_door", "castle_no_grav_1", 0.0f, true); 
RemoveItem("key_4"); 
}
 
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{
 
}
 
void LookAtSaw(string &in asTimer) 
{ 
StopPlayerLookAt(); 
} 
With such scripting skills, don't expect anything better than dissapearing wooden planks. You should look at some tutorials at  http://wiki.frictionalgames.com/hpl2/amn..._functions
			 
			
			
			
				
(This post was last modified: 06-23-2012, 05:30 PM by Cruzore.)
 
				
			 
		 |  
	 
 | 
 
	| 06-23-2012, 05:28 PM  | 
	
		
	 | 
 
 
	
		
		Hartmann 
 
 
		
			Member 
			
			
			
 
			
	Posts: 52 
	Threads: 18 
	Joined: Jun 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: a function with same name and function alrdy exist? 
			 
			
				 (06-23-2012, 05:28 PM)FastHunteR Wrote:  ..Just change the name and you're good. But since you probably have no idea what even a function is: 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); 
AddUseItemCallback("", "key_4", "castle_no_grav_1", "KeyOnDoor", true); 
AddUseItemCallback("", "bone_saw_1", "wooden_boards_block_1", "DestroyPlank", true); 
StartPlayerLookAt("bone_saw_1", 2, 2, ""); 
 
AddTimer("StopLook", 4, "LookAtSaw"); 
} 
 
void DestroyPlank(string &in asItem, string &in asEntity)  
{ 
PlaySoundAtEntity("", "26_saw.snt", "wooden_boards_block_1", 0.0f, true); 
RemoveItem("bone_saw_1"); 
AddTimer("", 4, "DestroyPlank2"); 
} 
void DestroyPlank2(string &in asTimer)  
{ 
SetEntityActive("wooden_boards_block_1", false); 
} 
 
void MonsterFunction(string &in asParent, string &in asChild, int alState) 
{ 
SetEntityActive("servant_grunt_1", true); 
} 
 
void KeyOnDoor(string &in asItem, string &in asEntity) 
{ 
SetSwingDoorLocked("castle_no_grav_1", false, true); 
PlaySoundAtEntity("", "unlock_door", "castle_no_grav_1", 0.0f, true); 
RemoveItem("key_4"); 
} 
 
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
 
} 
 
void LookAtSaw(string &in asTimer) 
{ 
StopPlayerLookAt(); 
} 
With such scripting skills, don't expect anything better than dissapearing wooden planks. You should look at some tutorials at http://wiki.frictionalgames.com/hpl2/amn..._functions Thank you  
			 
			
			
			
		 |  
	 
 | 
 
	| 06-23-2012, 05:30 PM  | 
	
		
	 | 
 
 
	 
 |