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
"Area" behaving like an item to be picked up.
laakkone Offline
Junior Member

Posts: 3
Threads: 1
Joined: Sep 2013
Reputation: 0
#1
"Area" behaving like an item to be picked up.

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 !
(This post was last modified: 09-22-2013, 08:38 AM by laakkone.)
09-21-2013, 07:11 PM
Find Reply
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: "Area" behaving like an item to be picked up.

Can you post your script for the map please?
(This post was last modified: 09-21-2013, 07:37 PM by Statyk.)
09-21-2013, 07:37 PM
Find Reply
Kurton Offline
Senior Member

Posts: 533
Threads: 8
Joined: Oct 2010
Reputation: 16
#3
RE: "Area" behaving like an item to be picked up.

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

09-21-2013, 07:42 PM
Find Reply
laakkone Offline
Junior Member

Posts: 3
Threads: 1
Joined: Sep 2013
Reputation: 0
#4
RE: "Area" behaving like an item to be picked up.

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?

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()
{
}
09-21-2013, 08:43 PM
Find Reply
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: "Area" behaving like an item to be picked up.

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

Tutorials: From Noob to Pro
09-22-2013, 04:20 AM
Website Find Reply
laakkone Offline
Junior Member

Posts: 3
Threads: 1
Joined: Sep 2013
Reputation: 0
#6
RE: "Area" behaving like an item to be picked up.

(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
09-22-2013, 08:38 AM
Find Reply




Users browsing this thread: 1 Guest(s)