FKiSS Data Types

See also: FKiSS, General Syntax, If-Endif Structure, Shortcuts, %Tags, Cel Groups, Value Pools, HINTs, Events, Actions

Overview

There are many different FKiSS data types which can be used as parameters in an FKiSS command:

Numbers

All numbers in FKiSS are integers, that is, values without a decimal point. For example, 5, 0, or -37 but not 3.14159.
Numbers have the following requirements:

Example:

;@ alarm(1)
;@   movebyx(#2, #1, 14)
;@   movebyy(#2, #1, 37)

Wrong:

;@ alarm(#1)             ; Alarms must be an integer, not an object
;@   movebyx(#2, #1, #14)  ; 3rd parameter must be an integer, not an object
;@   movebyy(#2, #1, 37.5) ; 3rd parameter cannot contain a decimal point

Strings

A string is a block of text surrounded by quotation marks. It can include any type of character except a quotation mark.

Example:

;@ alarm(1)
;@   notify("Hello, World!")
;@   shell("http://OtakuWorld.com/kiss/")

Wrong:

;@ notify(Hello, World!)         ; A string must be surrounded by quotes
;@ notify("John says, "Hello!"") ; Quotes cannot appear inside quotes

Cels

A cel is an image filename specified as a string. That is, a cel is identified by its filename (including the extension) surrounded by quotation marks.

Example:

;@ press("face1.cel")
;@   unmap("face1.cel")
;@   map("face2.cel")

Wrong:

;@ press(face1.cel) ; A cel name must be surrounded by quotes when used as a parameter
;@   map("face2")   ; A cel name must be a complete filename

Reuse of cels

It is possible to use the same cel in different objects. For example, you might want to use the same cel with different KCF palette files like this:
#1 hat.cel *1  ; In object #1, use the second defined KCF with hat.cel.
#27 hat.cel *3 ; In object #27, use the fourth defined KCF with hat.cel.
This is perfectly acceptable in KiSS. For FKiSS support, most modern viewers support such ambiguous cels by applying the action or event to all instances of that cel. For example:
;@ press("hat.cel")
;@   altmap("hat.cel")
This press event is activated by the user clicking on any instance of hat.cel. The altmap command is then performed for each instance of hat.cel individually.
And remember the quotation marks. You need both of them.

Objects

An object is identified by its object number preceeded with #.

Example:

;@ in(#1, #2)
;@   movebyx(#2, #1, 14)
;@   movebyy(#2, #1, 37)

Wrong:

;@ in(1, 2)          ; First 2 parameters are objects and need leading #
;@   movebyx(2, 1, 14) ; First 2 parameters are objects and need leading #
;@   movebyy(2, 1, 37) ; First 2 parameters are objects and need leading #

Groups

Groups are a new concept introduced in FKiSS4. A group is an arbitrary collection of cels that can span multiple objects. Many actions and events can be applied to all cels in a group.

Group Frames

In addition, cels in a group can be associated with group frames. A frame is nothing more than a collection of visible (mapped) cels. All other cels in the group that are not in the current frame are hidden (unmapped). Use the FKiSS setframe() command to change the frame number of a group, thereby showing a different set of cels in the group. Use the letframe() command to get the current frame of a group.
Using group frames with the timer() action and alarm event, it is possible to create animations.

Group Names

Groups are identified by the name of the group preceeded by !. Group names have the following requirements:
  • Must start with a letter.
  • Can contain up to 32 characters and numbers.
  • Cannot contain spaces.
  • Are case-insensitive (!group is the same as !GROUP).
  • Must not be surrounded by quotation marks.

Example:

;@ press(!ThisGroup)
;@   unmap(!Group1)
;@   map(!group2)

Wrong:

;@ press(ThisGroup)    ; Group name must be preceded by a !
;@   unmap("!ThisGroup") ; Group names cannot be surrounded by quotes
;@   map(!that group)    ; Group names cannot have spaces in them
;@   map(!2group)        ; Group names cannot start with a number

Alarms

Alarms are identified by either a number or, in FKiSS4, by a name. Alarm names have the following requirements:

Example:

;@ alarm(5)
;@   timer(MyAlarm, 100)
;@   timer(Alarm3, 100)

Wrong:

;@ alarm(My Alarm)    ; Alarm name cannot contain spaces
;@ alarm("MyAlarm")   ; Alarm name cannot be surrounded by quotes
;@   timer(#5, 100)     ; An alarm number must not be preceded by #
;@   timer(3Alarm, 100) ; An alarm name cannot start with a number
For more information about the use of alarms, see Alarm() and Timer().

Labels

Labels are event fragments or procedures introduced in FKiSS3. They are identified by either a number or, in FKiSS4, by a name.

A label name has the following requirements:
  • Must start with a letter.
  • Can contain up to 32 characters and numbers.
  • Cannot contain spaces.
  • Are case-insensitive (myalarm is the same as MYALARM).
  • Must not be surrounded by quotation marks.

Example:

;@ label(5)         ; Start of a procedure number 5. This can be the target of a gosub or a goto action.
;@   gosub(MyLabel) ; Call another procedure called MyLabel and return here when done.
;@   goto(MyLabel5) ; Jump to a procedure called MyLabel5 and do not come back.

Wrong:

;@ label(My Label)  ; A label name cannot contain spaces
;@ label("MyLabel") ; A label name cannot be surrounded by quotes
;@   gosub(#5)        ; A label number must not be preceded by #
;@   goto(5Label)     ; A label name cannot start with a number
For more information about the use of labels, see Label(), Gosub(), and Goto().

Variables

Variables were introduced in FKiSS3. In FKiSS3, a variable may be a single letter which may be followed by a single digit (for a total of 36 variables). In FKiSS4, a variable must start with a letter and may contain a total of 32 characters and numbers. Variables have the following requirements:
  • Name must start with a letter.
  • Name can contain up to 32 characters and numbers.
  • Name cannot contain spaces.
  • Name is case-insensitive (myvariable is the same as MYVARIABLE).
  • Name must not be surrounded by quotation marks.
  • Value must be in the range -2147483648 to 2147483647.
  • Value must not include a decimal point.
Variables may be used in the place of any number in an action command. In FKiSS4, variables may also take the place of object numbers in action commands. Variables may never be used in an event command.
Variables can have the same names as alarms or labels. However, in any command that expects an alarm or label value, it will use the alarm or label before checking to see if there is a variable with that name.

Example:

;@ alarm(5)
;@   let(X, 1)
;@   add(Sum, B1, B2)

Wrong:

;@ label(MyVariable)             ; If you do this, it will treat MyVariable as a label name
;@   let("X", 5)                   ; Variable names cannot be surrounded by quotes
;@   let(Name, "Fred")             ; variables cannot hold strings, only integers
;@   div(123result, bignumber, 10) ; variable names cannot start with a number
;@   div(result, big number, 10)   ; variable names cannot contain spaces

Value Pools

Value Pools are a new concept introduced in FKiSS4. Value Pools provide a way for variable values to be saved to disk and loaded again later, even during later sessions. For example, a game-based KiSS set could use a Value Pool to save the high score and load it again the next time that KiSS set is played or a KiSS doll might use a value pool to remember whether the user wanted the snap-to feature turned on and start with the same setting the next time that doll is loaded.
Each Value Pool can store any number of values, one for each named value entry.
For more details, see Value Pools.