An event command specifies the conditions under which a sequence of action commands are
executed. All actions listed after an event command are assumed to be part of that
event until the next event command is listed.
Examples:
;@ press("button.cel") ; Start of event when button.cel is clicked
;@ move(#37, 24, -10)
;@ move(#38, 1, 0)
;@ alarm(5) ; Start of alarm 5 event
;@ map("happy.cel")
;@ unmap("sad.cel")
An Action is a command which is immediately executed in response to
an event. An action can change a cel from mapped to unmapped or change
its color. An action can move an object to a new location or change the
value of a variable. Actions cover a wide-range of functionality.
All actions must belong to an FKiSS event.
Examples:
;@ map("hat.cel") ; Map the cel "hat.cel" to the current set (make it visible).
;@ move(#37, 24, -10) ; Move object #37 to the right 24 and up 10.
;@ let(X, 5) ; Assign the value 5 to the variable X.
More than one FKiSS command can occur on a single line, separated
by spaces. The first command on the line doesn't have to be an event but
it is usually easier to read if you do it that way. No matter what
however, an event command must come before any action commands.
Examples:
This layout puts all of the actions for an event on subsequent lines
that are indented one or two spaces and each event is separate by a blank line.
This makes for more lines in the
CNF
but the FKiSS code is easier to read.
;@ press("button.cel")
;@ move(#37, 24, -10)
;@ move(#38, 1, 0)
;@ alarm(5)
;@ map("happy.cel")
;@ unmap("sad.cel")
This layout puts all of the actions for an event on the same line
so only events appear at the beginning. This works best if the number
of actions is small (this is the same example as above).
;@ press("button.cel") move(#37, 24, -10) move(#38, 1, 0)
;@ alarm(5) map("happy.cel") unmap("sad.cel")
This is a minor alternate showing that the space after the ;@ is not needed.
;@alarm(5) map("hat.cel") move(#37, 24, -10)
This example shows that multiple events can be specified on the
same line (the alarm and press events). Be aware that this
layout is very hard to read.
;@alarm(5) map("hat.cel") press(#1) let(X, 5)
Wrong:
;@alarm(5)map("hat.cel")move(#37, 24, -10) ; Spaces must appear between actions
;@alarm(5) @map("hat.cel") @move(#37, 24, -10) ; @ must appear only at the start of the line