Binding several commands to one button

Guides and how to's on anything related to JK2, whether it's about modding or in-game topics.
Post Reply
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Binding several commands to one button

Post by Boothand »

I (more or less) recently figured out a way to bind a series of things to a button. The trick is to use quotation marks.
Say you were testing something on your server and every time you spawn, you want to teleport to a certain location, give yourself 999 armor and 1 health.

Here's an example: (type these in the console)

bind o "setviewpos 892 -1486 28 90; give armor 999; give health 1;"

Without quotation marks, only the first command would be executed.



For taking screenshots, for example, using wait commands may be necessary to make it happen in the correct frame.

bind n "cg_draw2d 0; cg_shadows 3; wait 5; screenshot; cg_draw2d 1; cg_shadows 1;"
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: Binding several commands to one button

Post by Daggolin »

This is actually not known by many players I think. Nice to have this posted somewhere. ;)
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: Binding several commands to one button

Post by ouned »

jk2's scripting system is pretty powerful. you can even get some logic out of it using "set" "vstr" and cvars.
Post Reply
Created by Matti from StylesFactory.pl and Warlords of Draenor (modified by jk2.info)
Powered by phpBB® Forum Software © phpBB Limited
 

 

cron