Frictional Games Forum (read-only)
Check LampLit? - 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: Check LampLit? (/thread-12743.html)



Check LampLit? - Tripication - 01-21-2012

hey guys, i was wondering how to call a check on weather 2 lamps have been lit or not.

E.g. Player lights 2 lamps, calls an easter egg sound.

I have a feeling it has something to do with GetPropIsInteractedWith(string& asName);, but i wouldn't know how to call that...

In other words, what would a callback be when a player uses a tinderbox?

Can i get a hand?
________________________
Edit, Nevermind, just figured it out|| SetEntityCallbackFunc(string& asName, string& asCallback);

void MyFunc(string &in asEntity, string &in OnIgnite)


RE: Check LampLit? - Unearthlybrutal - 01-21-2012

You could do variable and every time you lit a candle it adds one to it
and checks when its 2 ---> Easter egg sound


RE: Check LampLit? - Tripication - 01-21-2012

Thats exactly what i did.

void OnStart
{

SetEntityCallbackFunc("EE1", "AddAndCheck1");
SetEntityCallbackFunc("EE2", "AddAndCheck2");
}


void AddAndCheck1(string &in asEntity, string &in OnIgnite)
{
AddLocalVarInt("EE", 1);
EasterEgg();
}

void AddAndCheck2(string &in asEntity, string &in OnIgnite)
{
AddLocalVarInt("EE", 1);
EasterEgg();
}


void EasterEgg()
{
if (GetLocalVarInt("EE") == 2)
{
SetEntityActive("Otis", true);
}
}