Frictional Games Forum (read-only)
collide with scriptarea not working - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+---- Forum: Technical Support (https://www.frictionalgames.com/forum/forum-37.html)
+---- Thread: collide with scriptarea not working (/thread-56765.html)



collide with scriptarea not working - Obsolete - 04-21-2020

Hi,

I was wondering if anyone could help me with a problem in my script file. I wanted to add a collidecallback between the player and a scriptarea that results in the players death. However, after all my hard work. Testing it didn't give promising results. When the player interacts with the scriptarea nothing happens! Can somebody help me out? here is my script:

/////SOME EXPLANATION: 

upon entering the area, the screen should fade out, the player shouldn't be in control anymore, and a timer is added which ultimately scripts for the dead of the player. But nothing happens. I've already checked the name of the scriptarea in the .map file, and that is correct.

There are a whole bunch of other things in this script file that I removed, like multiple collidecallbacks, teleportarea's, interactcallbacks etc. on the start of the map, they all work fine. But for now they are removed to not make this an endless post of scripttext.//////////

void OnStart()


AddEntityCollideCallback("Player", "AreaDrown", "DrownDeath", false, 1);
}



void Drowndeath(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
FadeOut(1);
AddTimer("Deathtimer", 1.5, "YourDeath");
}

void YourDeath(string &in asTimer)
{
SetDeathHint("DeadHints", "Drowned");
DisableDeathStartSound();
AddPlayerHealth(-200);

}


RE: collide with scriptarea not working - Mudbill - 04-23-2020

You have inconsistent casing for "DrownDeath". Your function is named "Drowndeath".

Edit: I see you got your answer in the other thread you posted. https://www.frictionalgames.com/forum/thread-56766.html

I'm closing this one.