Frictional Games Forum (read-only)
Making the player look at something? - 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: Making the player look at something? (/thread-5556.html)



Making the player look at something? - Eyeball27 - 11-28-2010

In the game, scary events will have a script that forces the player to look at them. How do I set this up?


RE: Making the player look at something? - Gamemakingdude - 11-28-2010

(11-28-2010, 07:23 AM)Eyeball27 Wrote: In the game, scary events will have a script that forces the player to look at them. How do I set this up?

Make use of the search for forums. Its been asked before.

Try looking for my 7 questions post.


RE: Making the player look at something? - Eyeball27 - 11-28-2010

I've searched multiple times, and found nothing. Your 7 questions post didn't help, either. I know what script to use, I just need some clarification on the values and how to properly set it up.


RE: Making the player look at something? - Hooumeri - 11-28-2010

Hey.this is the script

Code:
void  StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string &asAtTargetCallback);

string& asEntityName = Where you want the player to look at, the name of the entity/area.

float afSpeedMul = The speed at which the player looks at the entity/area (I guess)

float afMaxSpeed = The max speed it will use ( I guess)

You can leave the targetcallback empty if you want(remember "")

anyways, here I have a working script. If you want the player to look faster, just mess up with the time values.

Code:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Lookatdoor(string &in asTimer)
{
if(asTimer == "Lookatdoor_01")
{
StartPlayerLookAt("castle_1",2.0f,5.0f,"");
AddTimer("Lookatdoor_02",1.5f,"Lookatdoor");
}

if(asTimer == "Lookatdoor_02")
{
StopPlayerLookAt();
}
}

What happens here, is that my player looks at the door (castle_1) and after 1.5 seconds, the player can freely look around.

Hope this helped! Wink


RE: Making the player look at something? - Eyeball27 - 11-28-2010

(11-28-2010, 09:12 AM)Hooumeri Wrote: Hey.this is the script

Code:
void  StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string &asAtTargetCallback);

string& asEntityName = Where you want the player to look at, the name of the entity/area.

float afSpeedMul = The speed at which the player looks at the entity/area (I guess)

float afMaxSpeed = The max speed it will use ( I guess)

You can leave the targetcallback empty if you want(remember "")

anyways, here I have a working script. If you want the player to look faster, just mess up with the time values.

Code:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Lookatdoor(string &in asTimer)
{
if(asTimer == "Lookatdoor_01")
{
StartPlayerLookAt("castle_1",2.0f,5.0f,"");
AddTimer("Lookatdoor_02",1.5f,"Lookatdoor");
}

if(asTimer == "Lookatdoor_02")
{
StopPlayerLookAt();
}
}

What happens here, is that my player looks at the door (castle_1) and after 1.5 seconds, the player can freely look around.

Hope this helped! Wink

Thanks you! That helped quite a bit.