Viperdream 
			Member0  
	
		
			
Problem when loading map 
 
				When I try to load my map, I get this error:
Fatal Error: Unexpected end 24,5$
I checked 24,5 and it should be fine.
I'm pretty new to programming so any help is welcome 
Spoiler below!  
void OnLeverStateChange(string &in EntityName, int alState)
 
 
			 
 
 
	03-02-2011, 05:34 PM  
		
	 
 
	
		Oscar House 
			Senior Member9  
	
		
			
RE: Problem when loading map 
 
				Here is where your problem is:
Spoiler below!  
void OnLeverStateChange(string &in EntityName, int alState)void SetEntityConnectionStateChangeCallback(leverbooks_01, OnLeverStateChange); 
 
 
You shouldn't put it as a function, instead place it inside Onstart(), like this:
Spoiler below!  
void OnLeverStateChange(string &in EntityName, int alState)SetEntityConnectionStateChangeCallback("leverbooks_01", "OnLeverStateChange"); 
 
 
You also missed some quotation marks and a semicolon from there, I added those as well. See how it works, though I suspect there might still be something I missed.
			
 
 
 
	03-02-2011, 05:44 PM  
		
	 
 
	
		Viperdream 
			Member0  
	
		
			
RE: Problem when loading map 
 
				The map loads now.
			
			
			
		 
 
 
	03-02-2011, 06:24 PM  
		
	 
 
	
		nkmol 
			Senior Member4  
	
		
			
RE: Problem when loading map 
 
				Try to put the connectioncallback at the entity tab of the lever in the level editor.
			
			
			
			
		 
 
 
	03-02-2011, 09:01 PM  
		
	 
 
	
		Pandemoneus 
			Senior Member0  
	
		
			
RE: Problem when loading map 
 
				Check the test map in my sig, it has a working lever.
			
			
			
 
 
 
	03-02-2011, 09:02 PM  
		
	 
 
	
		nkmol 
			Senior Member4  
	
		
			
RE: Problem when loading map 
 
				Sorry try this. And alState == 0 would be neutral, try to change it to -1 or 1
Void OnLeverStateChange(string &in EntityName, int alState
				
(This post was last modified: 03-02-2011, 09:21 PM by nkmol .) 
 
				
			 
		 
 
 
	03-02-2011, 09:16 PM  
		
	 
 
	
		Viperdream 
			Member0  
	
		
			
RE: Problem when loading map 
 
				Tried the script in Pandemoneus map and also tried the script nkmol suggested me
Still won't work :<
This is my current script:
Spoiler below!  
	 void OnStart()
 
 
			 
 
 
	03-03-2011, 08:33 PM  
		
	 
 
	
		Nye 
			Senior Member2  
	
		
			
RE: Problem when loading map 
 
				 (03-03-2011, 08:33 PM) Viperdream Wrote:  
Spoiler below!  
	 void OnStart()
 
 
Specifically, in-game - what works and what doesn't work?
			
 
			
			
 
 
 
	03-04-2011, 01:34 AM  
		
	 
 
	
		Viperdream 
			Member0  
	
		
			
RE: Problem when loading map 
 
				Everything in the script works. Except for the lever. When I try it, nothing happens. I can move it up or down but doesn't stay stuck or anything and activates nothing. 
			
			
			
		 
 
 
	03-04-2011, 04:35 PM  
		
	 
 
	
		Pandemoneus 
			Senior Member0  
	
		
			
RE: Problem when loading map 
 
				If you use that book lever, let me take a look at the offcial maps, I will edit this post soon.
[edit]
The developers made it a bit different for that.
They created a script area in front of the book (in the direction you pull it) and made a normal EntityCollideCallback with the book.
for(int i=1;i<=3;i++) AddEntityCollideCallback("SecretBook_"+i, "AreaSecretBook_"+i, "CollideSecretBook", false, 0);    //Pull books to reveal room
(Use
AddEntityCollideCallback("leverbooks_01", "NameOfYourScriptAreaHere", "NameOfYourCollideCallbackHere", false, 0);
for your script)
In that callback function they got a
SetPropObjectStuckState(asParent, 1);
which makes the book unmoveable (change 
asParent  to 
"leverbooks_01"  if you are not completly sure what this does).
			
				
(This post was last modified: 03-04-2011, 05:26 PM by Pandemoneus .) 
 
				
			 
		 
 
 
	03-04-2011, 05:15 PM