Frictional Games Forum (read-only)
[SCRIPT] Script not working - 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: [SCRIPT] Script not working (/thread-17629.html)



Script not working - aceuniverse - 08-10-2012

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);
}


RE: Script not working - Adny - 08-10-2012

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.


RE: Script not working - aceuniverse - 08-10-2012

it worked perfectly! Thanks so much!