Frictional Games Forum (read-only)
please help me with a multiple lookat scripting problem!!(FIXED) - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: please help me with a multiple lookat scripting problem!!(FIXED) (/thread-6867.html)



please help me with a multiple lookat scripting problem!!(FIXED) - shmuckdom - 03-13-2011

Hey, I am trying to make my player look at monster for 1.5 seconds, and then turn around and look at a closet for 1.5 seconds (all after I pick up a key). I followed a tutorial exactly (I think) and I get an error. He looks at the monster fine but it's the looking at the closet part, here's the script:

void Key1(string &in asEntity)
{
SetEntityActive("LibraryGrunt", true);
StartPlayerLookAt("LibraryGrunt", 6, 6, "");
AddTimer("donelook", 1.5f, "TimerDoneLookAt_1");
AddEnemyPatrolNode("LibraryGrunt", "PathNodeArea_1", 0.1, "");
AddEnemyPatrolNode("LibraryGrunt", "PathNodeArea_13", 0.1, "");
SetPlayerActive(false);
SetSwingDoorLocked("FilledCabinet", false, true);
}

void TimerDoneLookAt_1(string &in asTimer)
{
StopPlayerLookAt();
Continue();
}

void Continue();
{
StartPlayerLookAt("Lookatcloset", 6, 6, "");
AddTimer("donelook_5", 1.5f, "TimerDoneLookAt_2");
}

void TimerDoneLookAt_2(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

void LookAtCloset();
{
StartPlayerLookAt("LookAtCloset", 6, 6, "")
AddTimer("donelook_1", 1.5f, "TimerDoneLookAt_1");
}

void TimerDoneLookAt_1(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}


Much help would be appreciated!!! thanks

-DoM


RE: please help me with a multiple lookat scripting problem!! - Russ Money - 03-13-2011

Not sure, but I re-wrote your script. Try this and tell me if it works.

If I understand what you wanted, you wanted the player to look at the monster when he picks up the key for 1.5 seconds, then when that's done, he looks at the closet for 1.5 seconds, then the player regains control for the character?

If so, try this:

Code:
void Key1(string &in asEntity)
{
SetEntityActive("LibraryGrunt", true);
StartPlayerLookAt("LibraryGrunt", 6, 6, "");
AddTimer("donelook", 1.5f, "TimerDoneLookAt_1");
AddEnemyPatrolNode("LibraryGrunt", "PathNodeArea_1", 0.1, "");
AddEnemyPatrolNode("LibraryGrunt", "PathNodeArea_13", 0.1, "");
SetPlayerActive(false);
SetSwingDoorLocked("FilledCabinet", false, true);
}

void TimerDoneLookAt_1(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("Lookatcloset", 6, 6, "");
AddTimer("donelook_5", 1.5f, "TimerDoneLookAt_2");
}

void TimerDoneLookAt_2(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}



RE: please help me with a multiple lookat scripting problem!! - shmuckdom - 03-13-2011

(03-13-2011, 05:56 AM)Russ Money Wrote: Not sure, but I re-wrote your script. Try this and tell me if it works.

If I understand what you wanted, you wanted the player to look at the monster when he picks up the key for 1.5 seconds, then when that's done, he looks at the closet for 1.5 seconds, then the player regains control for the character?

If so, try this:

Code:
void Key1(string &in asEntity)
{
SetEntityActive("LibraryGrunt", true);
StartPlayerLookAt("LibraryGrunt", 6, 6, "");
AddTimer("donelook", 1.5f, "TimerDoneLookAt_1");
AddEnemyPatrolNode("LibraryGrunt", "PathNodeArea_1", 0.1, "");
AddEnemyPatrolNode("LibraryGrunt", "PathNodeArea_13", 0.1, "");
SetPlayerActive(false);
SetSwingDoorLocked("FilledCabinet", false, true);
}

void TimerDoneLookAt_1(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("Lookatcloset", 6, 6, "");
AddTimer("donelook_5", 1.5f, "TimerDoneLookAt_2");
}

void TimerDoneLookAt_2(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

Thank you very much !! Big GrinDD <3