Frictional Games Forum (read-only)

Full Version: I have a SetSwingDoorClosed problem please help.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
Ok thanks man. Also, do you know how to do the Weak Wall script?
(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 -.-
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?
the wall with missing bricks= entities/special/cell_breakable_wall
Thanks EXAWOLT

You too JMFStorm