Frictional Games Forum (read-only)
"Area" behaving like an item to be picked up. - 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: "Area" behaving like an item to be picked up. (/thread-23309.html)



"Area" behaving like an item to be picked up. - laakkone - 09-21-2013

So yeah, I'm new with Amnesia editor, but I managed to create Area, where music starts playing when you step into it, and stops when you step out. But thats not the thing.

When I'm inside of the area box, the hand appears like there is item to be picked up, like I was in a huge invisible box with no collision, but being able to touch it. Which leads to that I can't touch anything, e.g. open doors when I'm inside of the Area. I got two screenshots to show you the problem.

[Image: 2013-09-21_00001.jpg]
[Image: 2013-09-21_00002.jpg]

The script fills the whole room on the second picture where player is standing. I hope you guys know how to fix this.

Thanks !


RE: "Area" behaving like an item to be picked up. - Statyk - 09-21-2013

Can you post your script for the map please?


RE: "Area" behaving like an item to be picked up. - Kurton - 09-21-2013

This happens if the area type is set to 'Examine' instead of 'Script'


RE: "Area" behaving like an item to be picked up. - laakkone - 09-21-2013

Kurton Wrote: This happens if the area type is set to 'Examine' instead of 'Script'
It is set to 'Script'

Statyk Wrote: Can you post your script for the map please?

Code:
void OnStart()
{
    AddUseItemCallback("", "key1", "work_desk_door_1", "key_desk", true);
    AddUseItemCallback("", "crowbar", "mansion_1", "UsedCrowbarOnDoor", true);
    AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
    AddEntityCollideCallback("Player", "music_script", "musictest", false, 0);
}


void musictest(string &in asParent, string &in asChild, int alState)
{
        if(alState == 1)
        {
        PlayMusic("18_puzzle_valve01.ogg", false, 1, 1, 1, true);
        }
        if(alState == -1)
        {
        StopMusic(1, 1);
        }
}



void DoorLockedPlayer(string &in entity)
{
    if(GetSwingDoorLocked("work_desk_door_1") == true)
    {

        SetMessage("Messages", "desk_locked_1", 0);

    }
}


void key_desk(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked(asEntity, false, true);
    PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
    RemoveItem(asItem);
}

void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar");
}


void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.ogg", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}


void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
    AddPlayerSanity(25);
    SetSwingDoorLocked("mansion_1", false, true);
    AddPropImpulse("mansion_1", 0, 0, -50, "World");
    SetSwingDoorDisableAutoClose("mansion_1", true);
    SetSwingDoorClosed("mansion_1", false, false);
    SetMoveObjectState("mansion_1", 1);
    PlaySoundAtEntity("", "break_wood_metal.ogg", "AreaBreakEffect", 0, false);
    CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
    SetEntityActive("crowbar_joint_1", false);
    SetLocalVarInt("Door", 1);
}


void OnEnter()

{
    PlayMusic("01_amb_darkness.ogg", true, 1, 1, 0, true);
}

void OnLeave()
{
}



RE: "Area" behaving like an item to be picked up. - Your Computer - 09-22-2013

Do you have an interact callback set for the area in the level editor?


RE: "Area" behaving like an item to be picked up. - laakkone - 09-22-2013

(09-22-2013, 04:20 AM)Your Computer Wrote: Do you have an interact callback set for the area in the level editor?
Dang it. That was it, thanks!! I thought I had to give a name for it in order to script work, but seems like it works without it aswell Big Grin