Announcement

Collapse
No announcement yet.

Help Making Crouch on Quake C

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help Making Crouch on Quake C

    Yoo, I'm kinda new here(in the forum and quake c), I'm using darkplaces and trying to do a crouch for the player be able to go on the small places, the only problem with my crouch thing, is that if you just stop pressing ctrl button, on small place it just stop moving and able to jump(if you do that, you gonna be stuck forever (), I want to know if have a over collision of the player to fix that, or another way to do it, here's my script:

    crouch.qc:

    ////////////////////////////////////////
    ////////////////////////////////////////
    /* Crouch, Probably; */
    ////////////////////////////////////////
    ////////////////////////////////////////

    // Crouch Down.
    void() PlayerCrouchDown =
    {
    if(self.flags & FL_ONGROUND)
    {
    self.crouch = 1;
    }

    if(self.crouch == 1)
    {
    setsize(self, VEC_ORIGIN, VEC_ORIGIN);
    }
    }

    // Crouch Up.
    void() PlayerCrouchUp =
    {
    if(self.flags & FL_ONGROUND)
    {
    self.crouch = 0;
    }
    if(self.crouch == 0)
    {
    setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX);
    }
    }

    client.qc:
    if(!self.crouch)
    {
    if (self.button2)
    {
    PlayerJump ();
    }
    else
    {
    self.flags = self.flags | FL_JUMPRELEASED;
    }
    }
    if(self.button3)
    {
    PlayerCrouchDown ();
    }
    else
    {
    PlayerCrouchUp ();
    }

  • #2
    Hi JK

    I'm no QuakeC expert but I seem to recall that the old Inside3D site had a crouch tutorial, perhaps the following resource might help?...
    http://web.archive.org/web/201205260...ial.php?id=169


    Kind regards
    Monty
    Mr.Burns
    "Helping to keep this community friendly, helpful, and clean of spammers since 2006"
    WWW: Quake Terminus , QuakeVoid You Tube: QuakeVoid
    Servers: Quake.shmack.net, damage.servequake.com

    News: JCR's excellent ctsj_jcr map is being ported to OOT

    Comment


    • #3
      Originally posted by Mr.Burns View Post
      Hi JK

      I'm no QuakeC expert but I seem to recall that the old Inside3D site had a crouch tutorial, perhaps the following resource might help?...
      http://web.archive.org/web/201205260...ial.php?id=169


      Kind regards
      Monty
      Oh, yeah, I saw that, unfortunately it doesn't work correctly, since it just don't pass on the small places, sadly.

      Comment


      • #4
        Sorry I'm late, but I think there is a problem with

        if(self.flags & FL_ONGROUND)
        {
        self.crouch = 0;
        }

        You prevent the player crouch when they are touching the ground?

        Comment


        • #5
          Originally posted by Zop View Post
          Sorry I'm late, but I think there is a problem with

          if(self.flags & FL_ONGROUND)
          {
          self.crouch = 0;
          }

          You prevent the player crouch when they are touching the ground?
          when I don't press the crouch button, he still get up even if have celling above him, I want to fix that

          Comment


          • #6
            Originally posted by Zop View Post
            Sorry I'm late, but I think there is a problem with

            if(self.flags & FL_ONGROUND)
            {
            self.crouch = 0;
            }

            You prevent the player crouch when they are touching the ground?
            that makes the player don't crouch when it's not on ground

            Comment


            • #7
              You are aware of the fact that you would need an edited player model with a crouch frame to fit the new function? It might not be that relevant in singleplayer (unless you use a mod with chasecam or the like), but quite so in multiplayer.
              Authentic Models Pack
              OriOn's ID1 Model Fixes for MP1+2
              LIT/VIS files for Quake addons

              Comment


              • #8
                when I don't press the crouch button, he still get up even if have celling above him, I want to fix that
                traceline traceline - Quake Wiki to check for a ceiling above the player.

                Use multiple traces.
                Last edited by Totalitarian; 10-13-2021, 05:35 PM.

                Comment


                • #9
                  Originally posted by Totalitarian View Post

                  traceline traceline - Quake Wiki to check for a ceiling above the player.

                  Use multiple traces.
                  Thanks

                  Comment

                  Working...
                  X