.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...

Forum Thread
  Posts  
dmg_take,dmg_save (Groups : qc : Forum : discuss() : dmg_take,dmg_save) Locked
Thread Options
numbersix
numbersix quake-c coder++
Jan 12 2016 Anchor
On 2016-01-11 12:13, Cobalt wrote:
Just got a response on the func_messageboard forum, apparently these control the tint and color of the red screen flash that happens to a real client when taking damage?


This is it:

combat.qc:


void(entity targ, entity inflictor, entity attacker, float damage) T_Damage

// add to the damage total for clients, which will be sent as a single
// message at the end of the frame
// FIXME: remove after combining shotgun blasts?
	if (targ.flags & FL_CLIENT)
	{
		targ.dmg_take = targ.dmg_take + take;
		targ.dmg_save = targ.dmg_save + save;
		targ.dmg_inflictor = inflictor;
	}
There is no other qc reference in any other function.


Darkplaces has this:
(I'd gather that glquake, and others are similar.)


void SV_WriteClientdataToMessage (client_t *client, prvm_edict_t *ent, sizebuf_t *msg, int *stats)

//
// send a damage message
//
         if (PRVM_serveredictfloat(ent, dmg_take) || 
PRVM_serveredictfloat(ent, dmg_save))
         {
                 other = PRVM_PROG_TO_EDICT(PRVM_serveredictedict(ent, dmg_inflictor));
                 MSG_WriteByte (msg, svc_damage);
                 MSG_WriteByte (msg, (int)PRVM_serveredictfloat(ent, dmg_save));
                 MSG_WriteByte (msg, (int)PRVM_serveredictfloat(ent, dmg_take));
                 for (i=0 ; i<3 ; i++)
                         MSG_WriteCoord (msg, PRVM_serveredictvector(other, origin)[i]+ 0.5*(PRVM_serveredictvector(other, mins)[i]+ PRVM_serveredictvector(other, maxs)[i]), sv.protocol);

                 PRVM_serveredictfloat(ent, dmg_take) = 0;
                 PRVM_serveredictfloat(ent, dmg_save) = 0;
         }
Perhaps whatever msg content is causes a flash on the screen.


The only qc controlled screen flash that I know of is:

stuffcmd (self, "bf\n");

That happens when you pick up weapons / items, etc.


Jan 13 2016 Anchor

Yep, confirmed as you indicated, plus those fields will tilt the screen on a downward angle based on the values. dmg_save seems to force a white screen flash while

dmg_takes is always red.

try typing in the console in a single player local game : prvm_edictset server 1 damage_take 50 , and change the numbers and you can see it.

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.