Frictional Games Forum (read-only)

Full Version: Why doesn't this script work? plz help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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();
}
(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