| Damascus   Senior Member
 
 Posts: 646
 Threads: 118
 Joined: Mar 2012
 Reputation: 
29
 | 
			| Grabbable feather 
 
				I want to make a monster disappear immediately upon looking away from it, but the only scripts I can find trigger a function when you look AT something instead. Is there a way to do this?
 Also, I've tried making a pen_feather that you can grab and carry around, but when I pick it up it seems to spin around uncontrollably. What could be causing this?
 
 
 
				
(This post was last modified: 03-30-2012, 12:07 AM by Damascus.)
 |  | 
	| 03-29-2012, 07:53 PM |  | 
	
		| Your Computer   SCAN ME!
 
 Posts: 3,456
 Threads: 32
 Joined: Jul 2011
 Reputation: 
235
 | 
			| RE: Entity disappearing when you look away + grabbable feather 
 
				SetEntityPlayerLookAtCallback.
			 
 |  | 
	| 03-29-2012, 08:50 PM |  | 
	
		| Damascus   Senior Member
 
 Posts: 646
 Threads: 118
 Joined: Mar 2012
 Reputation: 
29
 | 
			| RE: Entity disappearing when you look away + grabbable feather 
 
				Calls a function when the player looks at a certain entity.
 
 Callback syntax: void MyFunc(string &in asEntity, int alState)
 
 
 alState: 1 = looking, -1 = not looking
 
 
 
 
 asName - internal name
 
 
 asCallback - function to call
 
 
 abRemoveWhenLookedAt - determines whether the callback should be removed when the player looked at the entity
 
 So in the function called, do I put an "if(alState == -1)" in there? Or is it too late, with the function exectued as soon as you look at it and not able to do anything else?
 
 
 
 |  | 
	| 03-29-2012, 09:48 PM |  | 
	
		| Damascus   Senior Member
 
 Posts: 646
 Threads: 118
 Joined: Mar 2012
 Reputation: 
29
 | 
			| RE: Grabbable feather 
 
				Well I played with it and got it to work this way.
 Still need some advice on picking up a feather without it spinning like a madman.
 
 
 |  | 
	| 03-30-2012, 12:07 AM |  |