Frictional Games Forum (read-only)
Slam Door script 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: Slam Door script help. (/thread-22190.html)



Slam Door script help. - GoreGrinder99 - 07-19-2013

I'm trying to set up a slam door script. This is what I have -

void OnStart()
{
AddEntityCollideCallback("Player", "slam_attic_1", "attic_slam_1", true, 1);
}
void slam_attic_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("attic_slam_1", 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);
}

slam_attic_1 is the script name and attic_slam_1 is the door name.


RE: Slam Door script help. - DeAngelo - 07-20-2013

In the initial callback you have the script area as "slam_attic_1" and the callback itself as "attic_slam_1"

In the second part you have the function as slam_attic_1, but that's your script area, your callback belongs there.


RE: Slam Door script help. - GoreGrinder99 - 07-20-2013

(07-20-2013, 12:13 AM)DeAngelo Wrote: In the initial callback you have the script area as "slam_attic_1" and the callback itself as "attic_slam_1"

In the second part you have the function as slam_attic_1, but that's your script area, your callback belongs there.

So, how should that look? lol Kinda raw with these scripts.


RE: Slam Door script help. - PutraenusAlivius - 07-20-2013

Code:
void OnStart()
{  
    AddEntityCollideCallback("Player", "slam_attic_1", "Attic_Slam", true, 1);
}
void Attic_Slam(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorClosed("attic_slam_1", 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);
}

The last string parameter and the parameter after the return_type (in this case void) is the function, not the door/script name.


RE: Slam Door script help. - GoreGrinder99 - 07-20-2013

(07-20-2013, 12:39 AM)JustAnotherPlayer Wrote:
Code:
void OnStart()
{  
    AddEntityCollideCallback("Player", "slam_attic_1", "Attic_Slam", true, 1);
}
void Attic_Slam(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorClosed("attic_slam_1", 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);
}

The last string parameter and the parameter after the return_type (in this case void) is the function, not the door/script name.

Thank you!