| 
		
	
		| Chunckycat12   Junior Member
 
 Posts: 7
 Threads: 2
 Joined: Apr 2012
 Reputation: 
0
 | 
			| expected ")" or "," help please 
 
				hi everyone i only started to mod about 3 days ago so bear with me    but basically my problem is that whenever i load my amnesia custom map a message appears saying 19,57 expected ")" or "," i have beem trying to do it for hours    if anyone sees anything let me know    
void OnStart() 
{ 
 AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);  
 AddEntityCollideCallback("Player", "ScriptArea_1", "CollideScriptArea1", true, 1); 
 AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1); 
} 
void UsedKeyOnDoor(string &in item, string &in door) 
{ 
 SetSwingDoorLocked("door_1", false, true); 
 PlaySoundAtEntity("", "unlock_door", "door_1", 0, false); 
 RemoveItem("key_1"); 
}
 
void CollideScriptArea1(string &in asParent, string &in asChild, int alState) 
{ 
 SetSwingDoorClosed("castle_1", true, true); 
}
 
void StartMusic(string &in asParent, string &in asChild int alState)-this is 19,57 btw 
{ 
 PlayMusic("01_amb_darkness.ogg", true, 0.8, 2, 1, true); 
}
			
				
(This post was last modified: 04-16-2012, 10:04 PM by Chunckycat12.)
 |  |  
	| 04-16-2012, 08:17 PM |  |  
	
		| MrIcabod123   Junior Member
 
 Posts: 43
 Threads: 7
 Joined: Jan 2012
 Reputation: 
0
 | 
			| RE: expected ")" or "," help please 
 
				Try this: 
 
 void OnStart()
 {
 AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
 AddEntityCollideCallback("Player", "ScriptArea_1", "CollideScriptArea1", true, 1);
 AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
 }
 void UsedKeyOnDoor(string &in item, string &in door)
 {
 SetSwingDoorLocked("door_1", false, true);
 PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
 RemoveItem("key_1");
 }
 
 void CollideScriptArea1(string &in asParent, string &in asChild, int alState)
 {
 SetSwingDoorClosed("castle_1", true, true);
 }
 
 void StartMusic(string &in asParent, string &in asChild, int alState)
 {
 PlayMusic("01_amb_darkness.ogg", true, 0.8, 2, 1, true);
 }
 
 You forgot the "," after &in asChild
 |  |  
	| 04-16-2012, 08:29 PM |  |  
	
		| Chunckycat12   Junior Member
 
 Posts: 7
 Threads: 2
 Joined: Apr 2012
 Reputation: 
0
 | 
			| RE: expected ")" or "," help please 
 
				Thankyuuuuuuuuuuuu so much its funny how how one little commar can cause so much of a pain in my lifei feel kinda stupid
 |  |  
	| 04-16-2012, 08:43 PM |  |  
	
		| MrIcabod123   Junior Member
 
 Posts: 43
 Threads: 7
 Joined: Jan 2012
 Reputation: 
0
 | 
			| RE: expected ")" or "," help please 
 
				 (04-16-2012, 08:43 PM)Chunckycat12 Wrote:  Thankyuuuuuuuuuuuu so much its funny how how one little commar can cause so much of a pain in my lifei feel kinda stupid
 Glad to help    |  |  
	| 04-16-2012, 08:48 PM |  |  
	
		| JenniferOrange   Senior Member
 
 Posts: 424
 Threads: 43
 Joined: Jun 2011
 Reputation: 
33
 | 
			| RE: expected ")" or "," help please 
 
				HOLD UP. The callback syntax for AddUseItemCallback is supposed to be (string &in asItem, string &in asEntity). You have (string &in item, string &in door), how is it possible it still works?! -rage face-
 
 Ba-da bing, ba-da boom.
 
				
(This post was last modified: 04-16-2012, 10:54 PM by JenniferOrange.)
 |  |  
	| 04-16-2012, 09:42 PM |  |  
	
		| Chunckycat12   Junior Member
 
 Posts: 7
 Threads: 2
 Joined: Apr 2012
 Reputation: 
0
 | 
			| RE: expected ")" or "," help please 
 
				to be honest im not entirely sure i just just followed a youtube tutorial lol
			 |  |  
	| 04-16-2012, 09:45 PM |  |  
	
		| MrIcabod123   Junior Member
 
 Posts: 43
 Threads: 7
 Joined: Jan 2012
 Reputation: 
0
 | 
			| RE: expected ")" or "," help please 
 
				He must have followed the tutorial from the wiki.
 void OnStart()
 {
 AddUseItemCallback("", "ITEM", "DOOR", "FUNCTION", true);
 }
 
 void FUNCTION(string &in item, string &in door)
 {
 SetSwingDoorLocked(door, false, true);
 PlaySoundAtEntity("", "unlock_door", door, 0, false);
 RemoveItem(item);
 }
 
 
 |  |  
	| 04-16-2012, 09:47 PM |  |  
	
		| JenniferOrange   Senior Member
 
 Posts: 424
 Threads: 43
 Joined: Jun 2011
 Reputation: 
33
 | 
			| RE: expected ")" or "," help please 
 
				 (04-16-2012, 09:47 PM)MrIcabod123 Wrote:  He must have followed the tutorial from the wiki.
 void OnStart()
 {
 AddUseItemCallback("", "ITEM", "DOOR", "FUNCTION", true);
 }
 
 void FUNCTION(string &in item, string &in door)
 {
 SetSwingDoorLocked(door, false, true);
 PlaySoundAtEntity("", "unlock_door", door, 0, false);
 RemoveItem(item);
 }
 I didn't know it still worked if you did that. I get everything from the Engine Scripts page.
			 
 Ba-da bing, ba-da boom.
 |  |  
	| 04-16-2012, 09:48 PM |  |  
	
		| Cranky Old Man   Posting Freak
 
 Posts: 986
 Threads: 20
 Joined: Apr 2012
 Reputation: 
38
 | 
			| RE: expected ")" or "," help please 
 
				 (04-16-2012, 09:42 PM)JenniferOrange Wrote:  HOLD UP. The callback syntax for AddUseItemCallback is supposed to be (string &in asItem, string &in asEntity). You have (string &in item, string &in door), how is it possible it still works?! 
 -img-
 
You need to learn scripting, Jennifer.    
 
				
(This post was last modified: 04-16-2012, 10:11 PM by Cranky Old Man.)
 |  |  
	| 04-16-2012, 09:58 PM |  |  
	
		| JetlinerX   Senior Member
 
 Posts: 599
 Threads: 49
 Joined: Jun 2011
 Reputation: 
19
 | 
			| RE: expected ")" or "," help please 
 
				 (04-16-2012, 09:58 PM)Cranky Old Man Wrote:  You need to learn scripting, Jennifer.  No, she was the one who started me on scripting. She knows a lot. Also, dont quote pictures, kinda makes the thread too long.
			 
 |  |  
	| 04-16-2012, 10:06 PM |  |  |