Frictional Games Forum (read-only)
[SCRIPT] I have a SetSwingDoorClosed problem please help. - 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: [SCRIPT] I have a SetSwingDoorClosed problem please help. (/thread-16840.html)



I have a SetSwingDoorClosed problem please help. - Atilla280 - 07-08-2012

I'm trying to make it so when they walk in an area the doors will be open before they can see them. Then when they get close to them I want all the doors to slam and lock except for one (door9). Here is my script any help would be very appreciated.




void OnStart()
{
AddEntityCollideCallback("Player", "CloseDoors", "CloseDoors", true, 1);
AddEntityCollideCallback("Player", "OpenDoors", "OpenDoors", true, 1);
//("Player", "Area", "Func", Disable?, 1 0 -1)
}

void OpenDoors(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door1", false, false);
SetSwingDoorClosed("door2", false, false);
SetSwingDoorClosed("door3", false, false);
SetSwingDoorClosed("door4", false, false);
SetSwingDoorClosed("door5", false, false);
SetSwingDoorClosed("door6", false, false);
SetSwingDoorClosed("door7", false, false);
SetSwingDoorClosed("door8", false, false);
SetSwingDoorClosed("door9", false, false);
}

void CloseDoors(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door1", true, true);
SetSwingDoorClosed("door2", true, true);
SetSwingDoorClosed("door3", true, true);
SetSwingDoorClosed("door4", true, true);
SetSwingDoorClosed("door5", true, true);
SetSwingDoorClosed("door6", true, true);
SetSwingDoorClosed("door7", true, true);
SetSwingDoorClosed("door8", true, true);
SetSwingDoorLocked("door1", true, true);
SetSwingDoorLocked("door2", true, true);
SetSwingDoorLocked("door3", true, true);
SetSwingDoorLocked("door4", true, true);
SetSwingDoorLocked("door5", true, true);
SetSwingDoorLocked("door6", true, true);
SetSwingDoorLocked("door7", true, true);
SetSwingDoorLocked("door8", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
// end
void OnEnter()
{

}
// end
void OnLeave()
{

}
// end


RE: I have a SetSwingDoorClosed problem please help. - ApeCake - 07-08-2012

If you want the doors to be open from the very beginning, go to the entity tab of each door in the Level Editor and put 1 in OpenAmount.


RE: I have a SetSwingDoorClosed problem please help. - Atilla280 - 07-08-2012

Ok thanks man. Also, do you know how to do the Weak Wall script?


RE: I have a SetSwingDoorClosed problem please help. - JMFStorm - 07-08-2012

(07-08-2012, 06:19 PM)Atilla280 Wrote: Ok thanks man. Also, do you know how to do the Weak Wall script?

Weak wall? There's one entity "mansionbase_secret_passage.ent". It breaks automaticly when you throw like a chair or something at it -.-


RE: I have a SetSwingDoorClosed problem please help. - Atilla280 - 07-08-2012

I don't think it's called "Weak Wall" but it's where you get like a hammer and use it and then it explodes I actually know how to do the script but what is the entity called that has a few bricks missing from it?


RE: I have a SetSwingDoorClosed problem please help. - EXAWOLT - 07-08-2012

the wall with missing bricks= entities/special/cell_breakable_wall


RE: I have a SetSwingDoorClosed problem please help. - Atilla280 - 07-08-2012

Thanks EXAWOLT

You too JMFStorm