Frictional Games Forum (read-only)
Why doesn't this script work? plz help - 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: Why doesn't this script work? plz help (/thread-16282.html)



Why doesn't this script work? plz help - pdkgaming - 06-18-2012

Hi all,

I'm kinda stuck at a part of scripting.. again >.<
I've made another thread but I don't think that one is needed anymore..
So the problem is.. I want the player to look at 3 entities when you enter an area. When it enters the area though, it only looks at one entity (first one in script) and keeps staring at it.. Does anybody see the problem?
And is my script even right? In theory it should work (I think).

Here's my script part:


void LookAt(string &in asTimer)
{
AddTimer("LookAt1", 2, "Sanity");
}

void Sanity(string &in asTimer)
{
if (LookAt1 == 2);
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, ""};
}
if (LookAt1 == 6);
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "");
}
if (LookAt1 == 4);
{
StartPlayerLookAt("painting03_1", 100, 100, "");
}
if (LookAt1 == 0);
{
SetPlayerSanity(0);
}
}

THANKS Big Grin


RE: Why doesn't this script work? plz help - Rownbear - 06-18-2012

I have no idea what you were scripting there but I would have had the player look at the 1st item, then 2nd and last by using timers over again something like

void LookAt(string &in asTimer)
{
AddTimer("LookAt1", 2, "Sanity");
}

void Sanity(string &in asTimer)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, ""};
AddTimer("LookAt2", 2, "Sanity2");
}

void Sanity2(string &in asTimer)
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "");
AddTimer("LookAt3", 2, "Sanity3");
}

void Sanity3(string &in asTimer)
{
StartPlayerLookAt("painting03_1", 100, 100, "");
AddTimer("Timer", 0.5, "StopLookAt1");
}

void StopLookAt1(string&in asTimer)
{
StopPlayerLookAt();
}


RE: Why doesn't this script work? plz help - pdkgaming - 06-18-2012

(06-18-2012, 10:07 PM)Rownbear Wrote: I have no idea what you were scripting there but I would have had the player look at the 1st item, then 2nd and last by using timers over again something like

void LookAt(string &in asTimer)
{
AddTimer("LookAt1", 2, "Sanity");
}

void Sanity(string &in asTimer)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, ""};
AddTimer("LookAt2", 2, "Sanity2");
}

void Sanity2(string &in asTimer)
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "");
AddTimer("LookAt3", 2, "Sanity3");
}

void Sanity3(string &in asTimer)
{
StartPlayerLookAt("painting03_1", 100, 100, "");
AddTimer("Timer", 0.5, "StopLookAt1");
}

void StopLookAt1(string&in asTimer)
{
StopPlayerLookAt();
}
Didn't work for me.. got a big load of errors.. I'll try figuring it out tomorrow. Thanks Smile