BrooksyFC 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 329 
	Threads: 11 
	Joined: Jul 2011
	
 Reputation: 
6
		
	 | 
	
		
			
Rod Puzzle 
			 
			
				Hey Guys, 
 
I've been trying to a while now but I can't seem to get anything working on this script. Basically, the player needs to have 3 rods to put into a machine (well that object with the 3 rod holes) which will then enable the player to pull a lever to open a door.  
 
I'm pretty sure it was used in the original game, but can someone help me with this script. Like if the player has all the rods, which they will, how do the rods go into the slots e.t.c 
 
Thanks in advance
			 
			
			
 
Think A Little, Change A Lot 
			
				
(This post was last modified: 06-12-2012, 03:26 PM by BrooksyFC.)
 
				
			 
		 |  
	 
 | 
 
	| 06-12-2012, 03:14 PM  | 
	
		
	 | 
 
 
	
		
		FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Rod Puzzle 
			 
			
				void OnStart() 
{ 
 
AddUseItemCallback("", "Rod_1", "ScriptArea_1", "UseRod_1", true); 
///Rod_1 = 1st rod ///ScriptArea_1 is around the first hole 
AddUseItemCallback("", "Rod_2", "ScriptArea_2", "UseRod_2", true); 
///Rod_2 = 2nd rod ///ScriptArea_2 is around the second hole 
AddUseItemCallback("", "Rod_3", "ScriptArea_3", "UseRod_3", true); 
///Rod_3 = 3rd rod ///ScriptArea_3 is around the third hole 
} 
 
void UseRod_1(string &in asItem, string &in asEntity) 
{ 
SetEntityActive("Rod_1_Static", true);	///Place a static rod inside the hole inactive 
RemoveItem("Rod_1);	///This will remove it from the inventory 
 
AddLocalVarInt("3_Rods", 1); ///Adds 1 to the LocalVarInt 
 
if(GetLocalVarInt("3_Rods") == 3) ///Check if the LocalVarInt = 3 
{ 
///Do stuff when all 3 has been placed 
} 
} 
 
void UseRod_2(string &in asItem, string &in asEntity) 
{ 
SetEntityActive("Rod_2_Static", true); 
RemoveItem("Rod_2); 
 
AddLocalVarInt("3_Rods", 1); ///Adds 1 to the LocalVarInt 
 
if(GetLocalVarInt("3_Rods") == 3) ///Check if the LocalVarInt = 3 
{ 
///Do stuff when all 3 has been placed 
} 
} 
 
void UseRod_3(string &in asItem, string &in asEntity) 
{ 
SetEntityActive("Rod_3_Static", true); 
RemoveItem("Rod_3); 
 
AddLocalVarInt("3_Rods", 1); ///Adds 1 to the LocalVarInt 
 
if(GetLocalVarInt("3_Rods") == 3) ///Check if the LocalVarInt = 3 
{ 
///Do stuff when all 3 has been placed 
} 
} 
 
Everything with red color should be deleted
			 
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 06-12-2012, 03:27 PM  | 
	
		
	 | 
 
 
	
		
		BrooksyFC 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 329 
	Threads: 11 
	Joined: Jul 2011
	
 Reputation: 
6
		
	 | 
	
		
			
RE: Rod Puzzle 
			 
			
				Sweet. Thanks for the reply. I'll give it a try and post back on the results.
			 
			
			
 
Think A Little, Change A Lot 
			
		 |  
	 
 | 
 
	| 06-12-2012, 03:49 PM  | 
	
		
	 | 
 
 
	
		
		FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Rod Puzzle 
			 
			
				No problem   
			 
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 06-12-2012, 04:09 PM  | 
	
		
	 | 
 
 
	
		
		BrooksyFC 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 329 
	Threads: 11 
	Joined: Jul 2011
	
 Reputation: 
6
		
	 | 
	
		
			
RE: Rod Puzzle 
			 
			
				I've put in that code, but I keep getting an error on the first line. 
Say;s unexpected token for this line:
 { 
AddUseItemCallback("", "Rod_1", "ScriptArea_1", "UseRod_1", true); 
///Rod_1 = 1st rod ///ScriptArea_1 is around the first hole 
AddUseItemCallback("", "Rod_2", "ScriptArea_2", "UseRod_2", true); 
///Rod_2 = 2nd rod ///ScriptArea_2 is around the second hole 
AddUseItemCallback("", "Rod_3", "ScriptArea_3", "UseRod_3", true); 
///Rod_3 = 3rd rod ///ScriptArea_3 is around the third hole 
}
  
That first "{"
			  
			
			
 
Think A Little, Change A Lot 
			
		 |  
	 
 | 
 
	| 06-12-2012, 06:57 PM  | 
	
		
	 | 
 
 
	
		
		FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Rod Puzzle 
			 
			
				at the void OnStart() ?? Hm.. i dont know.... eh..
			 
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 06-12-2012, 07:17 PM  | 
	
		
	 | 
 
 
	
		
		Adny 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,766 
	Threads: 6 
	Joined: Mar 2012
	
 Reputation: 
173
		
	 | 
	
		
			
RE: Rod Puzzle 
			 
			
				Got it, missing right quotation on Rod 1-3 in the RemoveItem area in each UseRod 1-3 function. 
 
 
void UseRod_1(string &in asItem, string &in asEntity) 
{ 
SetEntityActive("Rod_1_Static", true);	///Place a static rod inside the hole inactive 
RemoveItem("Rod_1);	///This will remove it from the inventory 
 
should be  
 
RemoveItem("Rod_1");  
 
 
Do that for all 3 rod scripts.
			 
			
			
 
I rate it 3 memes. 
			
		 |  
	 
 | 
 
	| 06-12-2012, 07:28 PM  | 
	
		
	 | 
 
 
	
		
		FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Rod Puzzle 
			 
			
				Woops.. My bad   
			 
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 06-12-2012, 07:55 PM  | 
	
		
	 | 
 
 
	
		
		BrooksyFC 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 329 
	Threads: 11 
	Joined: Jul 2011
	
 Reputation: 
6
		
	 | 
	
		
			
RE: Rod Puzzle 
			 
			
				 (06-12-2012, 07:28 PM)andyrockin123 Wrote:  Got it, missing right quotation on Rod 1-3 in the RemoveItem area in each UseRod 1-3 function. 
 
 
void UseRod_1(string &in asItem, string &in asEntity) 
{ 
SetEntityActive("Rod_1_Static", true);	///Place a static rod inside the hole inactive 
RemoveItem("Rod_1);	///This will remove it from the inventory 
 
should be  
 
RemoveItem("Rod_1");  
 
 
Do that for all 3 rod scripts. Nice one, I'll give that a try after work and see if that works   
			 
			
			
 
Think A Little, Change A Lot 
			
		 |  
	 
 | 
 
	| 06-13-2012, 08:44 AM  | 
	
		
	 | 
 
 
	
		
		BrooksyFC 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 329 
	Threads: 11 
	Joined: Jul 2011
	
 Reputation: 
6
		
	 | 
	
		
			
RE: Rod Puzzle 
			 
			
				Right, I've done that, it all works. But I can't seem to put the rods in the holes of the machine.
			 
			
			
 
Think A Little, Change A Lot 
			
		 |  
	 
 | 
 
	| 06-13-2012, 08:47 PM  | 
	
		
	 | 
 
 
	 
 |