Frictional Games Forum (read-only)
Reversing collide callback - 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: Reversing collide callback (/thread-14339.html)



Reversing collide callback - Damascus - 03-29-2012

I'm trying to create an EntityCollideback that triggers when something enters OR leaves a script area. I'm trying to test it by having a light turn on or off depending on whether the object is placed there or not.

AddEntityCollideCallback("EarthRock", "EarthArea", "PlaceEarth", false, 1);

void PlaceEarth(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
FadeLightTo("PointLight_9", 0.0f, 0.7f, 0.0f, 1.0f, -1, 1);
}
else
{
FadeLightTo("PointLight_9", 0.0f, 0.0f, 0.0f, 1.0f, -1, 1);
}
}

For the life of me i can't figure out what's wrong, but the light isn't turning off when I remove the object. I copied the syntax exactly from an area that damaged your sanity if you were standing inside it, which worked perfectly.

Never mind, I naturally solved it myself moments after posting the thread.