Optimizing My Control Settings


(DrRipper) #21

If you use the mouse scroll, be careful not to over-scroll. Most MS mice have a wheel that does not have clicks so you scroll all the way from prone to stand when you just want to go to crouch. I bind my scroll to select special weapons based on what class I am. With engie, scroll up to mine, scroll again to switch back to SMG and a slightly different function if I’m a soldier. It’s basically a mod I made based on Cowboy’s SuperSelector script that implements different key binds for each class using the same keys.

I’ve wrote up a little tutorial for my clanmates as to how to script. Check it out, hope it’s easier to understand.

http://pcmaxx.net/modules.php?name=Forums&file=viewtopic&t=665


(squadjot) #22

if u still cant make it work…pm me


(kevinski) #23

I understand how things are organized, but I don’t understand how the script works. Take the first script, for example:

You have the ‘set stand’, ‘set crouch’, and ‘set prone’ sections. How are those executed? I understand the actions that’re taking place in order to crouch, for instance. It simply uses ‘+movedown’ to crouch, while using ‘-prone’ to cancel the prone stance if the player happens to be going from prone to crouch. I don’t understand the ‘set *** vstr ****’ and such.

Could you explain in detail how mwheelup “vstr foo” and mwheeldown “vstr bar” allow you to cycle through the other three lines of the script? It honestly makes no sense to me.


(Kendle) #24

vstr tells ET to execute a user-defined command, so bind key “vstr your-command” simply tells ET to execute whatever you’ve defined in your-command when you press key. The vstr is required to tell ET that your-command is not a built-in command that comes with the game (cos it’s too stupid to tell otherwise).

The way you define your own commands is to set them, just like any other variable, set your-command “command1; command2” for example.

So defining your own command, and binding it to a key is a 2-step process.

set your-command “command1; command2; etc.”
bind key “vstr your-command”

In the example script, 2 user-defined commands are bound to the mouse wheel. The actual contents of these user-defined commands are themselves defined in the 3 set statements below. The last line, vstr stand, tells ET to execute the contents of the stand user-defined command, which in turn sets the initial values of foo and bar.

It gets confusing because the script defines a command which itself defines a command. This is so the actual commands bound to the keys can be changed dynamically by the script.

Initially mwheelup = foo = prone. But the value of foo is altered by the script, so the action that mwheelup performs is also altered, without having to re-bind mwheelup to something else.

An alternative way of doing the same thing would be:-


bind mwheelup "vstr prone" 
bind mwheeldown "vstr crouch" 

set stand "-movedown;-prone;bind mwheelup vstr prone;bind mwheeldown vstr crouch" 
set crouch "+movedown;-prone;bind mwheelup vstr stand;bind mwheeldown vstr prone" 
set prone "-movedown;+prone;bind mwheelup vstr crouch;bind mwheeldown vstr stand" 

Clear as mud? :slight_smile:

To get this script to work you might need to alter the order of execution, like this:-


bind mwheelup "vstr prone" 
bind mwheeldown "vstr crouch" 

set stand "-movedown;-prone;bind mwheelup vstr prone;bind mwheeldown vstr crouch" 
set crouch "-prone;+movedown;bind mwheelup vstr stand;bind mwheeldown vstr prone" 
set prone "-movedown;+prone;bind mwheelup vstr crouch;bind mwheeldown vstr stand" 

One thing to add, as someone has mentioned above, binding stuff like this to the mouse wheel can be a bit tricky because of the way the game interepts mouse wheel “clicks”. Try adding this line to see if it helps:-

seta cg_weaponcycledelay 150

You might even have to increase the number on the end. This is the number of milliseconds that have to elapse whilst turning the mouse wheel before ET considers it’s been turned a 2nd time. If this value were 0 you could find the script doesn’t work because as soon as you turn the wheel it executes stand, crouch, prone etc. very quickly so you end up doing something you didn’t mean to.


(Ifurita) #25

I still don’t see why this is so difficult … but that’s me.

The reason for the

set foo vstr prone;set bar vstr crouch

is because on the first click of the mousewheel, you are going to do execute action A (crouch) with the option of standing (mwheelup) or going prone (mwheeldown)

However, once you execute one of these operations, you need to change your options. If I now go prone, then my mwheel needs to be rebound to stand (mwheelup) or crouch (mwheeldown) or however you want your actions sequences.

This rebinding or reassignment of commands is what the

set foo vstr prone;set bar vstr crouch
set foo vstr stand;set bar vstr prone
set foo vstr crouch;set bar vstr stand

lines do. ‘foo’ is just dummy alias for mwheelup and ‘bar’ is the dummy variable for ‘wheeldown’

In fact, you can replace

set foo vstr prone;set bar vstr crouch

with

bind mwheelup vstr prone;bind mwheeldown vstr crouch

However, this gets clunky after a while


(kevinski) #26

THAT clears up a lot. I guess I was simply ignoring that final command. It makes sense now. Thanks, Kendle. :slight_smile:

I honestly didn’t know that was possible, but it definitely sounds like a good idea. I’ll hafta weed through the default configs and see what this is set to initially, because I can definitely tell that my clicks don’t always seem to register fast enough for my liking (for weapon switching, anyway). By the way, is this the reason behind the problem with switching to or from the Panzerfaust at times? It honestly seems to not respond for me at times, and it’s only with the Panzerfaust.


(kevinski) #27
bind space "vstr spacebar"
bind mwheelup "vstr north"
bind mwheeldown "vstr south"

set stand "-movedown; -prone; set north vstr prone; set south vstr crouch; set spacebar vstr jump"
set crouch "-prone; +movedown; set north vstr stand; set south vstr prone; set spacebar vstr stand"
set prone "-movedown; +prone; -prone; set north vstr crouch; set south vstr stand; set spacebar vstr stand"
set jump "-movedown; -prone; +moveup; set north vstr prone; set south vstr crouch; set spacebar vstr jump"

vstr stand

Didn’t quite work out as planned. I added the jump section to differentiate between pressing space while standing and while crouching or prone. Basically, pressing space while standing should make you jump, while pressing space while crouching or prone should simply make you stand up.

As I said, though, it didn’t quite work out as planned. I was only able to jump once, and the cycling didn’t work well at all. Funny, considering the fact that I almost had it working. I had actually tried it with a slightly different script before, without the -prone after the initial +prone in the prone section. The only reason I added it was to stop the player from going prone, then getting up, then going prone, then getting up again. It was annoying. Obviously my intended fix didn’t help matters.


(kevinski) #28

Is it possible (or should I say ‘allowed’) to put a line break between portions of the code. For instance, to keep everything within 80 characters per line in my text editor, could I do the following?

set stand "-movedown; -prone; set north vstr prone; set south vstr crouch;
set spacebar vstr jump"

instead of

set stand "-movedown; -prone; set north vstr prone; set south vstr crouch; set spacebar vstr jump"

(Lagger) #29

i made something that i actually tested, and it works!

bind mwheelup "vstr foo" 
bind mwheeldown "vstr bar" 

set stand_prone "+prone;-prone;-movedown;set foo vstr prone_stand;set bar vstr crouch_stand" 
set stand_crouch "-movedown;set foo vstr prone_stand;set bar vstr crouch_stand" 
set crouch_stand "+movedown;set foo vstr stand_crouch;set bar vstr prone_crouch" 
set crouch_prone "+prone;-prone;+movedown;set foo vstr stand_crouch;set bar vstr prone_crouch" 
set prone_crouch "-movedown;+prone;-prone;set foo vstr crouch_prone;set bar vstr stand_prone" 
set prone_stand "+prone;-prone;set foo vstr crouch_prone;set bar vstr stand_prone" 

vstr stand_crouch

it’s even messier than before… but hey! it works


(kevinski) #30

Thanks, Lagger. Your script definitely got me further on my own. Just one problem: Adding the jump button into it really threw things out of whack. Honestly, everything work just fine…until you jump.

seta cg_weaponcycledelay 250 //Mouse Wheel Response Time (milliseconds)

bind space "vstr spcbr"
bind mwheelup "vstr north"
bind mwheeldown "vstr south"

set c2p "-movedown; +prone; -prone; set north vstr p2c; set south vstr p2s; set spcbr vstr p2s"
set c2s "-movedown; set north vstr s2p; set south vstr s2c; set spcbr vstr jump"
set p2c "+prone; -prone; +movedown; set north vstr c2s; set south vstr c2p; set spcbr vstr c2s"
set p2s "+prone; -prone; -movedown; set north vstr s2p; set south vstr s2c; set spcbr vstr jump"
set s2c "+movedown; set north vstr c2s; set south vstr c2p; set spcbr vstr c2s"
set s2p "+prone; -prone; set north vstr p2c; set south vstr p2s; set spcbr vstr p2s"
set jump "+moveup; -moveup; set north vstr s2p; set south vstr s2c; set spcbr vstr jump"

vstr c2s

Note that I said ‘until you jump’. Using jump to un-crouch or un-prone works just fine. I’m not entirely sure, but I believe the version of the code I pasted above doesn’t actually allow you to jump. The jump button WILL allow you to un-crouch and un-prone, though. Any tips?


(kevinski) #31

And I think I’m sorta getting the hang of scripting. Too bad thinking things through is more difficult than the scripting itself.


(kevinski) #32

Well, I finally got it to work. It might be a little redundant, but I can always mess with it a little more to cut it down in terms of size. Anyway, here’s the final script:

seta cg_weaponcycledelay 250 //Mouse Wheel Response Time (milliseconds)

bind space "vstr spcbr"
bind mwheelup "vstr north"
bind mwheeldown "vstr south"

set c2p "-movedown; +prone; -prone; set north vstr p2c; set south vstr p2s; set spcbr vstr p2s"
set c2s "-movedown; set north vstr s2p; set south vstr s2c; set spcbr vstr jump"
set p2c "+prone; -prone; +movedown; set north vstr c2s; set south vstr c2p; set spcbr vstr c2s"
set p2s "+prone; -prone; -movedown; set north vstr s2p; set south vstr s2c; set spcbr vstr jump"
set s2c "+movedown; set north vstr c2s; set south vstr c2p; set spcbr vstr c2s"
set s2p "+prone; -prone; set north vstr p2c; set south vstr p2s; set spcbr vstr p2s"
set jump "+moveup; wait; wait; wait; -moveup; set north vstr s2p; set south vstr s2c; set spcbr vstr jump"

vstr c2s

Basically, the mouse wheel works as I planned for it to, and the spacebar now lets you stand up from either a crouched or prone position. Thanks to everyone that helped me figure out scripting. :slight_smile:


(squadjot) #33

shit…didnt see page two!!! :stuck_out_tongue: looool

oh well…hers another version…

set reset_pos “-movedown; bind space +moveup; -moveup; bind mwheelup vstr to_prone; bind mwheeldown vstr go_crouch”
set from_prone “vstr reset_pos ; +prone; -prone;”
set to_prone “-movedown; +prone; -prone; bind mwheelup vstr go_crouch_from_proned; bind mwheeldown vstr from_prone”
set go_crouch “+movedown; bind space vstr jump_from_crouch; bind mwheelup vstr reset_pos; bind mwheeldown vstr to_prone”
set go_crouch_from_proned “+prone; -prone; +movedown; bind space vstr jump_from_crouch; bind mwheelup vstr reset_pos; bind mwheeldown vstr to_prone”
set jump_from_crouch “vstr reset_pos; +moveup; -moveup”

vstr reset_pos

:smiley: