Repository navigation
How do I combine the bind and print commands?
#1033
|
My goal is to use the v key to change the I have tried to do this by combining two commands that work independently: The first binds the v key to It changes the
The second will
I tried to combine them using a semi colon and as a join but faced a couple of issues:
NotesOriginally added as a follow up question: |
Replies: 1 comment
|
You can do it in one How that's parsed, from
Keep the whole action under 127 characters ( I haven't run this in the game, it's from reading the source. |



You can do it in one
bind: the quotes have to go around the whole list of commands, not just the first one. Sinceprintneeds its own double quotes, use single quotes on the outside:How that's parsed, from
c_cmds.c/c_console.c:bindtakes everything after the control as the action and strips one pair of outer quotes,"…"or'…'(M_StripQuotes). If the action isn't wrapped in quotes, it's rejected as an invalid action. That's what happened withbind v "toggle r_voxels"; if …: the quotes close aftertoggle r_voxels, so the whole line doesn't start and end with a quote.;a…