| 
		
	
		| ingedoom   Member
 
 Posts: 120
 Threads: 12
 Joined: Feb 2012
 Reputation: 
0
 | 
			| How to lock/unlock a chest 
 
				When i pick up my note i want the chest to unstuck, the map does not crash when i load it and all my other scripting works fine. It's just this thing i can't make happen ;(.
 
 Any suggestions? Am i making the setpropstuckstate wrong perhaps?
 
 
 Here is my callback
 
 
 void OnStart()
 {
 SetEntityCallbackFunc("bloodynote", "interactnote1");
 
 }
 
 
 
 
 Here is my function:
 
 
 void interactnote1(string &in asEntity, string &in type)
 {
 SetPropObjectStuckState("lanternchest", 0);
 }
 
 
				
(This post was last modified: 02-27-2012, 01:23 PM by ingedoom.)
 |  |  
	| 02-16-2012, 09:37 AM |  |  
	
		| Tripication   Member
 
 Posts: 172
 Threads: 19
 Joined: Dec 2011
 Reputation: 
6
 | 
			| RE: Why wont this callback work? (spot a bug) 
 
				void interactnote1(string &in asEntity, string &in OnPickup)	{
 SetPropObjectStuckState("lanternchest", 0);
 }
 
 
 Try that, i've been away a while, so ima bit rusty. but give it a shot 
 |  |  
	| 02-16-2012, 09:41 AM |  |  
	
		| Your Computer   SCAN ME!
 
 Posts: 3,456
 Threads: 32
 Joined: Jul 2011
 Reputation: 
235
 | 
			| RE: Why wont this callback work? (spot a bug) 
 
				SetPropObjectStuckState is more for buttons. I'd expect a chest to be a swing door and not anything that has stuck states.
			 
 |  |  
	| 02-16-2012, 09:47 AM |  |  
	
		| ingedoom   Member
 
 Posts: 120
 Threads: 12
 Joined: Feb 2012
 Reputation: 
0
 | 
			| RE: Why wont this callback work? (spot a bug) 
 
				 (02-16-2012, 09:47 AM)Your Computer Wrote:  SetPropObjectStuckState is more for buttons. I'd expect a chest to be a swing door and not anything that has stuck states. Yeah i would expect that too, but if you look in lvleditor then the chest has no toggle for "locked" but instead you can set stuckstate none max or min. Perhaps i should try make my callback unlock the door in the map just to make sure it works.... 
 
Which script do you suggest i use to make the chest "openable".???
			 
 |  |  
	| 02-16-2012, 10:33 AM |  |  
	
		| Your Computer   SCAN ME!
 
 Posts: 3,456
 Threads: 32
 Joined: Jul 2011
 Reputation: 
235
 | 
			| RE: Why wont this callback work? (spot a bug) 
 
				 (02-16-2012, 10:33 AM)pingo2 Wrote:  Yeah i would expect that too, but if you look in lvleditor then the chest has no toggle for "locked" but instead you can set stuckstate none max or min. Perhaps i should try make my callback unlock the door in the map just to make sure it works.... 
 Which script do you suggest i use to make the chest "openable".???
 
It's probably a lever then. Try SetLeverStuckState instead.
			 
 |  |  
	| 02-16-2012, 11:11 AM |  |  
	
		| ingedoom   Member
 
 Posts: 120
 Threads: 12
 Joined: Feb 2012
 Reputation: 
0
 | 
			| RE: Why wont this callback work? (spot a bug) 
 
				Thx guys i finally made it work! Here is the final script:
 //--------------------------------------------------
 void OnStart()
 {
 SetEntityCallbackFunc("bloodynote", "interactnote1");
 
 }
 
 
 void interactnote1(string &in asEntity, string &in OnPickUp)
 {
 SetLeverStuckState("lanternchest", 0, false);
 }
 //------------------------------------------------
 
 Btw i set the bool effect false, didint know what it was for. But if i set it to true then what do you guess would happen?
 
 |  |  
	| 02-16-2012, 11:46 AM |  |  
	
		| SilentStriker   Posting Freak
 
 Posts: 950
 Threads: 26
 Joined: Jul 2011
 Reputation: 
43
 | 
			| RE: Why wont this callback work? (spot a bug) 
 
				 (02-16-2012, 11:46 AM)pingo2 Wrote:  Thx guys i finally made it work! Here is the final script:
 //--------------------------------------------------
 void OnStart()
 {
 SetEntityCallbackFunc("bloodynote", "interactnote1");
 
 }
 
 
 void interactnote1(string &in asEntity, string &in OnPickUp)
 {
 SetLeverStuckState("lanternchest", 0, false);
 }
 //------------------------------------------------
 
 Btw i set the bool effect false, didint know what it was for. But if i set it to true then what do you guess would happen?
 Nothing special I think    
 |  |  
	| 02-16-2012, 12:13 PM |  |  
	
		| Your Computer   SCAN ME!
 
 Posts: 3,456
 Threads: 32
 Joined: Jul 2011
 Reputation: 
235
 | 
			| RE: Why wont this callback work? (spot a bug) 
 
				 (02-16-2012, 11:46 AM)pingo2 Wrote:  Btw i set the bool effect false, didint know what it was for. But if i set it to true then what do you guess would happen? 
Normally it plays a sound and (or) animation.
			 
 |  |  
	| 02-16-2012, 08:12 PM |  |  |