Skip to content

Latest commit

 

History

History
170 lines (134 loc) · 8.08 KB

CompilerConfig.md

File metadata and controls

170 lines (134 loc) · 8.08 KB

CompilerConfig

CompilerConfig defines what part of the Selfless Heroes language can be used by the player to solve the level.

Properties

  • excludePrimary [string array] list of primary statements keywords to be forbidden in the level. See the documentation on primary statements for more details on the keywords that can get into this array. required

  • valueFunctions [string array] list of value functions keywords available in the level. See the documentation on value functions for more details on the keywords that can get into this array. default: []

  • actionFunctions [string array] list of action functions keywords available in the level. See the documentation on action functions for more details on the keywords that can get into this array. required

  • leftComparisonExpressions [string array] defines which expression types are available for the left part of if comparisons. See the documentation about expression types for more details on the keywords that can get into this array. These types will be displayed in the left dropdown menu of the if block in the same order as you specify them in this array. required

  • rightComparisonExpressions [string array] defines which expression types are available for the right part of if comparisons. See the documentation about expression types for more details on the keywords that can get into this array. These types will be displayed in the right dropdown menu of the if block in the same order as you specify them in this array. required

  • forbiddenExpressions [string array] defines which expression types are forbidden in the level. See the documentation about expression types for more details on the keywords that can get into this array. default: []

  • terrainTypes [string array] defines which terrain types are available in the level. See the documentation about terrain types for more details on the keywords that can get into this array. These types will be displayed in the dropdown menu of the if block in the same order as you specify them in this array. required

  • objectTypes [string array] defines which terrain types are available in the level. See the documentation about object types for more details on the keywords that can get into this array. These types will be displayed in the dropdown menu of the if block in the same order as you specify them in this array. required

  • variables [integer] number of variables available in the level. Maximum value: 26. default: 0

  • messages [integer] number of different messages available in the level. Maximum value: 8. default: 0

  • minInteger [integer] minimum value of integer literals in the level. default: 0

  • maxInteger [integer] maximum value of integer literals in the level. default: 99

  • cloneIsDeadly [boolean] if true, when a hero tries to create a clone on a square already occupied (by a hero, a cauldron etc.) or on a forbidden square (like a wall), the hero will die. default: false

Primary statements

Primary statements are the different types of statements of first level in Selfless Heroes language.

keyword description
if if statement
jump jump statement
clone clone statement
assign assignment statement: anything like $a = function().
action action functions: all functions that are not used in an assignment. example: step().

Functions

Value functions

Value functions are functions that return a value.

keyword usage
set $a = set(1)
calc $a = calc($b + 1)
nearest $a = nearest(egg)

Action functions

Action functions are functions that don't return any value.

keyword usage
step step(e)
fireball fireball(e)
take take(e)
drop drop(e)
write write(1)
tell tell("hey" everyone)
listen listen("hey")

Expressions

Expression types

keyword description
terrain_type Terrain type: see the documentation about terrain types for more details.
object_type Object type: see the documentation about object types for more details.
direction Direction type: see the documentation about directions for more details.
integer Integer number type. integer icon
variable Variable type. variable icon
myitem myitem type. myitem icon
everyone everyone type. everyone icon
message Message type: see the documentation about messages for more details.

Terrain types

keyword ico
floor floor icon
wall wall icon
hole hole icon
infected infected icon

Object types

keyword ico
nothing nothing icon
hero hero icon
npc npc icon
switch switch icon
bonfire bonfire icon
cauldron cauldron icon
spikes spikes icon
egg egg icon

Directions

keyword name
here here
e east
s south
w west
n north
nw northwest
ne northeast
se southeast
sw southwest

Messages

keyword ico
"hey" message hey icon
"lol" message lol icon
"ho" message ho icon
"kiss" message kiss icon
"stop" message stop icon
"wait" message wait icon
"ok" message ok icon
"coffee" message coffee icon