CarnivorousJelly
Posting Freak
Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation:
80
|
Clinging to ladder after falling 2 floors
I have a little teeny-tiny scripting problem - might be a level editor problem, I'm not entirely sure:
What's supposed to happen - Player is climbing a bookshelf to grab a specific book, get's about... 3/4 of the way there and loses grip. They then fall 6m-ish flat on their back and black out.
What is actually happening - Player climbs up, loses grip at 3/4 of the way up, falls, blacks out. Trying to move forward upon waking up results in climbing up the shelf.
This is the script:
void Script_Fall (string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("gasp", "react_scare.snt", "Player", 0, false);
AddTimer("F1", 0.1f, "timer_fall");
AddTimer("F2", 0.5f, "timer_fall");
AddTimer("F3", 0.8f, "timer_fall");
AddTimer("F4", 1.0f, "timer_fall");
AddTimer("F5", 2.5f, "timer_fall");
AddTimer("F6", 6.1f, "timer_fall");
}
void timer_fall(string &in asTimer)
{
if(asTimer == "F1")
{
AddPlayerBodyForce(-1000, -10000, -5500, false);
StartPlayerLookAt("Area_Fall", 4, 5, "");
AddPropForce("book02_17", 0.0f, -100.0f, -350.0f, "world");
AddPropForce("book01_2", 0.0f, -100.0f, -350.0f, "world");
AddPropForce("book03_153", 0.0f, -100.0f, -350.0f, "world");
AddPropForce("book02_91", 0.0f, -100.0f, -350.0f, "world");
AddPropForce("tome01_1", 0.0f, -100.0f, -350.0f, "world");
AddPropForce("book03_152", 0.0f, -100.0f, -350.0f, "world");
AddPropForce("book02_90", 0.0f, -100.0f, -350.0f, "world");
AddPropForce("book03glowing_1", 0.0f, -100.0f, -350.0f, "world");
}
if(asTimer == "F2")
{
SetEntityActive("LadderArea_1", false);
}
if(asTimer == "F3")
{
StopPlayerLookAt();
StartPlayerLookAt("Area_Look1", 5, 8, "");
}
if(asTimer =="F4")
{
StopPlayerLookAt();
SetPlayerCrouching(true);
FadePlayerRollTo(70, 50, 55);
SetPlayerHealth(55);
SetPlayerMoveSpeedMul(1.5f);
GiveSanityDamage(20, true);
FadePlayerFOVMulTo(1.0f, 4);
}
if(asTimer =="F5")
{
StartPlayerLookAt("Area_Fall", 15, 20, "");
GiveSanityDamage(40, false);
PlaySoundAtEntity("crash", "player_falldamage_max.snt", "Player", 0, false);
FadeOut(4.0f);
PlaySoundAtEntity("ringing", "insanity_ear_ring.snt", "Player", 4, false);
}
if(asTimer =="F6")
{
StopPlayerLookAt();
StopSound("ringing", 2);
FadePlayerRollTo(0, 50, 50);
SetPlayerCrouching(false);
SetPlayerMoveSpeedMul(1.0f);
FadeIn(0.5f);
}
}
There's about 3m between the shelf and the wall behind it, so I'm pretty sure that's not the problem.
Any suggestions?
|
|