Frictional Games Forum (read-only)

Full Version: How do you do that pls?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Skip to 0:44 of this video http://www.youtube.com/watch?v=4kpctbHXstg to see what I'm talking about. How do you do that with the door and screen and sound, can anybody give me the whole code for that and I'll fill in the name and entity and etc? and pls tell me what I should even do in the level editor pls Undecided
Go ahead, pick one.

Spoiler below!

You don't need to do anything on this.
PHP Code:
int tits GetSwingDoorState("DoorName");
if(
tits == 0)
{
GiveSanityDamage(15true);



Spoiler below!

Put a script area somewhere in the door's swing path.
PHP Code:
void OnStart()
{
AddEntityCollideCallback("DoorName""ScriptAreaName""SanityDec"true1);
}

void SanityDec(string &in asParentstring &in asChildint alState)
{
GiveSanityDamage(15true);


What's the difference between the 2 and I already have a void on start so what do i do? and what's a sanity dec, sorry for being like I know nothing but I really don't know what sanitydec does
Lol at that first code.

Code 1: When the door closes (for the first time) it will drain your sanity. You just change doorname to the name of your door in the Level Editor.

Code 2: Name a Scriptarea something and the door something, then place the Scriptarea somewhere within the door's closing path. Change the doorname and ScriptAreaname in the coding as appropriate.

SanityDec is nothing important except that function is called when the Door and Scriptarea collide. You don't need to change it.
Thanks so much buddy, my custom story would be nothing without that code, thank you so much for finding it JustAnotherPlayer Smile