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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need to know how to force the player to 'lay' down when they enter the map...
7thProductions Offline
Junior Member

Posts: 42
Threads: 17
Joined: Mar 2012
Reputation: 0
#1
I need to know how to force the player to 'lay' down when they enter the map...

okay, so basically I've played a custom story that started with the player 'laying' down and I can't seem to find the appropriate script to do that...and since I'm new to this, the scripting really confuses me ^^'

can anyone help me?

03-20-2012, 10:51 PM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#2
RE: I need to know how to force the player to 'lay' down when they enter the map...

(03-20-2012, 10:51 PM)7thProductions Wrote: okay, so basically I've played a custom story that started with the player 'laying' down and I can't seem to find the appropriate script to do that...and since I'm new to this, the scripting really confuses me ^^'

can anyone help me?
If you want to do the lazy mans way like me you can put a script area on the start area and make it do this script right away.
{
FadeOut(0.0f);
FadeIn(5.0f);
SetPlayerSanity(1);

}

Or you can fiddle around with this here
-

MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);
-
//Changes the position of the camera on the player's body.

//afX - amount along the X-axis
//afY - amount along the Y-axis
//afZ - amount along the Z-axis
//afSpeed - speed at which the change happens
//afSlowDownDist - distance at which to start slowing down (prevents the head from abruptly stopping)

and

FadePlayerRollTo(0, 0, 0);
FadePlayerRollTo(RotationSpeed, MinSpeed, MaxSpeed);

03-21-2012, 12:30 AM
Find
DaAinGame Offline
Member

Posts: 90
Threads: 11
Joined: Mar 2012
Reputation: 4
#3
RE: I need to know how to force the player to 'lay' down when they enter the map...

If it helps you at all here's a little sample of these commands taken from my script on my custom story.

void Collapse(string &in asItem, string &in asEntity)
{
AddPlayerBodyForce(0, 0, -30000, false);
FadeOut(.5);
FadePlayerRollTo(50, 220, 220); <--- This is causing the player to be knocked over during the Collapse
SetPlayerCrouching(true); <---- Use this for a more realism for when the player is laying down
SetPlayerActive(false);
AddTimer("", 5, "GetUp");
PlaySoundAtEntity("", "explosion_rock_large", "web_1", 0, false);
SetLanternActive(false, false);
}

void GetUp(string &in asTimer)
{
SetEntityActive("cave_in_1", true);
SetEntityActive("cave_in_2", true);
SetEntityActive("cave_in_3", true);
SetEntityActive("cave_in_4", true);
SetEntityActive("web_1", false);
FadeIn(7);
AddTimer("", 7.5, "StandUp");
RemoveItem("lantern_1");
}

void StandUp(string &in asTimer)
{
FadePlayerRollTo(0, 33, 33); <---- This is returning the player back the default view
SetPlayerCrouching(false);
SetMessage("Broke", "Lantern", 3);
SetPlayerActive(true);
}

If you need or want anymore help feel free to ask!

Realm Of Another Chapter 1: http://www.frictionalgames.com/forum/thread-14142.html
Realm Of Another Chapter 2: Postponed
Adder Halls: 5%
(This post was last modified: 03-21-2012, 04:16 AM by DaAinGame.)
03-21-2012, 04:15 AM
Find
7thProductions Offline
Junior Member

Posts: 42
Threads: 17
Joined: Mar 2012
Reputation: 0
#4
RE: I need to know how to force the player to 'lay' down when they enter the map...

(03-21-2012, 04:15 AM)DaAinGame Wrote: If it helps you at all here's a little sample of these commands taken from my script on my custom story.

void Collapse(string &in asItem, string &in asEntity)
{
AddPlayerBodyForce(0, 0, -30000, false);
FadeOut(.5);
FadePlayerRollTo(50, 220, 220); <--- This is causing the player to be knocked over during the Collapse
SetPlayerCrouching(true); <---- Use this for a more realism for when the player is laying down
SetPlayerActive(false);
AddTimer("", 5, "GetUp");
PlaySoundAtEntity("", "explosion_rock_large", "web_1", 0, false);
SetLanternActive(false, false);
}

void GetUp(string &in asTimer)
{
SetEntityActive("cave_in_1", true);
SetEntityActive("cave_in_2", true);
SetEntityActive("cave_in_3", true);
SetEntityActive("cave_in_4", true);
SetEntityActive("web_1", false);
FadeIn(7);
AddTimer("", 7.5, "StandUp");
RemoveItem("lantern_1");
}

void StandUp(string &in asTimer)
{
FadePlayerRollTo(0, 33, 33); <---- This is returning the player back the default view
SetPlayerCrouching(false);
SetMessage("Broke", "Lantern", 3);
SetPlayerActive(true);
}

If you need or want anymore help feel free to ask!

okay, I added the parts of your script that I needed for my script but when the player stands back up, the screen is still shaking and they are still standing at an angle. do you have any idea how to fix this?
[EDIT] so I've managed to get the screen to stop shaking, but the player is still standing at an angle even after everything is supposed to go back to normal :/







(This post was last modified: 03-21-2012, 09:14 PM by 7thProductions.)
03-21-2012, 08:31 PM
Find
DaAinGame Offline
Member

Posts: 90
Threads: 11
Joined: Mar 2012
Reputation: 4
#5
RE: I need to know how to force the player to 'lay' down when they enter the map...

Hmmm... Well I know the screen shakes but 0, 33, 33 should be default. Can you post your script?

Realm Of Another Chapter 1: http://www.frictionalgames.com/forum/thread-14142.html
Realm Of Another Chapter 2: Postponed
Adder Halls: 5%
03-21-2012, 09:12 PM
Find
7thProductions Offline
Junior Member

Posts: 42
Threads: 17
Joined: Mar 2012
Reputation: 0
#6
RE: I need to know how to force the player to 'lay' down when they enter the map...

(03-21-2012, 09:12 PM)DaAinGame Wrote: Hmmm... Well I know the screen shakes but 0, 33, 33 should be default. Can you post your script?
////////////////////////////
// Run first time starting map
void OnStart()
{
SetPlayerCrouching(true);
SetPlayerActive(false);
ShowPlayerCrossHairIcons(false);
GiveSanityDamage(100.0, false);
SetSanityDrainDisabled(true);
SetPlayerHealth(10.0);
AddPlayerBodyForce(0, 0, -30000, true);
FadePlayerRollTo(50, 220, 220);
FadeOut(.5);
FadeIn(3);
AddTimer("T1", 3, "Intro");
AddTimer("T2", 6, "Intro");
AddTimer("T3", 8, "Intro");
AddTimer("T4", 10, "Intro");
AddTimer("T5", 12, "Intro");
AddTimer("T6", 5, "GetUp");
AddTimer("T7", 7.5, "StandUp");
}
void Intro(string &in asTimer)
{
string x = asTimer;
if (x == "T1")
{
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
AddEntityCollideCallback("Player", "violetedwards_speak_1", "violetedwardsspeak1", true, 5.0);
FadeOut(3);
}
else if (x == "T2")
{
FadeIn(3);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
StartPlayerLookAt("ScriptArea_1", 2, 2, "");
}
else if (x == "T3")
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_2", 2, 2, "");
}
else if (x == "T4")
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
StopPlayerLookAt();
}
else if (x == "T5")
{
SetPlayerCrouching(false);
SetPlayerActive(true);
ShowPlayerCrossHairIcons(true);
SetPlayerMoveSpeedMul(0.3);
SetPlayerJumpDisabled(true);
SetPlayerCrouchDisabled(true);
SetPlayerRunSpeedMul(0.0);
}
else if (x == "T6")
{
FadeIn(7);
}
else if (x == "T7")
{
FadePlayerRollTo(0, 33, 33);
}

}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


03-21-2012, 09:15 PM
Find
DaAinGame Offline
Member

Posts: 90
Threads: 11
Joined: Mar 2012
Reputation: 4
#7
RE: I need to know how to force the player to 'lay' down when they enter the map...

Take out the GiveSanityDamage(100.0, false); or don't make it 100. If the player has 0 sanity (The player has 100 sanity starting), then i believe he crawls around on the floor until it regenerates. Either take that line out completely or make it a smaller number. Hopefully that will fix it.

Realm Of Another Chapter 1: http://www.frictionalgames.com/forum/thread-14142.html
Realm Of Another Chapter 2: Postponed
Adder Halls: 5%
03-21-2012, 10:46 PM
Find




Users browsing this thread: 1 Guest(s)