Inside3D!
     

RL Kickback
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Fri Sep 28, 2007 11:29 pm    Post subject: RL Kickback Reply with quote

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
View user's profile Send private message Send e-mail
Entar



Joined: 05 Nov 2004
Posts: 422
Location: At my computer

PostPosted: Sat Sep 29, 2007 5:53 am    Post subject: Reply with quote

I believe there's a specific thing for this, called punchangle iirc, which you set and the view is "punched" up by that far, and moved back to normal over a short time.
_________________
woh... feelin woozy... too much cider...
http://entar.quakedev.com
games fascination - My Game Development Blog/Journal
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Sat Sep 29, 2007 8:10 am    Post subject: Reply with quote

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
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Sat Sep 29, 2007 7:22 pm    Post subject: Reply with quote

Doesn't work, maybe b/c i'm using QW?
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Sat Sep 29, 2007 7:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
Orion



Joined: 12 Jan 2007
Posts: 414
Location: Brazil

PostPosted: Sat Sep 29, 2007 7:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Sat Sep 29, 2007 7:41 pm    Post subject: Reply with quote

okey doke
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Sat Sep 29, 2007 9:42 pm    Post subject: Reply with quote

SVC_BIGKICK doesn't seem to do anything,
I guess it's one of those QW things.
I'll figure something out. Thanks anyway. Smile
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Orion



Joined: 12 Jan 2007
Posts: 414
Location: Brazil

PostPosted: Sun Sep 30, 2007 3:23 pm    Post subject: Reply with quote

Not at all. Smile

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
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Sun Sep 30, 2007 5:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Orion



Joined: 12 Jan 2007
Posts: 414
Location: Brazil

PostPosted: Sun Sep 30, 2007 5:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Mon Oct 01, 2007 1:47 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Orion



Joined: 12 Jan 2007
Posts: 414
Location: Brazil

PostPosted: Mon Oct 01, 2007 2:06 am    Post subject: Reply with quote

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
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Mon Oct 01, 2007 2:36 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Mon Oct 01, 2007 9:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group