Announcement

Collapse
No announcement yet.

Help Making Crouch on Quake C

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

  • John-Kun
    replied
    Originally posted by Totalitarian View Post

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

    Use multiple traces.
    Thanks

    Leave a comment:


  • Totalitarian
    replied
    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.

    Leave a comment:


  • NightFright
    replied
    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.

    Leave a comment:


  • John-Kun
    replied
    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

    Leave a comment:


  • John-Kun
    replied
    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

    Leave a comment:


  • Zop
    replied
    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?

    Leave a comment:


  • John-Kun
    replied
    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.

    Leave a comment:


  • Mr.Burns
    replied
    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

    Leave a comment:


  • John-Kun
    started a topic Help Making Crouch on Quake C

    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 ();
    }
Working...
X