Frictional Games Forum (read-only)

Full Version: Check LampLit?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)
You could do variable and every time you lit a candle it adds one to it
and checks when its 2 ---> Easter egg sound
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);
}
}