Skip to content
WhyTheHellIsEvery4thYearGarbage? edited this page Nov 22, 2020 · 43 revisions

NOTE:

  • Syntax can change at any time.
  • How the captions display will vary based on your hud.
  • Titles should be written as though you are writing captions.

Comment

/* ... */ makes a block comment. // makes an inline comment.

Example:

/*
This page is unfinished. Don't compile yet.
*/
// TODO: Remove unicode support.

Bind

A bind is a command or string of commands that executes when a key is pressed. (More Info)
In the VMG Language, a bind is a command string that is displayed as its title, and bound to a number key.

Syntax: BIND <title : string> <command string : string> |

Example: BIND "#ÜbersawIsOverrated" "say #ÜbersawIsOverrated" |

Display in voicemenu:

#ÜbersawIsOverrated hashtag in captions.
*1 key is pressed*
Output:

#ÜbersawIsOverrated hashtag in chat.

The number key bound is determined by the bind's placement in a page. For example in the page:

"warnings" {
	BIND "Sniper!" "say_team Sniper Ahead!" |
	BIND "Sticky Trap!" "say_team Sticky Trap Ahead!" |
	BIND "Flank!" "say_team Sniper Incoming Flank!" |
}

The bind titled "Sniper!" will be bound to 1, since it appears first.
The bind titled "Sticky Trap!" will be bound to 2.
The bind titled "Flank!" will be bound to 3.

Toggle Bind

Syntax: TOGGLE BIND <title : string> <command string : string> <title : string> <command string : string> ... |

A toggle bind is a bind with multiple states. Each time it is ran, it changes to the next state until it modulates back to its first state. The first state is always the first bind (first 2 strings).

Example:

TOGGLE BIND "Debug Full" "debug=on" "Debug Minimal" "debug=minimal" "Debug Off" "debug=off"  |

Result in-game:
1. Debug Full
*hits 1*
*executes "debug=on"*
1. Debug Minimal
*hits 1*
*executes "debug=minimal"*
1. Debug Off
*hits 1*
*executes "debug=off"*
cycles back to Debug Full

Page

Syntax: <title : string> { ... }

A page is a collection of binds and toggle binds. You can insert pages into parent pages to execute in tree-like fashion, or run "exec $pageopen_<title>" to execute them directly. NOTE: In the files, a page uses a formatted title in which:

  • Has caption tags, punctuation, and non-ascii characters removed.
  • Is all lower case.
  • All spaces ( ) are replaced with underscores (_).

For instance, the page titled "Callouts" will use "callouts" internally in the voicemenu vpk. If you were to open this page, you'd need to call exec $pageopen_callouts.

Example:

"<B>Comp Callouts<B>" {
	BIND "ENEMY PUSHING" "say_team **ENEMY PUSHING**" |
	BIND "ENEMY SPY" "say_team *ENEMY SPY ROUND HERE*" |
}

Result in game: *executes $pageopen_comp_callouts*

1. ENEMY PUSHING  
2. ENEMY SPY  

Example:

"Chat Binds" {
	"Cringe Binds" {
              BIND "RandomCritJoke" "say RandomCrits are fair and balanced." |
	}
	"Callouts" {
		BIND "Sniper!" "say_team SNIPER AHEAD!" |
		BIND "Medic Has Über!" "say_team ENEMY ÜBER PREPPED!" |
	}
}

Result in game:
*executes $pageopen_chat_binds*

1. Cringe Binds  
2. Callouts  

*hits 2*

1. Sniper!  
2. Medic Has Über!  

*hits 2*
Output in Chat: (TEAM) <playername>: ENEMY ÜBER PREPPED.
To exit the menu, select an option, or run cvm.exitmenu.

Key Value

Key-Values are the program's main way of configuration. They can only be assigned.

Syntax: <key : identifier> = <value : string> Example: #cvm.resetkeys = "bind 1 quickbuild_1; bind 2 quickbuild_2; bind 3 quickbuild_3; bind 4 quickbuild_4"

Key Values used by the generator:

  • #cvm.boldbydefault - If set to true, will bold all pages with <B>. As a result, <B> in titles will unbolden the selected characters. Note that the number key prepended will not be effected by this trick. Default value is "false".
  • #cvm.italicizedbydefault - If set to true, will italicize all entries with <I>. As a result, <I> in titles will unitalicize the selected characters. Note that the number key prepended will not be effected by this trick. Default value is "false".
  • #cvm.defaultcolor - Color tag that is inserted into every caption. Note that the number key prepended will not be effected by any tags. Default value is "".
  • #cvm.resetkeys - Command-String that runs after selecting a bind. Default value is "bind 1 slot1; bind 2 slot2; bind 3 slot3; bind 4 slot4; bind 5 slot5; bind 6 slot6; bind 7 slot7; bind 8 slot8; bind 9 slot9; bind 0 slot10".
  • #cvm.predisplay_time - cc_predisplay_time is set after exiting menu. Key Value determines the cvar value. Default value is "0.25".
  • #cvm.linger_time - cc_linger_time is set after exiting menu. Key Value determines the cvar value. Default value is "0".

Clone this wiki locally