Frictional Games Forum (read-only)

Full Version: Script not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
bear with me on this I'm brand new to scripting in Amensia

I wanted a lever ("lever_1") to collide with the area ("lever_area"), then cause lever_1, lever_mount to disappear while the real lever is activated


void onStart()
{
AddEntityCollideCallback("lever_1", "lever_area", "levervisible", false, 1);

}

void OnEnter(){
}

void OnLeave(){

}

void levervisible(string &in Parent, string &in Child, int state) {
SetEntityActive("lever_1", false);
SetEntityActive("lever_mount", false);
SetEntityActive("actual_lever", true);
}
the "onStart" needs to be spelled "OnStart", you also had a few bracket mistakes. Here ya go:


void OnStart()
{
AddEntityCollideCallback("lever_1", "lever_area", "levervisible", false, 1);
}

void OnEnter()
{

}

void OnLeave()
{

}

void levervisible(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("lever_1", false);
SetEntityActive("lever_mount", false);
SetEntityActive("actual_lever", true);
}


Hope that helped.
it worked perfectly! Thanks so much!