Announcement

Collapse
No announcement yet.

Locational damage (projectile)?

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

  • Cobalt
    replied
    @Spike:

    I tried this code , works very nice , thanks.

    I noticed for players its nearly flawless as a .touch function...but for the exploboxes sometimes it said I was on top when I was touching a side. Not that its very important tho.


    Originally posted by Cobalt View Post
    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?

    Leave a comment:


  • Cobalt
    replied
    Killer Quake Pack v2.20z

    Originally posted by bluntz View Post
    There was another very old mod that you could loose arms and legs and continue to fight,been too long to remember the name however.

    Leave a comment:


  • bluntz
    replied
    There was another very old mod that you could loose arms and legs and continue to fight,been too long to remember the name however.

    Leave a comment:


  • Cobalt
    replied
    Not that I am aware but DP does have this feature , which I bleive will basicly do some of what I described above.

    Code:
    //DP_TRACE_HITCONTENTSMASK_SURFACEINFO
    //idea: LordHavoc
    //darkplaces implementation: LordHavoc
    //globals:
    .float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
    float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
    float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
    float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
    string trace_dphittexturename; // texture name of impacted surface

    Originally posted by Six-Shoota View Post
    I think it's too much sweat. Is there a engine with the multi hitbox system of Half-Life models implemented? This would be the proper solution.

    Leave a comment:


  • Six-Shoota
    replied
    I think it's too much sweat. Is there a engine with the multi hitbox system of Half-Life models implemented? This would be the proper solution.

    Leave a comment:


  • Cobalt
    replied
    Technicly using vector coords, you can plot out pixel by pixel / quake unit by quake unit, each point that resides in the absmax/absmin values of the hitbox.
    So you could map out all the points that the head area occupies and check versis trace_endpos if it encountered those points...but ah, the hitbox is not going to allow that right? True.

    However, you could use some tricky Quake C to either resize the absmax of the hitbox so its neck height, then do your tracekine tests. Or possibly make the player a SOLID_TRIGGER perhaps. Would the traceline pass through that kind of solid? Traceline could let you ignore that entity if you had a way to reliably detect if its a client / player , but still you would neet to "step" the tracelines, sort of like the code thats out there that steps it backwards to detect if it hit water, then do a spalsh effect at the surface for the shotgun trace attack code.

    I do know when you resize the hitbox to a non standard size, you have unreliable collisions, but if there should be a way to map out exact coords in a .mdl and match them to exact locations with respect to the model...and of course the frames, and possibly the angles might have to be taken into consideraiton.


    Originally posted by Dutch View Post
    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.

    Leave a comment:


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

    Leave a comment:


  • Cobalt
    replied
    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

    Leave a comment:


  • talisa
    replied
    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

    Leave a comment:


  • Cobalt
    replied
    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

    Leave a comment:


  • Six-Shoota
    replied
    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

    Leave a comment:


  • Spike
    replied
    local vector t;
    t_x = other.angles_x * -1;
    t_y = other.angles_y;
    t_z = other.angles_z;
    makevectors(t);

    Leave a comment:


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

    Leave a comment:


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

    Leave a comment:


  • Spike
    replied
    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!
    };

    Leave a comment:

Working...
X