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
Script Help I have a SetSwingDoorClosed problem please help.
Atilla280 Offline
Junior Member

Posts: 24
Threads: 6
Joined: Jul 2012
Reputation: 1
#1
I have a SetSwingDoorClosed problem please help.

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
(This post was last modified: 07-08-2012, 06:04 PM by Atilla280.)
07-08-2012, 06:04 PM
Find
ApeCake Offline
Member

Posts: 116
Threads: 20
Joined: Jun 2012
Reputation: 4
#2
RE: I have a SetSwingDoorClosed problem please help.

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.
07-08-2012, 06:08 PM
Find
Atilla280 Offline
Junior Member

Posts: 24
Threads: 6
Joined: Jul 2012
Reputation: 1
#3
RE: I have a SetSwingDoorClosed problem please help.

Ok thanks man. Also, do you know how to do the Weak Wall script?
07-08-2012, 06:19 PM
Find
JMFStorm Offline
Member

Posts: 205
Threads: 8
Joined: Aug 2011
Reputation: 28
#4
RE: I have a SetSwingDoorClosed problem please help.

(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 -.-

07-08-2012, 07:03 PM
Find
Atilla280 Offline
Junior Member

Posts: 24
Threads: 6
Joined: Jul 2012
Reputation: 1
#5
RE: I have a SetSwingDoorClosed problem please help.

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?
07-08-2012, 09:13 PM
Find
EXAWOLT Offline
Member

Posts: 113
Threads: 14
Joined: Apr 2012
Reputation: 3
#6
RE: I have a SetSwingDoorClosed problem please help.

the wall with missing bricks= entities/special/cell_breakable_wall

simply nuff said




07-08-2012, 09:19 PM
Find
Atilla280 Offline
Junior Member

Posts: 24
Threads: 6
Joined: Jul 2012
Reputation: 1
#7
RE: I have a SetSwingDoorClosed problem please help.

Thanks EXAWOLT

You too JMFStorm
(This post was last modified: 07-08-2012, 09:33 PM by Atilla280.)
07-08-2012, 09:31 PM
Find




Users browsing this thread: 2 Guest(s)