Introduction to commands¶
Commands are what we use to tell UP Deck or OBS what to do, and how we want it done.
All command blocks are structured the same they contain a comment line, a command word, and a number of named and/or positional arguments.
this is the comment line
show
scene=this_scene
val=*
This would toggle the visibility of the scene, this_scene.
Variables¶
Its possible to set, and read variables in your commands. the
setvar is the primary way to set a number of variables. Variables
can be read by prefixing them with the $
symbol.
Note
Variables are local to the trigger point, if you trigger it on the app it will not be defined on the Server (xdeck) and vise-verse.
setup some variables
setvar
target=mellon
switch to the target variable
switch
scene=$target
Math Expressions¶
Its possible to evaluate math expressions () % < > + - / *
as well as
functions listed in the Corona Labs math library. (with out
the math.
prefix) These expressions can be evaluated
anywhere that the encasing square brackets ([]
) occur.
Warning
because of this feature do not use square brackets for any other reason in your command blocks
Note
just like variables, expressions only evaluate where they are triggered and don’t synchronize with other apps or the server.
Add 5 to the current value
setvar
this_counter=[$this_counter + 5]
Looping¶
the loop is a special command that causes the remaining command blocks to be executed multiple times
Note
looping only works when triggered from inside the app
See more about looping in the UP Deck docs