Frictional Games Forum (read-only)

Full Version: Strange script black box error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.