Frictional Games Forum (read-only)
[SCRIPT] [unsolved]Lantern use script problem. - 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: [SCRIPT] [unsolved]Lantern use script problem. (/thread-19064.html)

Pages: 1 2


RE: Lantern use script problem. - Red - 11-03-2012

(11-03-2012, 04:30 PM)beecake Wrote: Oh! It isn't calling because you missed this: if(HasItem("lantern_1") == true)


That is my guess...
Let's see.
EDIT:your guess went wrong. Sorry mate.


RE: Lantern use script problem. - FlawlessHappiness - 11-03-2012

Then i don't know... Instead of the callback, maybe use a timer that checks all the time if the players lantern is on


RE: Lantern use script problem. - Red - 11-03-2012

(11-03-2012, 04:49 PM)beecake Wrote: Then i don't know... Instead of the callback, maybe use a timer that checks all the time if the players lantern is on
Okay.... what's the script that checks that?


RE: Lantern use script problem. - FlawlessHappiness - 11-03-2012

AddTimer("Check", 0.1f, "CheckLantern"); //This should be called when you want to check if the lanterh is used. And it should only be called once

void CheckLantern(string &in asTimer)
{
if(GetLanternActive() == true)
{
//Do the stuff you want it to
}
AddTimer("Check", 0.1f, "CheckLantern"); //This makes it loop

}


RE: Lantern use script problem. - Red - 11-03-2012

(11-03-2012, 05:25 PM)beecake Wrote: AddTimer("Check", 0.1f, "CheckLantern"); //This should be called when you want to check if the lanterh is used. And it should only be called once

void CheckLantern(string &in asTimer)
{
if(GetLanternActive() == true)
{
//Do the stuff you want it to
}
AddTimer("Check", 0.1f, "CheckLantern"); //This makes it loop

}
Darn, no hope, thanks still.


RE: Lantern use script problem. - FlawlessHappiness - 11-03-2012

You say the sound work. But not the other stuff inside the script. This means: the script is calling.
But there is a problem with the 2 other lines:

{
for(int i; i<8; i++)SetPropActiveAndFade("slime_"+i,false,1.5);

PlayGuiSound("puzzle_acid",3);

FadeLightTo("PointLight_18", 0,0, 0, 0, 0, 3);
}
There must be a problem with the red lines


RE: Lantern use script problem. - Red - 11-03-2012

(11-03-2012, 05:51 PM)beecake Wrote: You say the sound work. But not the other stuff inside the script. This means: the script is calling.
But there is a problem with the 2 other lines:

{
for(int i; i<8; i++)SetPropActiveAndFade("slime_"+i,false,1.5);

PlayGuiSound("puzzle_acid",3);

FadeLightTo("PointLight_18", 0,0, 0, 0, 0, 3);
}
There must be a problem with the red line
The light works, there's no problem there.
And the sound works even when the lantern is OFF.
EDIT: Okay i give up, i think different solution.