weapon scripting

M

MJs nose

Guest
I created a little weapon script so that i could toss a nade, switch to the gravity gun to pick up the nade, and then throw them at people. I'm really good at doing it manually, but i wanted to be able to do it with one press of a key. Here's the script that i bound to a key.

The wait15 command is an alias consisting of 15 waits.

"+attack2; wait15; -attack2; wait15; slot1; +attack2"

What this does is when you have the nades out, it executes the secondary fire on the nade, waits 15 frames, deactivates the secondary fire, waits another 15 frames, switches to slot1(grav gun) and then executes the secondary fire on the grav gun. My problem is that i can't get it to deactivate the secondary fire on the grav gun. I've tried doing this...

"+attack2; wait15; -attack2; wait15; slot1; +attack2; wait15; -attack2"

which would logically deactivate the secondary fire on the grav gun, but it only drops the nade. Which is strange because it shouldn't. In order to hold an item with the grav gun, all you have to do is press the secondary fire once and it'll hold it. But for some reason, it is releasing it. I've come up with a temporary fix by binding "-attack2" to another key and then just pressing it after i've thrown the nade at somebody, but that becomes tiresome and slow. Makes quickly throwing two nades in a row at somebody almost impossible. Any suggestions?

Edit: oh, also... i've put my alias in the config.cfg file, but it doesn't seem to stay and i have to redefine the alias everytime i restart the game.
 
I would try this if I were you:

Code:
alias gravnade "+attack2; wait15; -attack2; wait15; slot1; +attack2; gravnade2"

alias gravnade2 "-attack2"

This way you dont have to press a seperate key to disable grav gun alt fire..it just calls gravnade2 alias. Also put it in autoexec.cfg so you dont need to type the alias everytime.
 
Slip778 said:
I would try this if I were you:

Code:
alias gravnade "+attack2; wait15; -attack2; wait15; slot1; +attack2; gravnade2"

alias gravnade2 "-attack2"

This way you dont have to press a seperate key to disable grav gun alt fire..it just calls gravnade2 alias. Also put it in autoexec.cfg so you dont need to type the alias everytime.

That is basically what his
"+attack2; wait15; -attack2; wait15; slot1; +attack2; wait15; -attack2"

does.
 
MJs nose said:
I created a little weapon script so that i could toss a nade, switch to the gravity gun to pick up the nade, and then throw them at people. I'm really good at doing it manually, but i wanted to be able to do it with one press of a key. Here's the script that i bound to a key.

The wait15 command is an alias consisting of 15 waits.

"+attack2; wait15; -attack2; wait15; slot1; +attack2"

What this does is when you have the nades out, it executes the secondary fire on the nade, waits 15 frames, deactivates the secondary fire, waits another 15 frames, switches to slot1(grav gun) and then executes the secondary fire on the grav gun. My problem is that i can't get it to deactivate the secondary fire on the grav gun. I've tried doing this...

"+attack2; wait15; -attack2; wait15; slot1; +attack2; wait15; -attack2"

which would logically deactivate the secondary fire on the grav gun, but it only drops the nade. Which is strange because it shouldn't. In order to hold an item with the grav gun, all you have to do is press the secondary fire once and it'll hold it. But for some reason, it is releasing it. I've come up with a temporary fix by binding "-attack2" to another key and then just pressing it after i've thrown the nade at somebody, but that becomes tiresome and slow. Makes quickly throwing two nades in a row at somebody almost impossible. Any suggestions?

Edit: oh, also... i've put my alias in the config.cfg file, but it doesn't seem to stay and i have to redefine the alias everytime i restart the game.


1. Make your config.cfg file read only so steam doesn't try to overwrite it.

2. Scripts are lame. If you can do it fine regular then just do it regular. It will make people who depend on scripts jealous and it will keep you from being dependant on scripts to play.
 
Back
Top