Frictional Games Forum (read-only)
Could not load script file: The same names and parameters! HELP - 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: Could not load script file: The same names and parameters! HELP (/thread-16810.html)



Could not load script file: The same names and parameters! HELP - ooadrianoo - 07-07-2012

I am new at scripting and in HPL. Can anyone tell me, where the same names and parameters are?

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "Scary_Area_1", "Scary_1", true, 1);
AddEntityCollideCallback("Player", "Scary_Area_2", "Scary_2", true, 1);
}

void Scary1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("1", true);
SetEntityActive("2", true);
SetEntityActive("3", true);
SetEntityActive("4", true);
SetEntityActive("5", true);
SetEntityActive("6", true);
SetEntityActive("7", true);
SetEntityActive("8", true);
SetEntityActive("9", true);
SetEntityActive("10", true);
SetEntityActive("11", true);
SetEntityActive("12", true);
GiveSanityDamage(5.0f, true);
}

void Scary1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse_male_4", false);
AddTimer("", 3.8f, "Timer_1");    
}

void Timer_1(string &in asTimer)
{
    SetEntityActive("corpse_male_4", true);
     AddPropImpulse("corpse_male_4", 0, 0, -10, "world");
     GiveSanityDamage(5.0f, true);
}















////////////////////////////
// Run when leaving map
void OnLeave()
{



RE: Could not load script file: The same names and parameters! HELP - Adny - 07-07-2012

You wrote the name of the functions incorrectly; they didn't match the functions you made in the callback:


void OnStart()
{
AddEntityCollideCallback("Player", "Scary_Area_1", "Scary_1", true, 1);
AddEntityCollideCallback("Player", "Scary_Area_2", "Scary_2", true, 1);
}

void Scary_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("1", true);
SetEntityActive("2", true);
SetEntityActive("3", true);
SetEntityActive("4", true);
SetEntityActive("5", true);
SetEntityActive("6", true);
SetEntityActive("7", true);
SetEntityActive("8", true);
SetEntityActive("9", true);
SetEntityActive("10", true);
SetEntityActive("11", true);
SetEntityActive("12", true);
GiveSanityDamage(5.0f, true);
}

void Scary_2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse_male_4", false);
AddTimer("", 3.8f, "Timer_1");
}

void Timer_1(string &in asTimer)
{
SetEntityActive("corpse_male_4", true);
AddPropImpulse("corpse_male_4", 0, 0, -10, "world");
GiveSanityDamage(5.0f, true);
}

void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


RE: Could not load script file: The same names and parameters! HELP - ooadrianoo - 07-07-2012

Thank you Smile