void SetLanternLitCallback(string& asCallback);
Sets the function to call when the player uses his lantern.
Callback syntax: MyFunc(bool abLit)
I am using this code in my custom story, however it seems to be doing nothing and I'd like to think I didn't make an error in code. Any help would be appreciated!!! <3
void LanternTinderCheck(string& asCallback)
{
if (GetGlobalVarInt("Tinderboxes") == 0)
{
SetMessage("Chemical", "notinderboxes", 1);
SetLanternActive(false, true);
SetLanternDisabled(true);
AddTimer("", 1, "ReAllowLighting");
}
if (GetGlobalVarInt("Tinderboxes") > 0)
{
AddGlobalVarInt("Tinderboxes", -1);
SetMessage("Chemical", "lanternlit", 1);
SetLanternLitCallback("LanternTinderCheck");
}
}
void ReAllowLighting(string &in asTimer)
{
SetLanternDisabled(false);
SetLanternLitCallback("LanternTinderCheck");
}
void OnStart()
{
SetLanternLitCallback("LanternTinderCheck");
SetGlobalVarInt("Tinderboxes", 0);
}
void OnEnter()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "ArthurCheck", true, 1);
PlayMusic("RopeFootstep.ogg", true, 1, 1, 1, false);
}
void OnLeave()
{
SetupLoadScreen("LoadingText", "Loading", 7, "HNBKChapterOne.jpg");
}