Pyrillic is a simplified Python dialect without indentation, and using symbols from the Cyrillic and other alphabets. It is designed to work with tile maps, allowing you to link classes with symbols in your map.
Why Cyrillic?
Because Cyrillic has special combining symbols that allow you to
combine any symbol with a letter from the Cyrillic alphabet. Example:
🏠ⷲ
Above the house symbol is combined with the Cyrillic letter ш
This is used in Pyrillic as the way to define which class each symbol in your map is.
Why No Indentation?
Pyrillic helps you get started with Python, and assumes you have never written any code.
To keep it as simple as possible, it discards the concept of nested logic,
and restricts you to writting code that runs from top to bottom.
When your ready for something more advanced, move onto using the
Pyjea Node Editor.
Operators:
Standard Python operators are another point of confusion for new coders,
for example the division symbol is forward slash.
In Pyrillic you can use unicode math operators ➕ ➖ ❌ ➗,
and the lambda symbol λ as a shortcut
for a Python lambda function that takes no arguments.
The symbol 🎲 is a shortcut for random() and 🎲(A,B) is a shortcut for uniform(A,B)
if/else:
IF(..., THEN=λ, ELSE=λ)
Above is the syntax for if/else logic. Example:
IF( 1 is 1, THEN=λ print('this is true'), ELSE=λ print('not printed') )
The example class above creates a duck, and then each frame moves and rotates it at random.
Note that duck is a plugin, you can see its code here.
The ready function is called when an object is created, in this case it assigns the duck to self.duck,
so that self.duck can be used in the animation update.
Each frame update the update function will be called, here the duck is moved and rotated at random.
The class above moves a platform up and down.
Note that self(ATTR=VALUE) is a shortcut for setattr(self,ATTR,VALUE)
Keep in mind that although these examples use indentation, it is optional,
and each line could be written without any leading spaces or tabs.
Above see that LibreOffice has a bug with some symbols and Cyrillic combining characters, the bug shows double-diamonds ?, note this is only a display bug and will not affect the map export into Blender.
Above the same document in Calligra Word, no display bugs, and better character spacing, we recommend you use
Calligra Office for making maps.
Circled numbers define the height of a line, ⑨ sets all following symbols on that line to 9 units high.
The symbols ⑴ to ⒇ define floating platforms of the given height.
Circled letters define waypoints for characters to move along. A character is set to follow a given set of waypoints
with the command syntax: SYMBOL(...) giving a sequence of the waypoint symbols.
This is just a quick intro to the map syntax, more on the syntax rules below.
Above you can see a cliff and waterfalls have been automatically generated because on those lines the height has been set using ⑧ and ⑨. The size and type of waterfall generated depends on its height, and how far it falls.
Select your code+map in Calligra Word, then drag and drop it into the Node Editor. This will create two nodes: a Pyrillic Scripting Node and a Tile Node. Plug the output of the Script Node into the first input of the Tile Node, and your map will appear in Blender.
Use single letter (A-Z) to set variables in your map. These should be defined at the top of your script. In the node editor each variable will be created as its own Node, and a Scriptlet Node will be attached to it if you have any commands following its definition. Each variable node will be plugged into the Tile Abstraction Layer Node, which is then plugged into your Tile Node.
https://gitlab.com/hartsantler/pyjea/-/blob/master/pyjea-gen-node.odt