How do I make the player look at a certain spot? - 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: How do I make the player look at a certain spot? (/thread-25070.html) |
How do I make the player look at a certain spot? - goodcap - 04-13-2014 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! RE: How do I make the player look at a certain spot? - Romulator - 04-13-2014 PHP Code: StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback); 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 RE: How do I make the player look at a certain spot? - goodcap - 04-13-2014 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? RE: How do I make the player look at a certain spot? - MsHannerBananer - 04-13-2014 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(string& asName, string& asCallback, bool 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. RE: How do I make the player look at a certain spot? - goodcap - 04-13-2014 You helped me out a ton, buddy 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? RE: How do I make the player look at a certain spot? - Romulator - 04-13-2014 PHP Code: SetPlayerActive(false); //Player can't move PHP Code: SetPlayerActive(true); //Player can move Just put them wherever they need to go! RE: How do I make the player look at a certain spot? - goodcap - 04-13-2014 THANK YOU SO MUCH! IT WORKS!!! I bow for you, sir haha |