Standing, Crouching, and Going Prone - Scripting -1 reply

Please wait...

believe

I'm too cool to Post

50 XP

16th February 2004

0 Uploads

16 Posts

0 Threads

#1 15 years ago

Mkay, to do this I think it would require you, before each key press, to check the your state. I don't know if this is possible, but I think this would be less complicated than remember 3 different key's in the heat of a battle. /bind MWHEELUP +moveup /bind MWHEELDOWN +movedown /bind MOUSE3 +prone this way you would move up when you pop your mouse wheel up, move down to crouch when you pop the button, or move down to a crouch when you pull it down. I know this isn't what you wanted but to get what you wanted would require a check on your standing/laying/crouching state and I wouldn't know how to do that. It's possible you could get a similar effect with moveup and movedown, I'm not sure though.

Cheers




Darwin_Award_Winner

Addicted to GF

50 XP

15th November 2003

0 Uploads

246 Posts

0 Threads

#2 15 years ago

Ok, we will call standing stance 0, crouching stance 1, and prone stance 2. This means that there are 6 stance transitions: 0-1 (from standing to crouching, firgure out the rest) 0-2 1-0 1-2 2-0 2-1

[PHP]set stance0 "-movedown; bind mwheelup vstr stance0-2; bind mwheeldown vstr stance0-1; bind space +moveup" set stance0-2 "+prone; -prone; vstr stance2" set stance0-1 "+movedown; vstr stance1"

set stance1 "+movedown; bind mwheelup vstr stance1-0; bind mwheeldown vstr stance1-2; bind space vstr stance1-0" set stance1-0 "-movedown; vstr stance0" set stance1-2 "-movedown; +prone; -prone; vstr stance2"

set stance2 "-movedown; bind mwheelup vstr stance2-1; bind mwheeldown vstr stance2-0; bind space vstr stance2-0" set stance2-1start "+prone; -prone; vstr stance1" set stance2-1end "+movedown; vstr stance1" set stance2-0 +moveup; -moveup; vstr stance0"

vstr stance0 //start standing[/PHP]

In addition to doing what you requested, it also makes it so that if you are not standing, spacebar will stand up, and if you are, it will jump. I just made this up on the spot, so it might not work, and even if it does work, there will be several inherent problems with it anyway. Specifically, if you are not standing when you die, it will take a few spacebar presses to tap out, because you have to be standing and then "jump" to tap out, so get in the habit of double- or tripple-tapping spacebar to tap out. Also, it causes problems when you try to go prone but fail because of an obstacle, or when an obstacle forces you out of prone position. The script will still think you are in a pron position, and since the command to unprone is the same as the command to go prone, any stance change might go prone instaed of the intended function, and just cause more problems. Also, rapid scrolling may confuse the script and attempt to execute several stance changes without actually doing them, leaving the script in the wrong stance mode. With these problems in mind, here is my own stance script, which uses the standard keys, spacebar, c and x:

[PHP]bind space "+moveup" bind c "vstr crouchswitch" bind x "vstr prone" set crouchswitch "vstr duck"

set stand "-movedown; set crouchswitch vstr duck; bind space +moveup" set duck "+movedown; set crouchswitch vstr stand; bind space vstr stand" set prone "-movedown; +prone; -prone; bind space +moveup; set crouchswitch vstr duck"[/PHP]

The only thing it doesn't do is go straight from prone to crouch, because that would cause one of the problems mentioned above. Otherwise, it works as follows: Spacebar stands up or jumps if already standing. C crouches, or if crouching it will stand up. Pressing c while prone can cause problems. X toggles prone.