Frictional Games Forum (read-only)
Script didn't work... - 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 didn't work... (/thread-8955.html)



Script didn't work... - H. Filipe - 07-04-2011

Hy i am new in this forum and in Scripting too.

I Have a problem with my scripts, i want a lamp to turn on when collide with a area called lampson.

I think the script is right.

Code:
void Lamps(string &in asItem, string &in asEntity)
{
     SetLampLit("chandelier_nice_1", false, false);
}

////////////////////////////
// Run On Enter
void OnEnter()
{
AddEntityCollideCallback("Player", "lampson", "Lamps", false, 1);
}

Where is the problem?Huh


RE: Script didn't work... - Kyle - 07-04-2011

It is best to have everything in the void OnStart() that you did not include...

Try this:

Code:
void OnStart()
{
     AddEntityCollideCallback("Player", "lampson", "Lamps", false, 1);
}
void Lamps(string &in asParent, string &in asChild, int alState)
{
     SetLampLit("chandelier_nice_1", false, false);
}

By the way, welcome to the forums!


RE: Script didn't work... - Janni1234 - 07-04-2011

Yeah.Kyles script is right Wink Welcome to the forums!


RE: Script didn't work... - H. Filipe - 07-04-2011

Thanks it works.Big Grin