Your AddEntityCollideCallback has no spaces between the commas and the
abDeleteOnCollide and alStates are missing. Your callback syntax is wrong too and should be
void TurnOffLight(string &in asParent, string &in asChild, int alState) Check this out:
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
alState: 1 = enter, -1 = leave
asParentName - internal name of main object
asChildName - internal name of object that collides with main object (asterix (*) NOT supported!)
asFunction - function to call
abDeleteOnCollide - determines whether the callback after it was called
alStates - 1 = only enter, -1 = only leave, 0 = both
-----------------
In your case with the lamp, you should use:
SetLampLit(string& asName, bool abLit, bool abEffects); in stead of
SetLightVisible(string& asLightName, bool abVisible); , (there is a difference between lamps and lights) do not forget to put in your lights internal name at "string& asName".
-----------------
Change all the red stuff:
void OnStart()
{
AddEntityCollideCallback("Player", "
Script_area_name", "
Function_to_call", true, 1);
AddDebugMessage("OnStart!", false);
}
void OnEnter()
{
AddDebugMessage("OnEnter!", false);
}
void OnLeave()
{
AddDebugMessage("OnLeave!", false);
}
void TurnOffLight(string &in asParent, string &in asChild, int alState)
{
SetLampLit("
Name_of_your_lamp", false, false);
}
----------
I have not checked if this works, if it does not, make a comment