assassinhawk45
Junior Member
Posts: 31
Threads: 11
Joined: Dec 2012
Reputation:
0
|
Shaking Room
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.
The Necromancer's Touch: WIP Coming March 2013
(This post was last modified: 01-18-2013, 06:48 PM by assassinhawk45.)
|
|
01-18-2013, 03:50 PM |
|
Adny
Posting Freak
Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation:
173
|
RE: Shaking Room
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
I rate it 3 memes.
(This post was last modified: 01-18-2013, 03:59 PM by Adny.)
|
|
01-18-2013, 03:58 PM |
|
Mackiiboy
Member
Posts: 101
Threads: 7
Joined: Jan 2012
Reputation:
11
|
RE: Shaking Room
(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:
SetPlayerActive(false);
SetPlayerCrouching(true);
and then rotate the head by using:
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
(This post was last modified: 01-18-2013, 04:09 PM by Mackiiboy.)
|
|
01-18-2013, 04:08 PM |
|
assassinhawk45
Junior Member
Posts: 31
Threads: 11
Joined: Dec 2012
Reputation:
0
|
RE: Shaking Room
(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:
SetPlayerActive(false);
SetPlayerCrouching(true);
and then rotate the head by using:
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.
The Necromancer's Touch: WIP Coming March 2013
(This post was last modified: 01-18-2013, 04:33 PM by assassinhawk45.)
|
|
01-18-2013, 04:32 PM |
|
NaxEla
Senior Member
Posts: 415
Threads: 5
Joined: Dec 2012
Reputation:
28
|
RE: Shaking Room (STILL NEED HELP!)
Mackiiboy is completely correct. People use the functions FadePlayerRollTo and MovePlayerHeadPos to simulate lying down.
|
|
01-18-2013, 05:34 PM |
|
assassinhawk45
Junior Member
Posts: 31
Threads: 11
Joined: Dec 2012
Reputation:
0
|
RE: Shaking Room (STILL NEED HELP!)
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
The Necromancer's Touch: WIP Coming March 2013
(This post was last modified: 01-18-2013, 05:38 PM by assassinhawk45.)
|
|
01-18-2013, 05:37 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Shaking Room (STILL NEED HELP!)
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);
}
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
01-18-2013, 05:53 PM |
|
assassinhawk45
Junior Member
Posts: 31
Threads: 11
Joined: Dec 2012
Reputation:
0
|
RE: Shaking Room (STILL NEED HELP!)
Wow, I'm stupid. Sorry about bothering you all. I extremely new to this
The Necromancer's Touch: WIP Coming March 2013
|
|
01-18-2013, 06:47 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Shaking Room (STILL NEED HELP!)
(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
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
01-18-2013, 09:51 PM |
|
|