Frictional Games Forum (read-only)
Trigger lamps - 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: Trigger lamps (/thread-9188.html)



Trigger lamps - Glain - 07-17-2011

Hey Guys i need some help

I want 4 Lights to be lit as soon as you get trough a door.
These an area next to the door which should start the event which turns the lights on + gives you sanity/plays sound.
Heres my code:
Code:
{
AddEntityCollideCallback("Player", "TriggerLight", "soundsan", true, 1);
AddEntityCollideCallback("Player", "TriggerLight", "lightson", true, 1);
}

void soundsan(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);  
GiveSanityDamage(5.0f, true);
}
void lightson(string& asName, bool abLit, bool abEffects)
{
SetLampLit("candle_*",true, false);
}
It isn't working for me.
Could someone help me?


RE: Trigger lamps - Zypherzemus - 07-17-2011

You don't need two callback commands for the same script area, all you need to do is delete one callback command and move it's callback function into the other's.
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "TriggerLight", "soundsan", true, 1);
}

void soundsan(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);  
GiveSanityDamage(5.0f, true);
SetLampLit("candle_*", true, false);
}


void OnEnter()
{
}

void OnLeave()
{
}
and for the lamp, is "candle_*" what you really named it?


RE: Trigger lamps - Glain - 07-17-2011

No i've got candle_1,candle_2,candle_...
Thanks Smile


RE: Trigger lamps - palistov - 07-17-2011

Make sure the script area is named properly. If it still isn't working, close Amnesia, delete the map cache file in your map's folder, then re-launch.