Skip to content

Captions in Scripts

clovervidia edited this page Aug 30, 2014 · 2 revisions

#Using Captions in your Scripts

Ever wanted to show text on screen when you toggle something on and off? Well, enter close captions!

Using the cc_emit command, you can display a pre-made caption on screen whenever you like in a script.

Here is my rocket-jump script that uses captions:

//[ Rocket Jump
cc_emit #RJ.OFF
echo "Rocket Jump toggle is ready!"
bind "MOUSE2" "+rj"
bind "R" "rjToggle"
alias "+rocketJump" "+jump; +duck; +attack; spec_prev"
alias "-rocketJump" "-jump; -duck; -attack"
alias "+rj" "+attack2; spec_prev"
alias "-rj" "-attack2"
alias "rjToggle" "rjOn"
alias "rjOn" "alias +rj +rocketJump; alias -rj -rocketJump; alias rjtoggle rjoff; cc_emit #RJ.ON; play hl1/fvox/activated"
alias "rjOff" "alias +rj +attack2; alias -rj -attack2; alias rjtoggle rjon; cc_emit #RJ.OFF; play hl1/fvox/deactivated"
//]

Basically, whenever I hit R, it toggles rocket-jumping on and off. Additionally, it plays the suit voice from HL2 saying "Activated" or "Deactivated" and it runs this line of code:

cc_emit #RJ.Enabled

This emits the caption tagged #RJ.Enabled to the screen.

#Looking for a good caption

I have made several common captions for scripts that people commonly use so that you don't have to make your own.

Some examples:

#Reload.ON/#Reload.OFF

"Auto-reload turned <B>ON."
"Auto-reload turned <B>OFF."

#RJ.Disabled/#RJ.Enabled

"Rocket-jumping <B>DISABLED."
"Rocket-jumping <B>ENABLED."

#Engi.SJ.OFF/#Engi.SJ.ON

"Sentry-jumping <B>DISABLED."
"Sentry-jumping <B>ENABLED."

#Demo.Chargeturn.ON/#Demo.Chargeturn.OFF

"Charge-turn set to <B>ON."
"Charge-turn set to <B>OFF."

#Autofire.R.OFF/#Autofire.R.ON/#Autofire.G.OFF/#Autofire.G.ON/#Autofire.B.OFF/#Autofire.B.ON
The letter between Autofire and ON/OFF represents which color it is: Red, Green or Blue

"[+=●●] Turbo B <B>OFF"
"[+=●●] Turbo B <B>ON"

##Weapon Switcher Captions

If you play using a weapon switcher and without viewmodels enabled, it can be hard to keep track of which weapon is currently out. I've added captions for each class, as well as a general set for you to use in your switcher script.

###Class captions

The basic name is #CLASS.1,2,3,4,5. Only Engineer has 4 and 5 captions for his two PDAs.

#Heavy.1

"Switched to <B>Minigun"

###General captions

Just three for the three basic slots. #Weapon.1, #Weapon.2 and #Weapon.3.

#Weapon.1

"Switched to <B>Primary"

Clone this wiki locally