Frictional Games Forum (read-only)
Code not working correctly! - 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: Code not working correctly! (/thread-24254.html)



Code not working correctly! - Artyom - 12-30-2013

Code:
void OnStart()
    {
    PlayMusic("01_amb_darkness", true, 0.7f, 1, 0, false);
    AddEntityCollideCallback("player", "ScriptArea_2", "Fade", true, 1);
    }

void Fade(string &in asParent, string &in asChild, int alState)
{
    FadeOut(0.5);
}

Why is this not working!?! The music plays and I don't get any error messages... I have a script box in the map with the designated name so it should work but it is not...


RE: Code not working correctly! - daortir - 12-30-2013

Try spelling player "Player". The Engine understands you're talking about the player only if it is spelled Player.
I mean with a capital P.


RE: Code not working correctly! - Artyom - 12-30-2013

Omg I didn't realize... been to long since I used angelscript >.<

Thanks anyways! Big Grin