Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shaking Room
assassinhawk45 Offline
Junior Member

Posts: 31
Threads: 11
Joined: Dec 2012
Reputation: 0
#1
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
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
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
Find
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#3
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
Website Find
assassinhawk45 Offline
Junior Member

Posts: 31
Threads: 11
Joined: Dec 2012
Reputation: 0
#4
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
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#5
RE: Shaking Room (STILL NEED HELP!)

Mackiiboy is completely correct. People use the functions FadePlayerRollTo and MovePlayerHeadPos to simulate lying down.

In Ruins [WIP]
01-18-2013, 05:34 PM
Find
assassinhawk45 Offline
Junior Member

Posts: 31
Threads: 11
Joined: Dec 2012
Reputation: 0
#6
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
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
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)
[Image: k6vbdhu]

Aculy iz dolan.
01-18-2013, 05:53 PM
Find
assassinhawk45 Offline
Junior Member

Posts: 31
Threads: 11
Joined: Dec 2012
Reputation: 0
#8
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
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#9
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 Wink

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-18-2013, 09:51 PM
Find




Users browsing this thread: 2 Guest(s)