Frictional Games Forum (read-only)
How do you do that pls? - 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: How do you do that pls? (/thread-24515.html)



How do you do that pls? - Radical Batz - 02-02-2014

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


RE: How do you do that pls? - PutraenusAlivius - 02-02-2014

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);





RE: How do you do that pls? - Radical Batz - 02-02-2014

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


RE: How do you do that pls? - Romulator - 02-02-2014

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.


RE: How do you do that pls? - Radical Batz - 02-02-2014

Thanks so much buddy, my custom story would be nothing without that code, thank you so much for finding it JustAnotherPlayer Smile