The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Clinging to ladder after falling 2 floors
CarnivorousJelly Offline
Posting Freak

Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation: 80
#1
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?

[Image: quote_by_rueppells_fox-d9ciupp.png]
(This post was last modified: 09-23-2013, 09:32 PM by CarnivorousJelly.)
09-21-2013, 05:08 AM
Find


Messages In This Thread
Clinging to ladder after falling 2 floors - by CarnivorousJelly - 09-21-2013, 05:08 AM



Users browsing this thread: 1 Guest(s)