Re: [Quake-C] Counting hits in FireBullets ()
Quake C mods and support - SSQC / CSQC
Brought to you by:
teknoskillz
|
From: Cobalt <co...@te...> - 2015-12-27 04:06:00
|
> Multifrag is an interesting idea for a statistic.
Quake 3 apparently has it. I use to play Enemy Territory alot and its
basicly a shell of Return to Castle Wolfenstien, also based on the Q3
engine, and some servers had put in the miltikill sounds from Q3 and
got them working.
> Part of my painkeep 3.0 release / code update calls for some advanced DM
> stats:
> first kill
> last kill
> most kills on one spawn
> most kills in first 6 secs of DM
> highest kill rate (frags /sec)
> accuracy (hits vs. misses)
> highest railgun instant hit count
> A shotgun multi hit would be a good add.
First kill and last kill, I first saw in Call of Duty when I tried playing
that. They also have something called a "deathstreak", where after you do
many times in a row,
you come back for a while with higher health por something...
Quake 3 seems to have an award that plays a voice sound of "Perfect" if you
win the match without dying once. The rest you mention seems Q3 has some
a medal that you see on the screen when you get that kind of stat.
In plain Quake, hard to get more then 1 kill with just the plain
"boomstick"...the spread is only like 6-8 units or something like that,
while the ssg is alot wider in spread.
> Code wise it is logically the same, so its a matter of aesthetics.
Yes, true...simplifying is always alot better. I wonder if FTE compiler
would see that and optimize it?
> As far as counting hit ents, I'd likely dispense with the locals and use
> .chain
I try to avoid .chain because I read someplace a find radius command can
change that field inadvertently.
Not sure if this is fixed with Darkplaces or other engines, but it seems it
was maybe a Winquake bug.
I will experiment with that code you posted , maybe I will understand entity
chains a little better...it was always something
I never understood, and because of the findradius thing, I wound up avoiding
studying that pretty much completely in my Quake C degree ... :o)
> Also note - that loop could have a logic bug. It looks solid, but I
> find entity chains of any kind to
> have the potential to get messed up.
Yea, could be the bug I just mentioned.
I know for a fact during my modding, I will eprint (ent) for some reason
just to see what entities are touching a certain field or hitting a
traceline etc,
and it could be a brand new entity, just spawned a short time ago, and while
Im not assigning any .chain field to it in the spawn or elsewhere, its got
an entity number
in that field.
DP has some new entity chain management extensions that maybe are better to
use , have not tried them. Its also got a hitmask extension you can set so
tracelines can
collide with things normally they would not, and pick up tags on surfaces
and such, ala Quake 3 style with Quake 3 compiled maps.
Anyhow, I wound up finding what seems to be a short term solution to my goal
with the hitcount firing bullets. I am settling for a multikill, so the
count wont really matter
unless the entities hit are killed, which makes sense. This will pick up
multikills with almost all weapons. The trick is the self.attack_finished
timer. It works great with slower reloading weapons,
but with the faster like the LG, wont ever see a multikil unless both guys
have maybe 2 health between them and you aim exactly the center of where
they are touching.
====================================================================
.float kills_thisframe; // declare new field in safe place in defs.qc
In the function : W_WeaponFrame () in Weapons.qc , right above the
ImpulseCommands (); call, put:
self.kills_thisframe = 0; // reset number of kills this frame on a new
attack
In Combat.qc in the Killed () function, the line above :
ClientObituary(self, attacker);
paste this:
if (targ.flags & FL_CLIENT && attacker != world && targ != attacker) //
reinforcement player kills player
attacker.kills_thisframe = attacker.kills_thisframe + 1;
if (attacker.kills_thisframe >= 2)
{
bprint ("Multikill ! ! ! !\n");
}
====================================================================
Also since Im modding in a Q3-ish environment, there are pretty much no
spikes or nailguns. A thought crossed my mind, that
the sng in quake , ought to have maybe an allowance of bullets passing
through a target at close ranges. Namly the ssg and the sng.
So if you are up close with a sng you can calculate the distance from the
attacker and the targ and basicly set a "lethal" range, and modify the
damage
and or, make some code that appears to show the spike or bullet passing
through the player. Now you can have multikills with those kinds of weapons,
and it makes deathmatch combat more interesting. Of course sp with monsters
could also be more interesting too with the new tactics....
==
Cobalt
|