Frictional Games Forum (read-only)
Cannot use item on area - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Cannot use item on area (/thread-19166.html)

Pages: 1 2


Cannot use item on area - Damascus - 11-10-2012

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:
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.


RE: Cannot use item on area - Adny - 11-10-2012

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


RE: Cannot use item on area - Damascus - 11-10-2012

No map caches here.


RE: Cannot use item on area - Statyk - 11-10-2012

Put "PlaceCopper1" in the entry box in PlayerInteractCallback and remove the function in the OnStart()


RE: Cannot use item on area - Damascus - 11-10-2012

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


RE: Cannot use item on area - FlawlessHappiness - 11-10-2012

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


RE: Cannot use item on area - Damascus - 11-10-2012

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. ;;


RE: Cannot use item on area - The chaser - 11-10-2012

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


RE: Cannot use item on area - Damascus - 11-10-2012

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


RE: Cannot use item on area - Your Computer - 11-10-2012

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