I'm new to Amnesia scripting and I do not know how to make an area shake. I've seen it before in other stories, but I can not figure it out. Another thing that I need help with is making the player lie down. All help would be appreciated.
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);
Shakes the screen.
afAmount - intensity of the shake
afTime - duration of the shake
afFadeInTime - time in seconds until full intensity is reached
afFadeOutTime - time until screen is back to normal
(01-18-2013, 03:50 PM)assassinhawk45 Wrote: [ -> ]I'm new to Amnesia scripting and I do not know how to make an area shake. I've seen it before in other stories, but I can not figure it out. Another thing that I need help with is making the player lie down. All help would be appreciated.
There is no possible way making the players body to lie down, but it could easily be simulated by changing the players head position in x,y,z and rotate the position ~90 degree so it looks like you are lying down.
I would recommend you making the player crouching and inactive during the event by using:
Code:
SetPlayerActive(false);
SetPlayerCrouching(true);
and then rotate the head by using:
Code:
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
(01-18-2013, 04:08 PM)Mackiiboy Wrote: [ -> ] (01-18-2013, 03:50 PM)assassinhawk45 Wrote: [ -> ]I'm new to Amnesia scripting and I do not know how to make an area shake. I've seen it before in other stories, but I can not figure it out. Another thing that I need help with is making the player lie down. All help would be appreciated.
There is no possible way making the players body to lie down, but it could easily be simulated by changing the players head position in x,y,z and rotate the position ~90 degree so it looks like you are lying down.
I would recommend you making the player crouching and inactive during the event by using:
Code:
SetPlayerActive(false);
SetPlayerCrouching(true);
and then rotate the head by using:
Code:
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 cannot be correct. I've seen it many scripts, but I can never sort it out from the rest of the script. It's usually in the beginning of the map, where the player is lying on a bed, or something of the sort.
Mackiiboy is completely correct. People use the functions FadePlayerRollTo and MovePlayerHeadPos to simulate lying down.
The shaking script isn't working.
////////////////////////////
// Run when starting map
void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "func_shelf");
SetEntityConnectionStateChangeCallback("lever_1", "StartScreenShake");
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetEntityActive("fail_1", true);
}
}
void StartScreenShake(float 5.0f, float 10.0f, float 5.0f, float 5.0f);
{
SetEntityActive("bridge", true);
}
It says unexpected token { (20,1)
(01-18-2013, 05:34 PM)NaxEla Wrote: [ -> ]Mackiiboy is completely correct. People use the functions FadePlayerRollTo and MovePlayerHeadPos to simulate lying down.
Ok
What are you exactly trying to do? You can't put
void StartScreenShake(float 5.0f, float 10.0f, float 5.0f, float 5.0f);
Anywhere. It should be:
void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "func_shelf");
SetEntityConnectionStateChangeCallback("lever_1", "StartScreenShake");
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetEntityActive("fail_1", true);
}
}
void StartScreenShake(string &in asEntity, int alState)
{
SetEntityActive("bridge", true);
StartScreenShake(5.0f, 10.0f, 5.0f, 5.0f);
}
Wow, I'm stupid. Sorry about bothering you all. I extremely new to this
(01-18-2013, 06:47 PM)assassinhawk45 Wrote: [ -> ]Wow, I'm stupid. Sorry about bothering you all. I extremely new to this
Lol take your time, everyone here was a noob once. Even me
