(08-03-2013, 07:16 PM)hunchbackproduction Wrote: Ok! tried to get this to work, I thought I understood this, But boy was I wrong xD
I need a little more clarification on how this whole thing works.
When you explained the I and K parameter thing I got it, But why is I and K needed ? Can't you just code: "addnumber(3,1)" ?
Also what is up with "public" I saw you put that there before your voids
I still do not get the whole lanternlit, and how it links to parameters ? Are the parameters "true" or "false" and do I have to define these somewhere ?
void LanternLit(bool lanternLit)
{
if(lanternLit)
{
SetMessage("test", "test", 1);
}
else
{
}
}
I have this piece of test code, please explain to me why it does not work! As when I light my lantern the test message does not appear.
PS: I have given you a reputation for the help so far ^ Thanks!
it should not be
bool LanternLit it has to be
bool abLit since it's a programmed parameter.
so it should look more like this
SetLanternLitCallback("LanternLit");
void LanternLit(bool abLit)
{
if(true)
{
AddDebugMessage("It's working!", true);
}
else
{
AddDebugMessage("It's NOT working", true);
}
}
Here's your fixed code:
void LanternTinderCheck(bool abLit)
{
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");
}