How do you get the index of a tempent

greatguys1

Epic Adventurer
MSC Developer
Warriors of the North
MSC Archivist
Joined
Apr 20, 2013
Messages
339
Reaction score
60
Age
26
Location
Yes
Also is the "bleed" command server side only? Is it possible to make it client side also if not?
 
Last edited:

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
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.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
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.
 
Top