View Single Post
Old 08-24-2008, 11:27 AM   #6
nizwiz's Avatar
Join Date: Jul 2007
Posts: 159
Bad news: it isn't working too well, since there is a delay between switching the saber off and actually starting to grip. Unfortunately, that cannot be avoided I think.

Answering your post: There is no C involved, it's just binds (q3 console language, if you will).
Now, the simple idea behind it is, instead of using the default "bind <GRIP> +force_grip", you use "bind <GRIP> weapon 1; +force_grip" (with <GRIP> being a placeholder for the used key code), so everytime you do a grip your saber will go off. It isn't that simple, of course, since you can also grip when your saber is off (and then your saber would go on, obviously). Furthermore, if you're trying to do it the direct way, gripping will not cease after releasing the grip key.
And that's exactly where the problem is. You see, the + sign in front of force_grip indicates that the force power will be used as long as the key is pressed, and stopped upon releasing the key. This is hard-coded into the game, and as far as I can tell there is no way to specify exactly what will happen uon relasing the key;
To clarify it: if the engine would allow to bind on the events "key is pressed" and "key is released", than you could do it like that
bind +F1 weapon 1;+force_grip
bind -F2 weapon 1;-force_grip
But that's not the way it is implemented. Instead, if you do a "bind F1 +force_grip", you will have +force_grip mapped to the event "F1 is pressed" and -force_grip automatically mapped to the event "F1 is released" (also "bind F1 +force_grip; weapon 1" will not have anything mapped to the event "F1 is released", so you'll end up with force_grip being activated, but never deactivated, which is very awful to behold).
I don't see how you could overcome this problem without altering the code, which isn't really possible (no source code for sp, unfortunately).

Anyway, here's a package for you to try out:

You'll have to extract the contents to your base folder, then copy the file grip_saberoff.cfg.template and remove the ".template" extension from the copy, then edit the copy and replace the placeholders <GRIP> and <WEAPON1> with your preferred key codes for force_grip and weapon 1 (look in your jaconfig.cfg to find those key codes). Before trying it out, make a backup of your jaconfig.cfg, and restore it afterwards.
To use the binds, load a map (don't use a saved game, since that will prevent the animation changes to take effect) then enter "exec grip_saberoff" at the console (assuming the name of your copy is grip_saberoff.cfg).

EDIT: Because of the awful delay I stated above, I'd suggest you don't mod anything for sp and instead do it manually, i.e. press the grip button and the "weapon 1" button at the same time (or one immediately after the other). That looks much smoother.

Last edited by nizwiz; 08-24-2008 at 11:53 AM.
nizwiz is offline   you may: quote & reply,