1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do you get the index of a tempent

Discussion in 'Scripts' started by greatguys1, Oct 2, 2018.

  1. greatguys1

    greatguys1 Active Adventurer Developer Warriors of the North

    279
    34
    Apr 20, 2013
    Yes
    Also is the "bleed" command server side only? Is it possible to make it client side also if not?
     
    Last edited: Oct 2, 2018
  2. Thothie

    Thothie Administrator Staff Member Administrator Moderator Developer

    15,079
    54
    Apr 8, 2005
    psycho-oligist
    lost
    Dun think you can. Actually took a stab at creating the functionality just now, and it always returns 0. Same with modelidx, which is odd, as ya'd think it'd at least have to have that. Tempent indexing seems to be handled differently.

    Bleed is server side... It calls two separate engine functions on the client, TE_BLOODSTREAM and TE_DECAL. The latter I managed to reproduce client side some time ago, think by finding an instance of R_DecalShoot in the HLDM client code and reproducing it (see cleffect decal). The other might be reproducible via gEngfuncs.pEfxAPI->R_BloodStream, but I can't seem to find an example of it, even in the Quake1 engine code. So... Meh, fiddling with it for a bit based on the message:
    Code:
    	MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, origin );
    		WRITE_BYTE( TE_BLOODSTREAM );
    		WRITE_COORD( origin.x );
    		WRITE_COORD( origin.y );
    		WRITE_COORD( origin.z );
    		WRITE_COORD( direction.x );
    		WRITE_COORD( direction.y );
    		WRITE_COORD( direction.z );
    		WRITE_BYTE( color );
    		WRITE_BYTE( min( amount, 255 ) );
    	MESSAGE_END();
    So far...
    Code:
    gEngfuncs.pEfxAPI->R_BloodStream(bld_org, bld_dir, (bld_col == BLOOD_COLOR_RED) ? 70 : bld_col, min( bld_amt, 255 ) );
    *kinda* seems to be working... Though it won't let me use the same methodology that the server uses to pick the blood direction, for some darn reason, so I may end up having to force the scripter to define it, ala "cleffect bleed <color> <origin> <dir> <amt>". (No idea why, it's basically a random vector, client just doesn't like it when I try to build one the same way.)

    Will post again when ironed out.
     
  3. Thothie

    Thothie Administrator Staff Member Administrator Moderator Developer

    15,079
    54
    Apr 8, 2005
    psycho-oligist
    lost
    Grr... Frustrating... I have it, more or less, but I can't get it to decal for the life of me and I've no idea why.

    I managed to get it to generate the blood stream direction the same way the server does, but if I can't get it to decal, one would have to do the decal function manually, and to make it consistent with the direction of the blood stream, it'd likely be best if I went back and forced the scripter to define the direction again.

    I'll send you a PM with the client.dll and the meager effort, see if it foots the bill.
     

Share This Page