Frictional Games Forum (read-only)
[SOLVED]After 3 Area Collides, something should happen - 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)
+--- Thread: [SOLVED]After 3 Area Collides, something should happen (/thread-6874.html)



[SOLVED]After 3 Area Collides, something should happen - Viperdream - 03-13-2011

But how do I do that? :<

I know I could add a value for every collide. But how do I add a value?

I'm stuck :<


RE: After 3 Area Collides, something should happen - Pandemoneus - 03-13-2011

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "Area1", "TaDa", true, 1);
AddEntityCollideCallback("Player", "Area2", "TaDa", true, 1);
AddEntityCollideCallback("Player", "Area3", "TaDa", true, 1);
}

void TaDa(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("counter", 1);
if (GetLocalVarInt("counter") >= 3) {
// awesome stuff happens
}
}



RE: After 3 Area Collides, something should happen - Viperdream - 03-13-2011

It works now Smile

Thanks a lot!