Frictional Games Forum (read-only)

Full Version: How do I make the player look at a certain spot?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay, I want to make it that when you pick up a certain note and close it again the game makes you look at a certain spot to the right. How do I do this? thanks!
PHP Code:
StartPlayerLookAt(stringasEntityNamefloat afSpeedMulfloat afMaxSpeedstringasAtTargetCallback); 

asEntityName - the entity to look at
afSpeedMul - how fast should the player look at the entity
afMaxSpeed - maximum speed allowed
asAtTargetCallback - function to call when player looks at target

Just place a ScriptArea where you want the player to look, and call that the asEntityName part.

You need to put a StopPlayerLookAt(); somewhere as well, otherwise, the player will remain focused on that Smile
Can the player still move when looking at the entity or do I have to put the PlayerActive somewhere in there aswell?

And also how do I make the script start when the player picks up a certain object?
As far as I'm aware, you can call a function when you pick something up with the EntityPlayerInteract.

Not sure if it works with notes, but worth a shot.

PHP Code:
SetEntityPlayerInteractCallback(stringasNamestringasCallbackbool abRemoveOnInteraction); 

asName - internal name
asCallback - function to call
abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity

Here, the internal name would be what you've named the note in the editor.

Then you set the name of your function and use this syntax: void MyFunc(string &in asEntity) .

So if you want your player to look at something after he picked up the note, you could set a timer so he doesn't immediately go to look for what he's looking at, however, I'm pretty sure nothing can disturb you while you read notes, so I don't think it's a big deal to set a timer.
You helped me out a ton, buddy Tongue One more question and then it will all be working. How do I make the player not be able to move during the looking at a certain thing untill the event is finished?
PHP Code:
SetPlayerActive(false);      //Player can't move 

PHP Code:
SetPlayerActive(true);       //Player can move 

Just put them wherever they need to go! Smile
THANK YOU SO MUCH! IT WORKS!!!

I bow for you, sir haha Tongue