Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help AddUseItemCallback on entities that are not doors/chests
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#1
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
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#2
RE: AddUseItemCallback on entities that are not doors/chests

Same way.

PHP Code: (Select All)
AddUseItemCallback("""key_1""table_1""UsedKeyOnTable"true); 

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
03-22-2013, 10:18 PM
Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#3
RE: AddUseItemCallback on entities that are not doors/chests

(03-22-2013, 10:18 PM)Wapez Wrote: Same way.

PHP Code: (Select All)
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
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#4
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.

PHP Code: (Select All)
AddUseItemCallback("""key_1""scriptarea_1""UsedKeyOnTable"true); 

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
03-22-2013, 10:33 PM
Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#5
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.

PHP Code: (Select All)
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
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#6
RE: AddUseItemCallback on entities that are not doors/chests

I don't see why it shouldn't work?

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
03-22-2013, 10:39 PM
Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#7
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
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#8
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.

PHP Code: (Select All)
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.

In Ruins [WIP]
03-22-2013, 10:41 PM
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#9
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.

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
03-22-2013, 10:44 PM
Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#10
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.

PHP Code: (Select All)
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 Smile
03-22-2013, 10:45 PM
Find




Users browsing this thread: 2 Guest(s)