Jump to content

Home

+vstr possible in jka?


JackBaldy

Recommended Posts

"The +vstr command

 

You can bind a key to do one thing when you press it, and something else when you release it. Here's a really dumb example:

 

set script1 "cg_drawgun 0"

set script2 "cg_drawgun 1"

bind "K" "+vstr script1 script2"

 

So, hopefully this is pretty obvious. After +vstr, you write the name of 2 scripts that should be run. The first script will be executed on the key press, and the other will be executed on the key release. This particular script hides the gun while the key is pressed, and makes it reappear after the key is released.

 

You might think that when you press a key, script1 is executed once, and then when you release a key, script2 is executed once. This isn't true. Although the "release" script is always guaranteed to run only once, script1 will keep running again and again while the key is pressed. So, make sure you don't put anything in script1 that can't be run multiple times. For example, putting an echo statement in script1 would be really stupid because then that message might get echo'ed hundreds of times."

 

I was wondering if this was possible, maybe by a different command?

Link to comment
Share on other sites

I remember Amidala posted something about screenshots like this, here's what she said:

 

"/set cg_draw2d 0" removes the HUD (head-up display) and "SPECTATOR Choose Join from the Menu to enter the game" text if it is present. "/set cg_draw2d 1" restores it.

 

"/screenshot silent" takes a screenshot without the confirmation text "Wrote screenshots/shot0000.jpg" in the upper lefthand corner of the screen.

 

To do it all in one easy step:

 

/bind <key> "cg_draw2d 0;wait;screenshot silent;wait;cg_draw2d 1"

 

With one key bind that takes a silent screenshot with no HUD, and then restores your HUD, all in less than a second.

 

 

Hope that helped.

Link to comment
Share on other sites

Well it wasn't about taking screenshots like that, but I appreciate you trying to help. What I was wondering was that if it was possible in JKA that if I held a key it would do a specific action over and over (like the original example, it stops drawing the gun when I hold the key in enemy territory) and then does another action when I release it (begins drawing the gun again).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...