| 
		
	
		| ClayPigeon   Member
 
 Posts: 214
 Threads: 13
 Joined: Mar 2012
 Reputation: 
8
 | 
			| AddUseItemCallback on entities that are not doors/chests 
 
				Hey. I was wondering, how could I use AddUseItemCallback on entities that are NOT doors, chests, level doors and so on? E.G: Using a key on a table.
			 |  |  
	| 03-22-2013, 10:06 PM |  |  
	
		| Wapez   Senior Member
 
 Posts: 360
 Threads: 37
 Joined: Mar 2012
 Reputation: 
19
 | 
			| RE: AddUseItemCallback on entities that are not doors/chests 
 
				Same way. AddUseItemCallback("", "key_1", "table_1", "UsedKeyOnTable", true); 
 |  |  
	| 03-22-2013, 10:18 PM |  |  
	
		| ClayPigeon   Member
 
 Posts: 214
 Threads: 13
 Joined: Mar 2012
 Reputation: 
8
 | 
			| RE: AddUseItemCallback on entities that are not doors/chests 
 
				 (03-22-2013, 10:18 PM)Wapez Wrote:  Same way.
 
 AddUseItemCallback("", "key_1", "table_1", "UsedKeyOnTable", true); 
 
I wish angelscript thought the same way but frankly, it doesn't :/  
When I try doing this I end up getting the "No object to use item on!" message.
			 |  |  
	| 03-22-2013, 10:20 PM |  |  
	
		| Wapez   Senior Member
 
 Posts: 360
 Threads: 37
 Joined: Mar 2012
 Reputation: 
19
 | 
			| RE: AddUseItemCallback on entities that are not doors/chests 
 
				Then I advice you add a scriptarea around the object you want the player to use the item on, in this case the table. Then you can use the key on the scriptarea, but it feels like the table. AddUseItemCallback("", "key_1", "scriptarea_1", "UsedKeyOnTable", true); 
 |  |  
	| 03-22-2013, 10:33 PM |  |  
	
		| ClayPigeon   Member
 
 Posts: 214
 Threads: 13
 Joined: Mar 2012
 Reputation: 
8
 | 
			| RE: AddUseItemCallback on entities that are not doors/chests 
 
				 (03-22-2013, 10:33 PM)Wapez Wrote:  Then I advice you add a scriptarea around the object you want the player to use the item on, in this case the table. Then you can use the key on the scriptarea, but it feels like the table.
 
 AddUseItemCallback("", "key_1", "scriptarea_1", "UsedKeyOnTable", true); 
 
Actually I tried doing this before the actual table idea but it didn't work as well. Any other ideas?
			 |  |  
	| 03-22-2013, 10:36 PM |  |  
	
		| Wapez   Senior Member
 
 Posts: 360
 Threads: 37
 Joined: Mar 2012
 Reputation: 
19
 | 
			| RE: AddUseItemCallback on entities that are not doors/chests 
 
				I don't see why it shouldn't work?
			 
 |  |  
	| 03-22-2013, 10:39 PM |  |  
	
		| ClayPigeon   Member
 
 Posts: 214
 Threads: 13
 Joined: Mar 2012
 Reputation: 
8
 | 
			| RE: AddUseItemCallback on entities that are not doors/chests 
 
				 (03-22-2013, 10:39 PM)Wapez Wrote:  I don't see why it shouldn't work? 
Me neither but it just won't...
			 |  |  
	| 03-22-2013, 10:40 PM |  |  
	
		| NaxEla   Senior Member
 
 Posts: 415
 Threads: 5
 Joined: Dec 2012
 Reputation: 
28
 | 
			| RE: AddUseItemCallback on entities that are not doors/chests 
 
				 (03-22-2013, 10:36 PM)ClayPigeon Wrote:   (03-22-2013, 10:33 PM)Wapez Wrote:  Then I advice you add a scriptarea around the object you want the player to use the item on, in this case the table. Then you can use the key on the scriptarea, but it feels like the table.
 
 AddUseItemCallback("", "key_1", "scriptarea_1", "UsedKeyOnTable", true); 
 Actually I tried doing this before the actual table idea but it didn't work as well. Any other ideas?
 
In the properties for the area, there's a box that you need to tick so that it lets you use items on the area. I can't remember what it's called though, sorry.
			 
 |  |  
	| 03-22-2013, 10:41 PM |  |  
	
		| Wapez   Senior Member
 
 Posts: 360
 Threads: 37
 Joined: Mar 2012
 Reputation: 
19
 | 
			| RE: AddUseItemCallback on entities that are not doors/chests 
 
				Oh yes, I forgot to tell you. In the area tab there is an option called "ItemInteraction". You have to check that.
			 
 |  |  
	| 03-22-2013, 10:44 PM |  |  
	
		| ClayPigeon   Member
 
 Posts: 214
 Threads: 13
 Joined: Mar 2012
 Reputation: 
8
 | 
			| RE: AddUseItemCallback on entities that are not doors/chests 
 
				 (03-22-2013, 10:41 PM)NaxEla Wrote:   (03-22-2013, 10:36 PM)ClayPigeon Wrote:   (03-22-2013, 10:33 PM)Wapez Wrote:  Then I advice you add a scriptarea around the object you want the player to use the item on, in this case the table. Then you can use the key on the scriptarea, but it feels like the table.
 
 AddUseItemCallback("", "key_1", "scriptarea_1", "UsedKeyOnTable", true); 
 Actually I tried doing this before the actual table idea but it didn't work as well. Any other ideas?
 In the properties for the area, there's a box that you need to tick so that it lets you use items on the area. I can't remember what it's called though, sorry.
 
Oh! 
It works now, thank you so much    |  |  
	| 03-22-2013, 10:45 PM |  |  |