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
Cannot use item on area
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Cannot use item on area

I've placed a ScriptArea around a statue, and I want the player to use an item on the area to place it in the statue's hand. Here's the script:

PHP Code: (Select All)
void OnStart()
{
    
AddUseItemCallback("""copper_tube_1""PlaceArea""PlaceCopper1"true);
}

void PlaceCopper1(string &in asItemstring &in asEntity)
{
    
RemoveItem("copper_tube_1");
    
SetEntityActive("copper_tube_4"true);
    
PlaySoundAtEntity("""pick_pipe""copper_tube_4"0false);


The ScriptArea's Item Interaction box is checked, I've double/triple/quadruple-checked. The item interaction works when I designate any other entity, but it won't work with the ScriptArea.

(This post was last modified: 11-10-2012, 06:58 PM by Damascus.)
11-10-2012, 01:36 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Cannot use item on area

Since a factor of this issue is from the level editor, make sure you delete any map cache you may have.

I rate it 3 memes.
11-10-2012, 01:37 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#3
RE: Cannot use item on area

No map caches here.

11-10-2012, 02:07 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Cannot use item on area

Put "PlaceCopper1" in the entry box in PlayerInteractCallback and remove the function in the OnStart()
11-10-2012, 03:12 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#5
RE: Cannot use item on area

That only works for the player interacting with it, not using an item on it.

11-10-2012, 04:52 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Cannot use item on area

Have you checked that PlayerLookAtAutoRemove is Unchecked? Because always when i make a new area it is checked and that is kinda annoying

Trying is the first step to success.
11-10-2012, 01:06 PM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#7
RE: Cannot use item on area

Yeah, I unchecked that, but it's still not working.

I am very very desperate to get this working, so I added the map and script to my first post if anyone wants to download it and check it out. The copper tube is floating in the room near the clay tablet and has to be used on one of the statues.

If anyone can please please please help me out I will be eternally grateful. ;;

11-10-2012, 05:06 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#8
RE: Cannot use item on area

Have you tried to put the PlaceCopper1 function in "Player Interact Callback" ?

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
11-10-2012, 05:24 PM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#9
RE: Cannot use item on area

Like I said before, that only works when the player interacts with the area, not when an item is used on it.

11-10-2012, 05:29 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#10
RE: Cannot use item on area

Tested it, worked exactly as the script shows it should.

Tutorials: From Noob to Pro
11-10-2012, 05:31 PM
Website Find




Users browsing this thread: 1 Guest(s)