r5914 - in trunk/data: . qcsrc/client qcsrc/common qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Fri Feb 20 13:17:24 EST 2009
Author: div0
Date: 2009-02-20 13:17:23 -0500 (Fri, 20 Feb 2009)
New Revision: 5914
Modified:
trunk/data/check-sounds.sh
trunk/data/defaultNexuiz.cfg
trunk/data/qcsrc/client/Main.qc
trunk/data/qcsrc/client/particles.qc
trunk/data/qcsrc/common/constants.qh
trunk/data/qcsrc/server/cl_client.qc
trunk/data/qcsrc/server/defs.qh
trunk/data/qcsrc/server/g_world.qc
trunk/data/qcsrc/server/w_nex.qc
Log:
nex beam stuff by green
Modified: trunk/data/check-sounds.sh
===================================================================
--- trunk/data/check-sounds.sh 2009-02-20 15:06:02 UTC (rev 5913)
+++ trunk/data/check-sounds.sh 2009-02-20 18:17:23 UTC (rev 5914)
@@ -87,25 +87,32 @@
;;
//*)
identifiers_seen="$identifiers_seen ${TITLE#//}"
- good=false
- case "$COUNT" in
- 0)
- if psoundtry "$SOUND"; then
- good=false
- fi
- ;;
- *)
- for i in `seq 1 $COUNT`; do
- if psoundtry "$SOUND$i"; then
- good=true
+ for X in $allidentifiers; do
+ if [ "$X" = "${TITLE#//}" ]; then
+ good=true
+ fi
+ done
+ if $good; then
+ good=false
+ case "$COUNT" in
+ 0)
+ if psoundtry "$SOUND"; then
+ good=false
fi
- done
- ;;
- esac
- if $good; then
- echo "$S references existing sound $SOUND but commented out"
- else
- echo "$S does not have a sound for ${TITLE#//} yet"
+ ;;
+ *)
+ for i in `seq 1 $COUNT`; do
+ if psoundtry "$SOUND$i"; then
+ good=true
+ fi
+ done
+ ;;
+ esac
+ if $good; then
+ echo "$S references existing sound $SOUND but commented out"
+ else
+ echo "$S does not have a sound for ${TITLE#//} yet"
+ fi
fi
;;
*)
Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg 2009-02-20 15:06:02 UTC (rev 5913)
+++ trunk/data/defaultNexuiz.cfg 2009-02-20 18:17:23 UTC (rev 5914)
@@ -273,6 +273,9 @@
set sv_timeout_leadtime 4 "how long the players will be informed that a timeout was calledbefore it starts, in seconds"
set sv_timeout_resumetime 3 "how long the remaining timeout-time will be after a player called the resumegame command"
+set g_allow_oldnexbeam 0 "If enabled, clients are allowed to use old v2.3 Nexgun beam"
+set cl_particles_oldnexbeam 0 "Uses the old v2.3 Nexgun beam instead of the new beam, only works if server allows it (g_allow_oldnexbeam = 1)"
+
// use default physics
exec physics25.cfg
Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc 2009-02-20 15:06:02 UTC (rev 5913)
+++ trunk/data/qcsrc/client/Main.qc 2009-02-20 18:17:23 UTC (rev 5914)
@@ -1009,6 +1009,10 @@
Net_ReadZCurveParticles();
bHandled = true;
break;
+ case TE_CSQC_NEXGUNBEAMPARTICLE:
+ Net_ReadNexgunBeamParticle();
+ bHandled = true;
+ break;
default:
// No special logic for this temporary entity; return 0 so the engine can handle it
bHandled = false;
Modified: trunk/data/qcsrc/client/particles.qc
===================================================================
--- trunk/data/qcsrc/client/particles.qc 2009-02-20 15:06:02 UTC (rev 5913)
+++ trunk/data/qcsrc/client/particles.qc 2009-02-20 18:17:23 UTC (rev 5914)
@@ -243,3 +243,18 @@
zcurveparticles(effectnum, start, end, end_dz, speed, 5); // at most 32 segments
}
+
+void Net_ReadNexgunBeamParticle()
+{
+ vector shotorg, endpos;
+ shotorg_x = ReadCoord(); shotorg_y = ReadCoord(); shotorg_z = ReadCoord();
+ endpos_x = ReadCoord(); endpos_y = ReadCoord(); endpos_z = ReadCoord();
+
+ pointparticles(particleeffectnum("nex_muzzleflash"), shotorg, normalize(endpos - shotorg) * 1000, 1);
+
+ //draw either the old v2.3 beam or the new beam
+ if (cvar("cl_particles_oldnexbeam") && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo()))
+ trailparticles(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos);
+ else
+ trailparticles(world, particleeffectnum("nex_beam"), shotorg, endpos);
+}
Modified: trunk/data/qcsrc/common/constants.qh
===================================================================
--- trunk/data/qcsrc/common/constants.qh 2009-02-20 15:06:02 UTC (rev 5913)
+++ trunk/data/qcsrc/common/constants.qh 2009-02-20 18:17:23 UTC (rev 5914)
@@ -46,6 +46,7 @@
const float TE_CSQC_RACE = 101;
const float TE_CSQC_SPAWN = 102;
const float TE_CSQC_ZCURVEPARTICLES = 103;
+const float TE_CSQC_NEXGUNBEAMPARTICLE = 104;
const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const float RACE_NET_CHECKPOINT_CLEAR = 1;
@@ -242,6 +243,7 @@
const float STAT_STRENGTH_FINISHED = 38;
const float STAT_INVINCIBLE_FINISHED = 39;
const float STAT_PRESSED_KEYS = 42;
+const float STAT_ALLOW_OLDNEXBEAM = 43; // this stat could later contain some other bits of info, like, more server-side particle config
const float CTF_STATE_ATTACK = 1;
const float CTF_STATE_DEFEND = 2;
const float CTF_STATE_COMMANDER = 3;
Modified: trunk/data/qcsrc/server/cl_client.qc
===================================================================
--- trunk/data/qcsrc/server/cl_client.qc 2009-02-20 15:06:02 UTC (rev 5913)
+++ trunk/data/qcsrc/server/cl_client.qc 2009-02-20 18:17:23 UTC (rev 5914)
@@ -2078,6 +2078,7 @@
{
self.stat_sys_ticrate = cvar("sys_ticrate");
self.stat_game_starttime = game_starttime;
+ self.stat_allow_oldnexbeam = cvar("g_allow_oldnexbeam");
if(blockSpectators && frametime)
// WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
Modified: trunk/data/qcsrc/server/defs.qh
===================================================================
--- trunk/data/qcsrc/server/defs.qh 2009-02-20 15:06:02 UTC (rev 5913)
+++ trunk/data/qcsrc/server/defs.qh 2009-02-20 18:17:23 UTC (rev 5914)
@@ -514,6 +514,7 @@
.string message2;
vector railgun_start, railgun_end; // filled by FireRailgunBullet, used by damage code for head shot
+.float stat_allow_oldnexbeam;
// reset to 0 on weapon switch
// may be useful to all weapons
Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc 2009-02-20 15:06:02 UTC (rev 5913)
+++ trunk/data/qcsrc/server/g_world.qc 2009-02-20 18:17:23 UTC (rev 5914)
@@ -542,6 +542,7 @@
addstat(STAT_WEAPONS, AS_INT, weapons);
addstat(STAT_SWITCHWEAPON, AS_INT, switchweapon);
addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime);
+ addstat(STAT_ALLOW_OLDNEXBEAM, AS_INT, stat_allow_oldnexbeam);
Nagger_Init();
addstat(STAT_STRENGTH_FINISHED, AS_FLOAT, strength_finished);
Modified: trunk/data/qcsrc/server/w_nex.qc
===================================================================
--- trunk/data/qcsrc/server/w_nex.qc 2009-02-20 15:06:02 UTC (rev 5913)
+++ trunk/data/qcsrc/server/w_nex.qc 2009-02-20 18:17:23 UTC (rev 5914)
@@ -1,3 +1,15 @@
+void SendCSQCNexBeamParticle() {
+ WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
+ WriteByte(MSG_BROADCAST, TE_CSQC_NEXGUNBEAMPARTICLE);
+
+ WriteCoord(MSG_BROADCAST, w_shotorg_x);
+ WriteCoord(MSG_BROADCAST, w_shotorg_y);
+ WriteCoord(MSG_BROADCAST, w_shotorg_z);
+ WriteCoord(MSG_BROADCAST, trace_endpos_x);
+ WriteCoord(MSG_BROADCAST, trace_endpos_y);
+ WriteCoord(MSG_BROADCAST, trace_endpos_z);
+}
+
void W_Nex_Attack (void)
{
float flying;
@@ -11,10 +23,9 @@
if(yoda && flying)
announce(self, "announcer/male/yoda.wav");
- pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
-
- // beam effect
- trailparticles(world, particleeffectnum("nex_beam"), w_shotorg, trace_endpos);
+ //beam and muzzle flash done on client
+ SendCSQCNexBeamParticle();
+
// flash and burn the wall
if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
Damage_DamageInfo(trace_endpos, cvar("g_balance_nex_damage"), 0, 0, cvar("g_balance_nex_force") * w_shotdir, WEP_NEX);
More information about the nexuiz-commits
mailing list