Frictional Games Forum (read-only)
[SCRIPT] making your character collapse? - 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: [SCRIPT] making your character collapse? (/thread-21603.html)



making your character collapse? - PixelHurricane - 05-25-2013

we all know that if you look at a monster for to long it causes your character to fall over. i need a way to have that happen, but with no monster at all. it's even in a semi-bright room.


RE: making your character collapse? - Romulator - 05-25-2013

The Wiki Wrote:void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);

Rotates the position of the camera on the player's body.
afX - angle of rotation of head, positive being counter-clockwise
afSpeedMul - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)
afMaxSpeed - maximum speed of rotation
That one should allow the player to roll over onto their side. Have an example:
PHP Code:
void FadePlayerRollTo(30.0f1.0f3.0f); 
This will roll the player onto their side at 30 x value.
Will move the player down there fairly slowly.
And the maximum speed of the fall is 3 Smile

Just put it into a CollideCallback event with a ScriptArea.


RE: making your character collapse? - PixelHurricane - 05-25-2013

(05-25-2013, 03:58 AM)ROMul8r Wrote:
The Wiki Wrote:void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);

Rotates the position of the camera on the player's body.
afX - angle of rotation of head, positive being counter-clockwise
afSpeedMul - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)
afMaxSpeed - maximum speed of rotation
That one should allow the player to roll over onto their side. Have an example:
PHP Code:
void FadePlayerRollTo(30.0f1.0f3.0f); 
This will roll the player onto their side at 30 x value.
Will move the player down there fairly slowly.
And the maximum speed of the fall is 3 Smile

Just put it into a CollideCallback event with a ScriptArea.

alright, i'll throw that in the script and see if i get what i'm looking for


RE: making your character collapse? - Tomato Cat - 05-25-2013

Or just bring the player's sanity down using:

PHP Code:
void SetPlayerSanity(float afSanity); 

But you might want to save the player's sanity beforehand, that way you can restore it later.

Something like this..

PHP Code:
void callbackfunction(parameters etc)
{
  
SetLocalVarFloat("sanityfloat"GetPlayerSanity());
  
//Assigns the player's sanity to a variable

  //Do other things


Later on..

PHP Code:
void function(parameters)
{
SetPlayerSanity(GetLocalVarFloat("aforementioned float"));