View previous topic :: View next topic |
Author |
Message |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Fri Sep 28, 2007 11:29 pm Post subject: RL Kickback |
|
|
I'm trying (unsucessfully) to get the players view to kick up a bit after launching a rocket.
I've tried this:
Code: | if ((self.weapon == IT_ROCKET_LAUNCHER) && (self.button0) ) //kick
{
v_up = v_up * 1.33;
self.mangle_z = self.mangle_z * 1.33;
self.angles_z = self.angles_z * 1.33;
//self.idealpitch = self.idealpitch * 1.33;
//self.v_angle = self.v_angle * 1.33;
} |
I commented out the bits that wouldn't compile.
Am I in the right ballpark? _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Entar

Joined: 05 Nov 2004 Posts: 422 Location: At my computer
|
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Sat Sep 29, 2007 8:10 am Post subject: |
|
|
Yeah, just set player.punchangle_x to -8 or somtehing (if not, set it to positive 8 ). It takes a while for it to ease back to normal though, so have fun... _________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe. |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Sat Sep 29, 2007 7:22 pm Post subject: |
|
|
Doesn't work, maybe b/c i'm using QW? _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Sat Sep 29, 2007 7:28 pm Post subject: |
|
|
I think QW might have turned it into a SVC message. I don't think it was even implemented though? I'm not sure, I've never really used QW. _________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe. |
|
Back to top |
|
 |
Orion

Joined: 12 Jan 2007 Posts: 414 Location: Brazil
|
Posted: Sat Sep 29, 2007 7:38 pm Post subject: |
|
|
In W_FireRocket(), you'll find stuff like this:
Code: |
msg_entity = self;
WriteByte (MSG_ONE, SVC_SMALLKICK);
|
Change the SVC to SVC_BIGKICK, but there's only smallkick and bigkick (used by super shotgun). If you want a bigger kickback, you should do stuff that I don't even know. _________________ There's no signature here. Stop looking for one. |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Sat Sep 29, 2007 7:41 pm Post subject: |
|
|
okey doke _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Sat Sep 29, 2007 9:42 pm Post subject: |
|
|
SVC_BIGKICK doesn't seem to do anything,
I guess it's one of those QW things.
I'll figure something out. Thanks anyway.  _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Orion

Joined: 12 Jan 2007 Posts: 414 Location: Brazil
|
Posted: Sun Sep 30, 2007 3:23 pm Post subject: |
|
|
Not at all.
Another note, QW was made to play online with a better ping than NQ, not to make custom effects, kickbacks, etc. NQ is better in custom effects, because it has particle() to create a particle of a specified color, punchangle_x, _y, and _z for the kickback, etc. That's why a "stock" NQ engine is really bad to play online, Darkplaces or FTEQW is better to play NQ online, but I prefer QW to play deathmatch, clan arena, or team fortress.
And I prefer NQ to practice against my bots, or play single-player.
So, if QW have particle() and other custom effect stuff, it'll be just like an NQ client, an awful unplayable laggy client. That was for lag's sake, that's why the shotgun smoke puffs don't spread in QW too. The tracelines spreads, but the smoke puffs not. _________________ There's no signature here. Stop looking for one. |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Sun Sep 30, 2007 5:02 pm Post subject: |
|
|
particle() doesn't make the difference...
it's the other things... like QW's insane compression of nails... _________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe. |
|
Back to top |
|
 |
Orion

Joined: 12 Jan 2007 Posts: 414 Location: Brazil
|
Posted: Sun Sep 30, 2007 5:38 pm Post subject: |
|
|
I take a look at an NQ engine source code.
When I saw the TE_GUNSHOT effects, it's just a particle effect, if I call in QC a line like this:
Code: |
particle (trace_endpos, '0 0 0', 0, 20);
|
It will be EXACTLY like a shotgun smoke puff, so particle() in NQ reduces many lines of code!
The spikes hitting wall is the same particle stuff, but with randomized ricochet sounds.
Take a look at the sound stuff in the engine code:
Code: |
case TE_SPIKE: // spike hitting wall
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
#ifdef GLTEST
Test_Spawn (pos);
#else
R_RunParticleEffect (pos, vec3_origin, 0, 10);
#endif
if ( rand() % 5 )
S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
else
{
rnd = rand() & 3;
if (rnd == 1)
S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
else if (rnd == 2)
S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
else
S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
}
break;
|
the (rand() % 5) is just like (random() > 0.05) right? And notice that it spawns a particle effect with the same color as a gunshot, but with 10 instead of 20.
An explosion can be used as a particle effects, if you use 255 in the counter, the particles will be just like an explosion, 75 is the original explosion color, but no sound will be played. _________________ There's no signature here. Stop looking for one. |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Mon Oct 01, 2007 1:47 am Post subject: |
|
|
If I wanted to add punchangle to QW.
I see that I'd have to add:
Code: | .vector punchangle; |
to defs.qc.
What else would I need to do? _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Orion

Joined: 12 Jan 2007 Posts: 414 Location: Brazil
|
Posted: Mon Oct 01, 2007 2:06 am Post subject: |
|
|
In W_FireRocket(), replace the SVC_SMALLKICK stuff by this:
Code: |
self.punchangle_x = -10;
|
But it might not work in QW... _________________ There's no signature here. Stop looking for one. |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Mon Oct 01, 2007 2:36 am Post subject: |
|
|
Yeah, I already had that part.
Do I have to call a function like:
Code: | void() Punchangle =
{ |
anywhere? _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Mon Oct 01, 2007 9:06 pm Post subject: |
|
|
In combat.qc there is some code that makes the target move from the splash damage of a rocket or grenade:
Code: | targ.velocity = targ.velocity + dir * damage * 9; |
So I added this code:
Code: | attacker.velocity = attacker.velocity - dir * 200; |
The only problem is the direction in which the player (attacker)moves varies. Is there a way to make the player move backwards? _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
|