Frictional Games Forum (read-only)

Full Version: how to take control of player
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
(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.

(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