FKiSS 3 Specifications


 

FKiSS3

This version is a total departure from previous versions, introducing variables, labels and a conditional if-else-end block.  These variables can have a positive or negative integer value (no decimals) and are named A to Z, A0 to Z0, A1 to Z1 etc. up to A9 and Z9, making a total of 286 variables. They are used in the "if" line of if-else-end blocks, and can substitute integer arguments, which in practice means they can replace almost any number.


Events (FKiSS 3)


label()

Syntax: label(number)
Example: label(511)

A way of reusing the same code under different events. A label is like an alarm with no timer; the code under it is executed as part of the event that it was called from. As with alarms, the official maximum number of labels is 512 (from 0 to 511), but viewers will usually allow 1000 labels or more.

Related actions: gosub(), goto(), gosubrandom(), gotorandom()

overflow()

Syntax: overflow()

Triggered when a calculation produces an impossible value, notably division by zero.

Related actions: add(), sub(), mul(), div(), mod()


Actions (FKiSS 3)


add()

Syntax: add(variable,integer/variable,integer/variable)
Example: add(A,3,7), add(A,A1,A2) add(A,A,1)

Adds the second two numbers or variables and assigns the value to the first variable.

Related actions: sub(), mul(), div(), mod()
Related events: overflow()

div()

Syntax: div(variable,integer/variable,integer/variable)
Example: div(A,3,7), div(A,A1,A2) div(A,A,1)

Divides the second number or variable by the third, truncating the result to a whole number, and assigns the value to the first variable.

Related actions: add(), sub(), mul(), mod()
Related events: overflow()

else()

Syntax: else()

An optional part of the if-else-end block: the actions under it are carried out if the condition of the "if" statement is false. Requires an "if" statement and a terminating endif().

Related actions: elseifequal(), elseifnotequal(), elseifgreaterthan(), elseiflessthan(), endif()

endif()

Concludes an if-else-end block. Requires an "if" statement.

Related actions: ifequal(), ifnotequal(), ifgreaterthan(), iflessthan()

exitevent()

Syntax: exitevent()

Quits the event, so that any actions under it are ignored.

Related actions: goto()

ghost()

Syntax: ghost(celname/object,1/0)
Example: ghost("wall.cel",1), ghost(#77,0)

Makes a cel unclickable and undraggable, as if it isn't there; any mouse-clicks will be registered by the cel below it. The value 1 ghosts the cel/object, 0 unghosts it.

gosub()

Syntax: gosub(label number)
Example: gosub(9), gosub(L)

Jumps to the label, then returns to its own event to carry out any actions that come after it.

Related event: label()
Related actions: gosubrandom(), goto()

gosubrandom()

Syntax: gosubrandom(integer/variable,label1,label2)
Example: gosubrandom(90,33,30)

Like gosub(), but randomly chooses one of two labels with a likelyhood of the first value that it will go to the first label, and a likelyhood of the first value subtracted from 100 that it will go to the second. In the above example, there is a 90% chance that label 33 will be chosen, and 10% chance that label 30 will be chosen.

Related actions: gosub(), gotorandom()

goto()

Syntax: goto(label number)
Example: goto(9), goto(L)

Jumps to the label, quitting its own event and ignoring any actions that come after it.

Related events: label()
Related actions: gotorandom(), gosub(), exitevent()

gotorandom()

Syntax: gotorandom(integer/variable,label1,label2)
Example: gotorandom(90,33,30)

Like goto(), but randomly chooses one of two labels with a likelyhood of the first value that it will go to the first label, and a likelyhood of the first value subtracted from 100 that it will go to the second. In the above example, there is a 90% chance that label 33 will be chosen, and 10% chance that label 30 will be chosen.

Related actions: goto(), gosubrandom()

ifequal()

Syntax: ifequal(integer/variable A,integer/variable B)
Example: ifequal(A0,9)

Begins a conditional if-else-end block. The actions under it are carried out if the first integer or variable has the same value as the second. Can't be used within another if-else-end block.

Related actions: ifnotequal(), ifgreaterthan(), ifflessthan(), else(), endif(), elseifequal()

ifgreaterthan()

Syntax: ifgreaterthan(integer/variable A,integer/variable B)
Example: ifgreaterthan(A0,9)

Begins a conditional if-else-end block. The actions under it are carried out if the first integer or variable has a higher value than the second. Can't be used within another if-else-end block.

Related actions: ifequal(), ifnotequal(), iflessthan(), else(), endif(), elseifgreaterthan()

iflessthan()

Syntax: iflessthan(integer/variable A,integer/variable B)
Example: iflessthan(A0,9)

Begins a conditional if-else-end block. The actions under it are carried out if the first integer or variable has a lower value than the second. Can't be used within another if-else-end block.

Related actions: ifequal(), ifnotequal(), ifgreaterthan(), else(), endif(), elseiflessthan()

ifnotequal()

Syntax: ifnotequal(integer/variable A,integer/variable B)
Example: ifnotequal(A0,9)

Begins a conditional if-else-end block. The actions under it are carried out if the first integer or variable has a different value from the second. Can't be used within another if-else-end block.

Related actions: ifequal(), ifgreaterthan(), iflessthan(), else(), endif(), elseifnotequal()

let()

Syntax: let(variable,integer/variable)
Example: let(A,500), let(A,B)

Sets the variable to the value of the integer or second variable, ie. A is now 500.

Related actions: random()

letcatch()

Syntax: letcatch(variable)
Example: letcatch(O1)

Sets the variable to the object that has just been pressed (clicked on). If no object has been clicked on, the variable is set to -1.

Related events: press()

letcollide()

Syntax: letcollide(variable,cel 1,cel 2)
Example: letcollide(C,"door.cel","wall.cel")

Sets variable to 1 if any visible part of the first cel overlaps with any visible part of the second cel, otherwise to 0.

Related events: collide(), apart()
Related actions: letcollide() under FKiSS4

letfix()

Syntax: letfix(variable,object)
Example: letfix(F,#10)

Sets the variable to the current fix value of the object.

Related actions: setfix()

letinside()

Syntax: letinside(variable,object 1,object 2)
Example: letinside(I9,#20,#13)

Sets the variable to 1 if the bounding boxes of the first and second object overlap, and to 0 if they don't.

Related events: in(), out(), stillin(), stillout()

letmapped()

Syntax: letmapped(variable,celname)
Examples: letmapped(M1,"celB.cel")

Sets the variable to 1 if the cel is mapped, and 0 if it isn't.

Related actions: letmapped() under FKiSS4, map(), unmap(), altmap(), ifmapped(), ifnotmapped()

letmousex()

Syntax: letmousex(variable)
Example: letmousex(X)

Sets the variable to the value of the mouse pointer's X coordinate, or to -1 if the mouse pointer is outside the playfield.

Related actions: letmousey()

letmousey()

Syntax: letmousey(variable)
Example: letmousey(Y)

Sets the variable to the value of the mouse pointer's Y coordinate, or to -1 if the mouse pointer is outside the playfield.

Related actions: letmousex()

letobjectx()

Syntax: letobjectx(variable,object)
Example: letobject(X0,#46)

Fills the variable with the value of the object's X coordinate.

Related actions: letobjecty(), movebyx(), moverandx(), letinitx()

letobjecty()

Syntax: letobjecty(variable,object)
Example: letobject(Y0,#46)

Fills the variable with the value of the object's Y coordinate.

Related actions: letobjectx(), movebyy(), moverandy(), letinity()

letpal()

Syntax: letpal(variable)
Example: letpal(L)

Fills the variable with the number of the currently active palette group.

Related events: col()
Related actions: changecol()

letset()

Syntax: letset(variable)
Example: letset(L)

Fills the variable with the number of the currently active page.

Related events: set()
Related actions: changeset()

lettransparent()

Syntax: lettransparent(variable,celname)
Example: lettransparent(L2,"fog.cel")

Fills the variable with the transparency value of the cel.

Related actions: lettransparent() under FKiSS4, transparent()
Related tags: %t

mod()

Syntax: mod(variable,integer/variable,integer/variable)
Example: mod(A,3,7), mod(A,A1,A2) mod(A,A,1)

Divides the second value by the third and assigns the remainder to the first variable; if there is no remainder, the variable value is 0.

Related actions: add(), sub(), mul(), div()
Related events: overflow()

mul()

Syntax: mul(variable,integer/variable,integer/variable)
Example: mul(A,3,7), mul(A,A1,A2) mul(A,A,1)

Multiplies the last two values and assigns the value to the first variable.

Related actions: add(), sub(), div(), mod()
Related events: overflow()

random()

Syntax: random(variable,minimum value,maximum value)
Example: random(R,25,40), random(A0,B0,C0)

Sets a variable to a randomly chosen value between the minimum and maximum value.

Related actions: let()

sub()

Syntax: sub(variable,integer/variable,integer/variable)
Example: sub(A,3,7), sub(A,A1,A2) sub(A,A,1)

Subtracts the third value from the second one and assigns the value to the first variable.

Related actions: add(), mul(), div(), mod()
Related events: overflow()




Next Document:  FKiSS 4 Specifications
Prior Document:  FKiSS 2 Specifications

Copyright (c) 2002 WSM Information System Inc.