laakkone
Junior Member
Posts: 3
Threads: 1
Joined: Sep 2013
Reputation:
0
|
"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.
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 |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
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 |
|
Kurton
Senior Member
Posts: 533
Threads: 8
Joined: Oct 2010
Reputation:
16
|
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 |
|
laakkone
Junior Member
Posts: 3
Threads: 1
Joined: Sep 2013
Reputation:
0
|
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 |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: "Area" behaving like an item to be picked up.
Do you have an interact callback set for the area in the level editor?
|
|
09-22-2013, 04:20 AM |
|
laakkone
Junior Member
Posts: 3
Threads: 1
Joined: Sep 2013
Reputation:
0
|
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
|
|
09-22-2013, 08:38 AM |
|
|