i3670 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,308 
	Threads: 74 
	Joined: Oct 2011
	
 Reputation: 
36
		
	 | 
	
		
			
RE: Can't find my Custom Story 
			 
			
				 (10-03-2011, 04:51 PM)Your Computer Wrote:  You're missing a function definition for the third code block (line 13). A code block that isn't a function (a.k.a. nested code blocks) are only allowed within function code blocks. I put in the definition:
 
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
 
Copy/paste from Frictional Games Script website. Gives me the same error message, except the numbers has changed to 55,2
			  
			
			
			
		 |  
	 
 | 
 
	| 10-03-2011, 04:57 PM  | 
	
		
	 | 
 
 
	
		
		Your Computer 
 
 
		
			SCAN ME! 
			
			
			
 
			
	Posts: 3,456 
	Threads: 32 
	Joined: Jul 2011
	
 Reputation: 
235
		
	 | 
	
		
			
RE: Can't find my Custom Story 
			 
			
				 (10-03-2011, 04:57 PM)i3670 Wrote:  I put in the definition: 
 
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates); 
 
Copy/paste from Frictional Games Script website. Gives me the same error message, except the numbers has changed to 55,2 
I meant change this:  { 
AddEntityCollideCallback("Player", "Sound_5", "StartMusic", true, 1); 
AddEntityCollideCallback("Player", "Sound_3", "StartMusic", true, 1); 
AddEntityCollideCallback("Player", "Music_1", "StartMusic", true, 1); 
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); 
}
 
To something like this:
 void FunctionNameHere() 
{ 
AddEntityCollideCallback("Player", "Sound_5", "StartMusic", true, 1); 
AddEntityCollideCallback("Player", "Sound_3", "StartMusic", true, 1); 
AddEntityCollideCallback("Player", "Music_1", "StartMusic", true, 1); 
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); 
}
   
			 
			
			
 
			
		 |  
	 
 | 
 
	| 10-03-2011, 05:00 PM  | 
	
		
	 | 
 
 
	
		
		i3670 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,308 
	Threads: 74 
	Joined: Oct 2011
	
 Reputation: 
36
		
	 | 
	
		
			
RE: Can't find my Custom Story 
			 
			
				It's suppose to look like this? 
 
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates); 
{  
AddEntityCollideCallback("Player", "Sound_5", "StartMusic", true, 1); 
AddEntityCollideCallback("Player", "Sound_3", "StartMusic", true, 1); 
AddEntityCollideCallback("Player", "Music_1", "StartMusic", true, 1); 
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);  
} 
 
Or do you mean this one? 
void MyFunc(string &in asParent, string &in asChild, int alState) 
			 
			
			
			
				
(This post was last modified: 10-03-2011, 05:02 PM by i3670.)
 
				
			 
		 |  
	 
 | 
 
	| 10-03-2011, 05:02 PM  | 
	
		
	 | 
 
 
	
		
		Your Computer 
 
 
		
			SCAN ME! 
			
			
			
 
			
	Posts: 3,456 
	Threads: 32 
	Joined: Jul 2011
	
 Reputation: 
235
		
	 | 
	
		
			
RE: Can't find my Custom Story 
			 
			
				 (10-03-2011, 05:02 PM)i3670 Wrote:  Or do you mean this one? 
void MyFunc(string &in asParent, string &in asChild, int alState) 
Most likely this. Also, you're missing a comma on line 8 and a quotation mark on line 10.
			  
			
			
 
			
				
(This post was last modified: 10-03-2011, 05:06 PM by Your Computer.)
 
				
			 
		 |  
	 
 | 
 
	| 10-03-2011, 05:04 PM  | 
	
		
	 | 
 
 
	
		
		i3670 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,308 
	Threads: 74 
	Joined: Oct 2011
	
 Reputation: 
36
		
	 | 
	
		
			
RE: Can't find my Custom Story 
			 
			
				Got the error msg again 
 
main (55,1) instead 
 
Forget what I said about that msg. 
 
Got a new one after the changes. 
 
main (51,56): ERR: Expected '(' 
main (52,63): ERR: Expected '(' 
main (53,61): ERR: Expected '('
			 
			
			
			
				
(This post was last modified: 10-03-2011, 05:13 PM by i3670.)
 
				
			 
		 |  
	 
 | 
 
	| 10-03-2011, 05:07 PM  | 
	
		
	 | 
 
 
	
		
		Your Computer 
 
 
		
			SCAN ME! 
			
			
			
 
			
	Posts: 3,456 
	Threads: 32 
	Joined: Jul 2011
	
 Reputation: 
235
		
	 | 
	
		
			
RE: Can't find my Custom Story 
			 
			
				 (10-03-2011, 05:07 PM)i3670 Wrote:  Got the error msg again 
 
main (55,1) instead 
I've edited my previous post, and replace "bool abResume" with either true or false from this:
 PlayMusic("general_piano03.snt", false, 1, 2, 1, bool abResume); 
PlayMusic("player_react_guardian3.snt", false, 1, 2, 1, bool abResume); 
PlayMusic("scare_male_terrified4.ogg", true, 1, 2, 1, bool abResume);
   
			 
			
			
 
			
		 |  
	 
 | 
 
	| 10-03-2011, 05:10 PM  | 
	
		
	 | 
 
 
	
		
		i3670 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,308 
	Threads: 74 
	Joined: Oct 2011
	
 Reputation: 
36
		
	 | 
	
		
			
RE: Can't find my Custom Story 
			 
			
				Woho the map works!    almost. My key doesn't work on my door.
			  
			
			
			
		 |  
	 
 | 
 
	| 10-03-2011, 05:18 PM  | 
	
		
	 | 
 
 
	
		
		Your Computer 
 
 
		
			SCAN ME! 
			
			
			
 
			
	Posts: 3,456 
	Threads: 32 
	Joined: Jul 2011
	
 Reputation: 
235
		
	 | 
	
		
			
RE: Can't find my Custom Story 
			 
			
				 (10-03-2011, 05:18 PM)i3670 Wrote:  Woho the map works!   almost. My key doesn't work on my door. 
Try replacing your first MyFunc function with this:
 void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
{ 
SetSwingDoorLocked(asEntity, false, true); 
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false); 
RemoveItem(asItem); 
}
   
			 
			
			
 
			
		 |  
	 
 | 
 
	| 10-03-2011, 05:26 PM  | 
	
		
	 | 
 
 
	
		
		i3670 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,308 
	Threads: 74 
	Joined: Oct 2011
	
 Reputation: 
36
		
	 | 
	
		
			
RE: Can't find my Custom Story 
			 
			
				Don't I need to "bind" the key to a specific door for it to work? 
 
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
	{ 
		SetSwingDoorLocked("Bedroom", false, true); 
		PlaySoundAtEntity("", "unlock_door", "Bedroom", 0, false); 
		RemoveItem("Bedroomkey"); 
	} 
 
How it looks atm
			 
			
			
			
				
(This post was last modified: 10-03-2011, 05:39 PM by i3670.)
 
				
			 
		 |  
	 
 | 
 
	| 10-03-2011, 05:38 PM  | 
	
		
	 | 
 
 
	
		
		Your Computer 
 
 
		
			SCAN ME! 
			
			
			
 
			
	Posts: 3,456 
	Threads: 32 
	Joined: Jul 2011
	
 Reputation: 
235
		
	 | 
	
		
			
RE: Can't find my Custom Story 
			 
			
				 (10-03-2011, 05:38 PM)i3670 Wrote:  Don't I need to "bind" the key to a specific door for it to work? 
 
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
	{ 
SetSwingDoorLocked("Bedroom", false, true); 
PlaySoundAtEntity("", "unlock_door", "Bedroom", 0, false); 
RemoveItem("Bedroomkey"); 
	} 
 
How it looks atm 
The AddUseItemCallback function is what "binds" it to a door (entity). In your case, the door has to be called "Bedroom" and the key "Bedroomkey". However, you have "Key" in the AddUseItemCallback function.
			  
			
			
 
			
		 |  
	 
 | 
 
	| 10-03-2011, 05:54 PM  | 
	
		
	 | 
 
 
	 
 |