Frictional Games Forum (read-only)
Strange script black box error - 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: Strange script black box error (/thread-9405.html)



Strange script black box error - Grimstoll - 07-27-2011

Whenever a certain part of my script runs, a blackbox error pops up, and the game shuts down... The game loads up properly, so it's not a syntax error, but there is something in my script what the game obviously doesn't like, can anyone help me out?

Basic Layout (I've hidden some stuff to avoid spoilers)
Code:
void Func(string &in asParent, string &in asChild, int alState)
{
    if(asParent=="Entity_1"){
        if(asChild=="desk"){ // Do Stuff  }

        else{ // Do other stuff }    

    }

    else if(asParent=="Entity_2"){
        AddLocalVarInt("Number", 1);
        if(GetLocalVarInt("Number")==3){ // Do more Stuff }
    }
}

Why does it give me a black box error when executing this code? Have I done something unusual? the 'Do stuff' parts are just ordinary things, such as playsoundatentity, and createparticlesystematentity Thanks for the help!

Edit: Everythings OK now, i fixed it, i think it was because i never put return; at the bottom.