View Full Version : I Need Manual Blocking Help.
07-30-2002, 09:07 PM
I have been working on a mod. I have successfully managed to incorporate some interesting things. One of these things is a manual blocking system. However, I can't seem to make it repeatedly drain a certain amount of force when it is held, but there is nothing to defend.
Some might say "Why would you want to do that?"; the reason is that I can imagine some lamer simply holding the button down all map so that they don't have to worry about blocking.
I'm trying to make saber blocking a skill, in both saber fights and in a "True" Jedi's interaction with gunners.
07-30-2002, 11:45 PM
Sorry I'm not much of a coder, but I did want to say that I think this is a great idea. You should make it saber blocking for blasters only, or make it so that every saber-saber contact results in saber locking outside of duels...it gets irritating because it seems like the sabers go through each other...but in the movies they repel each other...
07-31-2002, 12:13 AM
I don't know if this helps much, but a number of global variables are used to determine when a button is being held. BOTH_BUTTON_HOLD is one of them in the animtable.h file, you might be able to use it.
And the player is referenced by pointers, either self, client, ent, or a combination of them (depending on the function calling them).
So you could drain their force using the function BG_ForcePowerDrain() in bg_saber.c at around line 38 if you added this blocking as a force power, or just do something like:
self->client->ps.fd.forcePower -= amountToDrain;
as long as they hold their button down.
Also, look at the ForceLightning commands in w_force.c - they behave like the function you're describing.
I hope that helps a little.
07-31-2002, 01:09 AM
I just wanted to thank you two for your input.
Chrono, I didn't say it in my post (I hate long posts that don't get to the point) but I did make holding "BLOCK" necessary for only entities coming from guns.
Darth_Syrup, thanks. I was able to follow the logic back to the routine that is called periodically to check if the lightning is being held.
If you guys like the saber idea I have a few more to bounce off you. I should start another thread for this, but oh well:
Really Fast speed for a short time. (3.75 for 800ms)
A Speed-Push that inflicts physical damage.
A Speed-Strike saber attack. (yeah I like speed as a modifier)
Increase the cost of lightning force.
No Drain or Heal.
A Force that slows projectiles down when they're near you (will simulate bullet time but just for shots near you and won't affect players)
I have already done the first four, but I would appreciate your input on the concepts. I have about 5 more but, alas I hate over long posts.
vBulletin®, Copyright ©2000-2014, Jelsoft Enterprises Ltd.