Announcement

Collapse
No announcement yet.

Locational damage (projectile)?

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

  • Locational damage (projectile)?

    Any advices for locational damage with the nail gun?

  • #2
    Hello Six-Shoota,

    I am not a good english speaker/writer/anything.
    What do you mean with "locational damage with the nail gun" ?
    Can you please advice ?

    In original Quake, the nailgun projectiles does only damage to the entity it hits (if it can takedamage).
    Do you mean with "locational damage" that you also want to do damage to surrounding entities ? Like a rocket for example ?

    If so, then you need to edit the spikeīs touch function(s). Find them in weapons.qc.
    T_Damage does the direct impact. Extend it, quite similar to the rocketīs touch function, with an additional T_RadiusDamage.

    Find and read the detailed description of how both damage functions work and need inside combat.qc.

    If you mean something else, then I am sorry. I didnt understand.

    Best of luck.

    Comment


    • #3
      I mean doing different damage depenting on how high the nail hits the hitbox of an ent (headshots etc.)

      Comment


      • #4
        Originally posted by Six-Shoota View Post
        Any advices for locational damage with the nail gun?
        You was kinda vague, more details?
        Want to get into playing Quake again? Click here for the Multiplayer-Startup kit! laissez bon temps rouler!

        Comment


        • #5
          Originally posted by Six-Shoota View Post
          I mean doing different damage depenting on how high the nail hits the hitbox of an ent (headshots etc.)
          Damage is the same in every section of the hitbox as far as I know.
          Want to get into playing Quake again? Click here for the Multiplayer-Startup kit! laissez bon temps rouler!

          Comment


          • #6
            The only idea I have is traceline form the spike every single frame, but this will be a framerate killer.

            Comment


            • #7
              obviously this won't work perfectly due to the fact that the target's bbox isn't square, or even centered. you can probably scale+bias it to work around that a little.

              Code:
              void() me_touch =
              {
              vector dir;
              vector rel;
              string side; //string for demonstration purposes, you probably want to fix that.
              
              if (other.solid == SOLID_BSP)
              makevectors(other.angles);
              else
              makevectors([other.angles_x*-1, other.angles_y, other.angles_z]); //stupid vanilla bug, but needed if you want to cope with eg players and their pitch angle that isn't 0.
              
              dir = self.origin - other.origin;
              
              //vector*vector is a dotproduct
              rel_x = v_forward * dir;
              rel_y = v_right * dir;
              rel_z = v_up * dir;
              //dotproduct: result=a_x*b_x+a_y*b_y+a_z+b_z
              //consider that for instance, v_up is '0 0 1'. this means rel_z is equal to dir_z only.
              //because forward,right,up are all normalised unit vectors, the result will be scaled according to that, giving the distance that dir points along the direction vector.
              //thus this works regardless of the orientation of the other entity.
              
              //float*float is a regular multiplication, dumbass. I'm using it to 'strip' the sign.
              if (rel_x*rel_x > rel_y*rel_y && rel_x*rel_x > rel_z*rel_z)
              { //x is most significant
              if (rel_x >= 0)
              side = "FRONT";//and positive, so its in the forward direction
              else
              side = "BACK";//negative, so backward
              }
              else if (rel_y*rel_y > rel_z*rel_z)
              {//its not going to be x. but it might be y / sideways
              if (rel_y >= 0)
              side = "RIGHT"; //rel_y was aligned to the RIGHT vector
              else
              side = "LEFT";
              }
              else
              {
              if (rel_z >= 0)
              side = "TOP";
              else
              side = "BOTTOM";
              }
              bprint("I hit the ", side, " of that ", other.classname, "\n");
              remove(self); ///nooooooes!
              };
              Some Game Thing

              Comment


              • #8
                Originally posted by Six-Shoota View Post
                I mean doing different damage depenting on how high the nail hits the hitbox of an ent (headshots etc.)
                Hello Six-Shoota,

                MauveBibīs Hit Location System might also be interesting for you. Weapons do more or less damage to the victims depending on where on the body they hit.

                As well as Orionsīs OrionTF beta, which has the source code included and uses an algorithm to detect head shots (because that is what you speficically asked for). Bes ure to grab his beta 4.

                And when you go over to inside3dīs forum and type "headshot" into the forums search, you will be able to directly read what the big coders there say about this topic.

                This thread is a very informative starter that shows you the limits of Quake 1 and some rebels that want to break them

                Happy reading and coding.

                Comment


                • #9
                  Looks interesting I will def ck this out. But whats the brackets on that statement do , multiply the vectors together? If someone used an older FrikQcc compiler how would you convert that line?

                  Originally posted by Spike View Post
                  obviously this won't work perfectly due to the fact that the target's bbox isn't square, or even centered. you can probably scale+bias it to work around that a little.

                  Code:
                  makevectors([other.angles_x*-1, other.angles_y, other.angles_z]); //stupid vanilla bug, but needed if you want to cope with eg players and their pitch angle that isn't 0.

                  Comment


                  • #10
                    local vector t;
                    t_x = other.angles_x * -1;
                    t_y = other.angles_y;
                    t_z = other.angles_z;
                    makevectors(t);
                    Some Game Thing

                    Comment


                    • #11
                      Spike, 10x I would never have thought to use dot product.But I picked the easiest solution:
                      if (self.origin_z > (other.origin_z + 1) // headshot

                      Comment


                      • #12
                        Im sorta using something like that in my mod, only I guestimated the shotgun pellets impact if they hit the box between its absmax_z and absmax_z minus about 10 or so, then we have a chance of a headshot. Need to determine how many pellets would need to hit to result in a complete gib I guess, and also consider close range would increase the chance.

                        Dot product also would increase the chance greatly if it winds up being from behind.

                        This is where you have to also consider any helmets the player may be wearing. Doom had a helmet item as a pickup.


                        Originally posted by Six-Shoota View Post
                        Spike, 10x I would never have thought to use dot product.But I picked the easiest solution:
                        if (self.origin_z > (other.origin_z + 1) // headshot

                        Comment


                        • #13
                          if you want to know a good way to make headshots possible,
                          take a look at the drake mod's QC, which includes the ability to perform headshots.
                          https://www.dropbox.com/s/2jz1yd1lze...06-24.zip?dl=0

                          patrick (creator of drake mod) is a brilliant coder and im sure he has conjured up
                          some ingenious method of accomplishin the ability to headshot all enemies
                          .
                          are you curious about what all there is out there in terms of HD content for quake?
                          > then make sure to check out my 'definitive' HD replacement content thread! <
                          everything that is out there for quake and both mission-packs, compiled into one massive thread

                          Comment


                          • #14
                            Nice dragons in that mod. Havent seen the headshot stuff yet, but would be neat if the dragons picked you up and dropped Quake guy to his death ....

                            that func_msgboard site where he hangs out has some good people but that board style is so hard to follow.

                            Originally posted by talisa View Post
                            if you want to know a good way to make headshots possible,
                            take a look at the drake mod's QC, which includes the ability to perform headshots.
                            https://www.dropbox.com/s/2jz1yd1lze...06-24.zip?dl=0

                            patrick (creator of drake mod) is a brilliant coder and im sure he has conjured up
                            some ingenious method of accomplishin the ability to headshot all enemies

                            Comment


                            • #15
                              Could you test the trace_endpos or the nail's final position before removal against the entity's min and max z values in relation to the entity's z origin? I'm pretty rusty at coding at the moment (been almost a year) so I can't whip up any code to try out at the moment but it might be worth looking into.
                              'Replacement Player Models' Project

                              Comment

                              Working...
                              X