Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
[HELP] Goddamn levers. 
			 
			
				 
I'm getting a lot of problems with this part of the script: 
 
 
void chand() 
{ 
 if (GetLocalVarInt lever_small01_1 == lever_1_state) 
	( 
 CompleteQuest("PerformLeverTaskCompleted", "levertask")); 
 PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false); 
 PlaySoundAtEntity("", "general_chain.ogg", "Player", 0, false); 
 PlaySoundAtEntity("", "door_level_engine_open.ogg", "Player", 0, false); 
 SetEntityActive("sadchand", false); 
 SetEntityActive("happychand", true); 
 CheckPoint ("", "auto1", "", "", ""); 
 SetEntityActive("block_box_3", true); 
 SetEntityActive("block_box_4", false); 
	) 
} 
 
The thing is, I pull the lever and the chandelier changes. But the crash is saying that I need to express the value of stuff, and to put some '(' in awkward places. Can you help me?
			 
			
			
			
		 |  
	 
 | 
 
	| 12-07-2011, 01:25 PM  | 
	
		
	 | 
 
 
	
		
		Khyrpa 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 638 
	Threads: 10 
	Joined: Apr 2011
	
 Reputation: 
24
		
	 | 
	
		
			
RE: [HELP] Goddamn levers. 
			 
			
				 
void chand() 
{ 
if (GetLocalVarInt lever_small01_1 == lever_1_state) 
{ 
CompleteQuest("PerformLeverTaskCompleted", "levertask")); 
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false); 
PlaySoundAtEntity("", "general_chain.ogg", "Player", 0, false); 
PlaySoundAtEntity("", "door_level_engine_open.ogg", "Player", 0, false); 
SetEntityActive("sadchand", false); 
SetEntityActive("happychand", true); 
CheckPoint ("", "auto1", "", "", ""); 
SetEntityActive("block_box_3", true); 
SetEntityActive("block_box_4", false); 
} 
} 
 
 
I just took a quick glance, works? 
			 
			
			
 
			
		 |  
	 
 | 
 
	| 12-07-2011, 01:26 PM  | 
	
		
	 | 
 
 
	
		
		flamez3 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,281 
	Threads: 48 
	Joined: Apr 2011
	
 Reputation: 
57
		
	 | 
	
		
			
RE: [HELP] Goddamn levers. 
			 
			
				 (12-07-2011, 01:25 PM)Victor Wrote:  I'm getting a lot of problems with this part of the script: 
 
 
void chand() 
{ 
if (GetLocalVarInt lever_small01_1 == lever_1_state) 
	( 
CompleteQuest("PerformLeverTaskCompleted", "levertask")); 
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false); 
PlaySoundAtEntity("", "general_chain.ogg", "Player", 0, false); 
PlaySoundAtEntity("", "door_level_engine_open.ogg", "Player", 0, false); 
SetEntityActive("sadchand", false); 
SetEntityActive("happychand", true); 
CheckPoint ("", "auto1", "", "", ""); 
SetEntityActive("block_box_3", true); 
SetEntityActive("block_box_4", false); 
	) 
} 
 
The thing is, I pull the lever and the chandelier changes. But the crash is saying that I need to express the value of stuff, and to put some '(' in awkward places. Can you help me? 
Also, put quotation marks outside of lever_small01_1, that might help. 
			  
			
			
 
			
				
(This post was last modified: 12-07-2011, 01:35 PM by flamez3.)
 
				
			 
		 |  
	 
 | 
 
	| 12-07-2011, 01:35 PM  | 
	
		
	 | 
 
 
	
		
		Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: [HELP] Goddamn levers. 
			 
			
				Now it says that I need a ';' over here:  
 
P;laySoundAtEntity("", "quest_completed.snt", "Player", 0, false); 
awkward 
			 
			
			
			
		 |  
	 
 | 
 
	| 12-09-2011, 06:25 PM  | 
	
		
	 | 
 
 
	
		
		Obliviator27 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 792 
	Threads: 10 
	Joined: Jul 2011
	
 Reputation: 
66
		
	 | 
	
		
			
RE: [HELP] Goddamn levers. 
			 
			
				If you ask me, it would be easiest just to set up a connectionstatechangecallback. 
In the level editor, under the entity tab for the lever, there should be a box with ConnectionStateChangeCallback (or something like that) Just type in whatever you like. As an example, I'll just do LeverPull. 
Then, you can do this.
 void LeverPull(string &in EntityName, int alState) {     if(alState == 1)     {        //stuff you want done here     } } 
 
  
			 
			
			
 
			
		 |  
	 
 | 
 
	| 12-10-2011, 12:42 AM  | 
	
		
	 | 
 
 
	
		
		Fanskapi 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 23 
	Threads: 5 
	Joined: Nov 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: [HELP] Goddamn levers. 
			 
			
				CompleteQuest("PerformLeverTaskCompleted", "levertask")); 
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false); 
 
Notice the extra ) after "levertask", thats why it says that you need to put an ; there. You actually don't, just delete the ). 
Download Notepad++ (or some similiar coding program), it will help you alot. 
			 
			
			
			
		 |  
	 
 | 
 
	| 12-12-2011, 09:35 AM  | 
	
		
	 | 
 
 
	 
 |