Painframes modification

Discuss programming in the QuakeC language.
Post Reply
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Painframes modification

Post by Cobalt »

This probably wont make rocket jumps look better, but I was curious about why there never are pain frames when you damage yourself in combat.
I investigated the code , and wound up doing this in player.qc :

Code: Select all

void () player_pain =
{
                // Modify to check if inflictor ent is yours
	if ( (self.weaponframe && self.dmg_inflictor.owner != self) || self.invisible_finished > time) return;
	
	if (((self.weapon == IT_AXE) || (self.weapon == IT_HOOK)))
	{
		player_axpain1 ();
	}
	else
	{
		player_pain1 ();
	}

};
...which seems to allow painframes when you damage yourself, as long as the missile / grenade has its .owner field set correctly. I suppose you could preserve the rocket (or some people can , yes, "grenade jump") jump by checking for onground or button2 etc.

I also put in an extra painframe in player_pain1 () sequence for the take damage being 50% or more of the last known health value before damage was inflicted. (I will post that code later).

Also after studying the code, realized the fact that the painframes never alter your attack_finished time, which I have found kind of unusual. If you were stalked from behind and your opponent lands a good shot on you, you should be sort of stunned, but instead the engine lets you spin around at normal mouse speed and return fire as if what just hit was no biggie. I know nothing can be done to slow down mouse speed, as its direct angles from the client, but changing attack_finished ought to be easy to do in the painframes sequences.

PS: I have seen a player Rocket - then grenade jump....or was it the other way around?
c0burn
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England
Contact:

Re: Painframes modification

Post by c0burn »

This is to stop it borking player animations. For example player_nail1 would be aborted if a pain frame started, stopping the player from firing.
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: Painframes modification

Post by Cobalt »

Coburn? They said you were dead.

Long time no see...not sure what you mean. Oh ok, yea....now I see. Heck - anyone can continue firing a weapon when geting shot...what was I thinking?

What? Quake is not real life and is just a game ??? ! !! ! ? No way !

EDIT: Thought about it some more, and I will do some tests to confirm, but since my mod is CTF based, I can probably add this perk to the Regeneration Rune, where if you have the rune, it wont knock you out of the weapon firing sequence.

Theres also another factor I have not given a real name yet, but it could be the air_finished float. It does sort of reflect your current "breath" so to speak, and in my mod I am putting in a sprinting feature pretty identical to RTCW''s (Q3 mod) sprint feature where you have a sprinting button and level bar. Lets say you just sprinted to the max, then you get shot. Chances are you pop out of your firing frames rather than continue to attack because you are now a potential target 2 times. But maybe it depends, and ought to be lefe up to the player to decide, but I think as it is now, the Quake code stops the nail firing until the pain is done, then if they still are holding down the button, the next opportunity to attack it will start firing agian. So I guess if they keep attacking you , you would be stuck in pain and not be able to attack back at all - which I have to say kind of makes sense.....die hard fast paced action Quake players probably would no likey....or maybe this would only happen if the attacker is using Strength rune or the Quad? Makes for some cute experiments anyway...
Post Reply