Frictional Games Forum (read-only)
how to take control of player - 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 to take control of player (/thread-14692.html)



how to take control of player - zombiehacker595 - 04-11-2012

this is the first time of trying this now i know that it included like setplayer look at or something but what would i add to the script to get a player to look at an area for 1 or 2 seconds


RE: how to take control of player - Mackiiboy - 04-11-2012

(04-11-2012, 10:01 AM)zombiehacker595 Wrote: this is the first time of trying this now i know that it included like setplayer look at or something but what would i add to the script to get a player to look at an area for 1 or 2 seconds
.
You could add a timer, after 0 seconds, the player starts to look at a specific entity/area with:

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

--------------------
Forces the player to look at a certain entity until StopPlayerLookAt is used.
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

--------------------

And after 2 seconds in your timer, the player stops to look at the entity/area with:

void StopPlayerLookAt();

--
It requires that you know how to set up a timer.




RE: how to take control of player - zombiehacker595 - 04-11-2012

(04-11-2012, 10:14 AM)Mackiiboy Wrote:
(04-11-2012, 10:01 AM)zombiehacker595 Wrote: this is the first time of trying this now i know that it included like setplayer look at or something but what would i add to the script to get a player to look at an area for 1 or 2 seconds
.
You could add a timer, after 0 seconds, the player starts to look at a specific entity/area with:

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

--------------------
Forces the player to look at a certain entity until StopPlayerLookAt is used.
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

--------------------

And after 2 seconds in your timer, the player stops to look at the entity/area with:

void StopPlayerLookAt();

--
It requires that you know how to set up a timer.


ok cool i got it to work thanks for the info Smile